MCPcopy Create free account
hub / github.com/Persper/code-analytics / fit

Method fit

persper/classifier.py:257–268  ·  view source on GitHub ↗
(self, X, y)

Source from the content-addressed store, hash-verified

255 self.k = k
256
257 def fit(self, X, y):
258 self.label_binarizer = LabelBinarizer(sparse_output=True)
259 Y = self.label_binarizer.fit_transform(y)
260 Y = Y.tocsc()
261 self.classes = self.label_binarizer.classes_
262 columns = (col.toarray().ravel() for col in Y.T)
263
264 self.pipelines = Parallel(n_jobs=self.n_jobs)(
265 delayed(_fit_binary)(
266 self.estimator, self.use_bns,
267 self.use_text, self.use_frc, self.k, X, column)
268 for column in columns)
269
270 def predict(self, X):
271 if(hasattr(self.pipelines[0], 'decision_function') and

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected