机器学习流程

文章来源:

https://blog.csdn.net/han_xiaoyang/article/details/50469334

https://blog.csdn.net/han_xiaoyang/article/details/52910022

1. 常用算法

(from 七月在线-kaggle竞赛视频)。

2. 流程

3. 知识点

1. 样本不均衡时,如正负样本10:100,解决办法。

(样本不均衡的坏处,如1:100,把数据都判断为负类,在训练时数据误差很低,但是预测时很不准确)

1)将正样本上采样(正样本重复若干次)

2)损失函数(加大正样本的loss)

3)把负样本分成10分,分别与正样本去训练。如bagging去投票

2. 工具

pandas:数据量大的时候,一个特征维度的去做。

hive sql / spark sql

3. 缺省

缺省很小:填充

缺省很大:舍去

缺省适中:把缺省当作一个特征

4. 数据域

当前数据域分布没有规律,可以变换到log域、指数域----可能数据会呈现一定的规律

时间类数据:间隔、与其他特征组合、离散型、时间段

文本型数据:n-gram、bag of words、TF-IDF、wordvec

统计型特征:min、max、中位数

5. 主要用的两个模块(sklearn) https://scikit-learn.org/stable/index.html

preprocessing 以及 feature_extraction

https://scikit-learn.org/stable/modules/preprocessing.html

https://scikit-learn.org/stable/modules/classes.html#module-sklearn.feature%20extraction

6. 模型融合

blending

bagging

 

stacking

使用不同的分类器,产生不同的分类结果。将这些结果作为输入,

如果使用这些结果的的linear取加权平均。就是blending方法。(没有再sklearn中封装)

boosting

Adaboost: 调样本的权重

xgboost / lightgbm

7. 绘制学习曲线(模型状态评估)

https://www.zybuluo.com/hanxiaoyang/note/545131

8. xgboost的调参 

 https://github.com/dmlc/xgboost  有一些xgboost的demo

9. 可视化

http://seaborn.pydata.org/

https://scikit-learn.org/stable/auto_examples/manifold/plot_lle_digits.html#example-manifold-plot-lle-digits-py

原文地址:https://www.cnblogs.com/GuoXinxin/p/10686887.html