def fit(self, X, Y):
import sklearn.svm
from sklearn.feature_selection import SelectFromModel
self.C = float(self.C)
self.tol = float(self.tol)
self.dual = self.dual == 'True'
self.fit_intercept = self.fit_intercept == 'True'
self.intercept_scaling = float(self.intercept_scaling)
if self.class_weight == "None":
self.class_weight = None
preprocessor = sklearn.svm.LinearSVC(penalty=self.penalty,
loss=self.loss,
dual=self.dual,
tol=self.tol,
C=self.C,
class_weight=self.class_weight,
fit_intercept=self.fit_intercept,
intercept_scaling=self.intercept_scaling,
multi_class=self.multi_class,
random_state=self.random_state)
preprocessor.fit(X, Y)
self.preprocessor = SelectFromModel(preprocessor, prefit=True)
return self
liblinear_svc_preprocessor.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录