![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
机器学习基础
maomaona
这个作者很懒,什么都没留下…
展开
-
[机器学习 - 基本算法] 感知机
import numpy as npimport matplotlib.pyplot as plt# initializationn = 2l = 100x1 = np.random.randint(0, 100, size=(l, n))x2 = np.random.randint(-100, 0, size=(l, n))x = np.array((x1, x2)).res...原创 2018-03-11 21:04:48 · 159 阅读 · 0 评论 -
[机器学习 - 算法原理] CART树剪枝的理解
看了李航的《统计学习方法》中CART树的剪枝,不很清晰,又查了网上一些相关资源,终于明白了整个过程,个人的理解如下(原本写在OneNote上,公式粘贴过来不能显示,就贴图了):but...既然剪来剪去都要所有子树一起去做交叉验证...那直接做交叉验证不行吗...?...原创 2018-03-24 23:07:35 · 987 阅读 · 2 评论 -
[机器学习 - 算法原理] lasso与岭回归的差异
原创 2018-03-25 17:02:46 · 1361 阅读 · 0 评论 -
[Kaggle] kernel中常用方法和语句总结
目录读取数据表格类型数据读数据,看行数、列数,前几行EDA查看目标变量分布目标变量为分类变量查看缺失值目标dataframe缺失数据的分布查看不同类型变量情况Category/分类变量预处理object类型的变量是分类变量,查看所有分类变量的取值个数Label Encoder - 注意要同时code train和test集!OneHot E...原创 2019-05-12 19:50:25 · 1106 阅读 · 0 评论 -
[机器学习 - 算法调用] 随机森林 sklearn.RandomForestCLassifier/ Regressor
特征重要性feature_importances_Return the feature importances (the higher, the more important the feature).Returns: feature_importances_:array, shape = [n_features] The values of this arr...原创 2019-05-14 22:07:43 · 1204 阅读 · 0 评论 -
[机器学习 - 特征工程] Category/分类变量预处理 - Label Encoding和OneHot Encoding的选择
总结:Label Encoding优点:节约空间缺点:对同一个特征,每次编码的结果不一样;编码隐含了特征取值的相关关系OneHot Encoding优点:避免了LabelEncoding的缺点...缺点:特征取值多时占用空间较多使用推荐:在特征取2值时,使用LabelEncoding。其他情况用OneHotEncoding,如果转换之后维度过高,后续用PCA或其...原创 2019-05-12 13:44:42 · 1451 阅读 · 0 评论