Skip to content

Commit

Permalink
1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaochaoroulalala committed Nov 23, 2023
1 parent 14b4e49 commit e2ec6d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@
元学习器这里采用毛南设计好的adaboost分类器,通过将第一层基础模型的预测结果作为新的特征矩阵进行训练。

融合模型最终输出的预测结果就是元学习器输出的结果。

效果图:

![image-20231123222727368](C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\image-20231123222727368.png)
2 changes: 1 addition & 1 deletion yugou_theoryBest.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
# 元模型
meta_model = AdaBoostClassifier(base_estimator=base_classifier, n_estimators=50, learning_rate=0.1, random_state=0)
# 划分数据集
X_train_base, X_stack, y_train_base, y_stack = train_test_split(X_train, y_train, test_size=0.2, random_state=0)
X_train_base, X_stack, y_train_base, y_stack = train_test_split(X_train, y_train, test_size=0.3, random_state=0)
# 使用基础模型在一部分训练集上训练
mlp_model.fit(X_train_base, y_train_base)
logit_model.fit(X_train_base, y_train_base)
Expand Down

0 comments on commit e2ec6d1

Please sign in to comment.