【发布时间】:2020-02-18 20:20:07
【问题描述】:
我正在尝试使用以多项式 SVM 作为基础分类器的 AdaBoost 创建模型。
sn-p代码如下:
base_clf = SVC(kernel='poly', degree=3, class_weight='balanced', gamma='scale', probability=True)
model = AdaBoostClassifier(base_estimator=base_clf, n_estimators=10)
model.fit(X_train, y_train)
y_predict = model.predict(X_test)
我面临的问题是模型总是只预测1
将 AdaBoost 与 SVM 一起用作基分类器是否不正确?请指导。
【问题讨论】:
-
你有不平衡的课程吗?你是如何拆分训练和测试的
-
@Rubens_Zimbres 有 416 个“1”类和 167 个“0”类。我正在使用以下方法拆分数据:train_test_split(features, target, test_size=0.3, random_state=0)
标签: python machine-learning scikit-learn svm adaboost