分类——KNN、朴素贝叶斯、决策树、SVM、集成

本文深入探讨了五大常用的分类算法:K近邻(KNN)、朴素贝叶斯、决策树、支持向量机(SVM)以及集成学习方法,如随机森林和AdaBoost。每种算法的原理、优缺点及应用场景进行了详细阐述,帮助读者理解如何选择和应用这些算法进行有效的数据分类。
摘要由CSDN通过智能技术生成
import pandas as pd
import numpy as np
from sklearn.preprocessing import MinMaxScaler,StandardScaler
from sklearn.preprocessing import LabelEncoder,OneHotEncoder
from sklearn.preprocessing import Normalizer
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.decomposition import PCA
#添加graphviz环境变量
import os
#os.environ["Path"]+=os.pathsep+"F:\graphviz\bin"
os.environ["PATH"]+=os.pathsep+"F:/graphviz/bin"
import pydotplus
#sl:satisfaction_level——False表示MinMaxScaler归一化
#npr:number_project——False表示MinMaxScaler归一化,True表示StandardScaler标准化
#amh:average_monthly_hours——False表示MinMaxScaler归一化,True表示StandardScaler标准化
#tsc:time_spend_company——False表示MinMaxScaler归一化,True表示StandardScaler标准化
#wa:Work_accident——False表示MinMaxScaler归一化,True表示StandardScaler标准化
#pl5:promotion_last_5years——False表示MinMaxScaler归一化,True表示StandardScaler标准化
#dp:department——False:LabelEncoding,True:OneHotEncoding
#slr:salary——False:LabelEncoding,True:OneHotEncoding
#lower_d:是否降维——False:不降维,True降维
#ld_n:指定降为几维
def hr_preprocessing(sl=False,le=False,npr=False,amh=False,tsc=False,wa=False,pl5=False,dp=False,slr=False,lower_d=False,ld_n=1):
    df
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值