# -*- coding: utf-8 -*-
'''
Created on 2018年1月19日
@author: Jason.F
@summary: Boosting,无放回抽样,串行训练基学习器,用整个训练集来训练弱学习机,训练样本在每次迭代中都会重新赋予一个权重,在上一弱学习机错误的基础上进行学习进而构建一个更强大的分类器。
'''
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder
from sklearn.cross_validation import train_test_split
from sklearn.ensemble import AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt
#导入数据和数据处理
df_wine = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data',header=None)
df_wine.columns=['Class label','Alcohol','Malic acid','Ash','Alcalinity of ash','Magnesium','Total phenols','Flavanoids','Nonflavanoid phenols','Proanthocyanins','Color intensity','
【Python-ML】SKlearn库集成学习器Boosting
最新推荐文章于 2024-05-04 11:52:32 发布