@@ -197,7 +197,6 @@ def predict_proba(self, X):
197
197
198
198
199
199
class SparseBaseLibLinear (BaseLibLinear ):
200
-
201
200
def fit (self , X , y , class_weight = None ):
202
201
"""
203
202
Fit the model using X, y as training data.
@@ -215,8 +214,6 @@ def fit(self, X, y, class_weight=None):
215
214
self : object
216
215
Returns an instance of self.
217
216
"""
218
-
219
- import scipy .sparse
220
217
X = scipy .sparse .csr_matrix (X )
221
218
y = np .asarray (y , dtype = np .int32 , order = 'C' )
222
219
if X .shape [0 ] != y .shape [0 ]:
@@ -254,7 +251,6 @@ def predict(self, X):
254
251
-------
255
252
C : array, shape = [n_samples]
256
253
"""
257
- import scipy .sparse
258
254
X = scipy .sparse .csr_matrix (X )
259
255
self ._check_n_features (X )
260
256
X .data = np .asarray (X .data , dtype = np .float64 , order = 'C' )
@@ -283,7 +279,6 @@ def decision_function(self, X):
283
279
Returns the decision function of the sample for each class
284
280
in the model.
285
281
"""
286
- import scipy .sparse
287
282
X = scipy .sparse .csr_matrix (X )
288
283
self ._check_n_features (X )
289
284
X .data = np .asarray (X .data , dtype = np .float64 , order = 'C' )
0 commit comments