def stump(X, y):
score = cross_val_score(LinearSVC(), X, y, cv = 5, n_jobs=5, scoring = 'average_precision')
clf = LinearSVC()
clf.fit(X, y)
coef = clf.coef_[0,0]
inter = clf.intercept_[0]
return np.mean(score), np.sign(coef), inter / np.abs(coef)
评论列表
文章目录