Ensemble Methods in Python
Román de las Heras
Data Scientist, Appodeal

Làm sao ước lượng tốt?
Giá trị thật ~ trung bình(các ước lượng)
Thuộc tính
Bộ phân loại lấy trung bình
from sklearn.ensemble import VotingClassifierclf_voting = VotingClassifier( estimators=[ ('label1', clf_1), ('label2', clf_2), ... ('labelN', clf_N)], voting='soft', weights=[w_1, w_2, ..., w_N] )
Bộ hồi quy lấy trung bình
from sklearn.ensemble import VotingRegressorreg_voting = VotingRegressor( estimators=[ ('label1', reg_1), ('label2', reg_2), ... ('labelN', reg_N)], weights=[w_1, w_2, ..., w_N] )
# Instantiate the individual models
clf_knn = KNeighborsClassifier(5)
clf_dt = DecisionTreeClassifier()
clf_lr = LogisticRegression()
# Create an averaging classifier
clf_voting = VotingClassifier(
estimators=[
('knn', clf_knn),
('dt', clf_dt),
('lr', clf_lr)],
voting='soft',
weights=[1, 2, 1]
)
Mục tiêu:
Đặc trưng:

Ensemble Methods in Python