5
5
# pool at each step.
6
6
7
7
import numpy as np
8
- cimport numpy as np
8
+ cimport numpy as cnp
9
9
cimport cython
10
10
from cython cimport floating
11
11
12
- np .import_array()
12
+ cnp .import_array()
13
13
14
14
15
15
def _inplace_contiguous_isotonic_regression (floating[::1] y , floating[::1] w ):
@@ -63,9 +63,9 @@ def _inplace_contiguous_isotonic_regression(floating[::1] y, floating[::1] w):
63
63
i = k
64
64
65
65
66
- def _make_unique (np .ndarray[dtype = floating] X,
67
- np .ndarray[dtype = floating] y,
68
- np .ndarray[dtype = floating] sample_weights):
66
+ def _make_unique (cnp .ndarray[dtype = floating] X,
67
+ cnp .ndarray[dtype = floating] y,
68
+ cnp .ndarray[dtype = floating] sample_weights):
69
69
""" Average targets for duplicate X, drop duplicates.
70
70
71
71
Aggregates duplicate X values into a single X value where
@@ -76,10 +76,10 @@ def _make_unique(np.ndarray[dtype=floating] X,
76
76
"""
77
77
unique_values = len (np.unique(X))
78
78
79
- cdef np .ndarray[dtype= floating] y_out = np.empty(unique_values,
79
+ cdef cnp .ndarray[dtype= floating] y_out = np.empty(unique_values,
80
80
dtype = X.dtype)
81
- cdef np .ndarray[dtype= floating] x_out = np.empty_like(y_out)
82
- cdef np .ndarray[dtype= floating] weights_out = np.empty_like(y_out)
81
+ cdef cnp .ndarray[dtype= floating] x_out = np.empty_like(y_out)
82
+ cdef cnp .ndarray[dtype= floating] weights_out = np.empty_like(y_out)
83
83
84
84
cdef floating current_x = X[0 ]
85
85
cdef floating current_y = 0
0 commit comments