panda数据分析

1.将离散变量进行ONE-HOT编码​

​在作为示例的租房数据中,分类变量 neighborhood 可以对应三个值:运用 Scikit-Learn 中的 DictVectorizer 函数,我们将以上租房数据的分类变量转换为 one-hot 形式

one-hot编码one-hot编码


可以通过调用 getfeaturenames 函数,来查看转换后的数组中对应的列名:

要注意的是,当我们将 DictVectorizer 函数参数 sparse 的值设置为 True 时,转换后的对象将不再是一个数组,而是一个 sparse matrix 对象​

参考地址:https://www.cnblogs.com/jasonfreak/p/5448385.html​​

https://www.cnblogs.com/5poi/p/7240601.html​

http://makaidong.com/yifdu25/90162_16542816.html​

https://blog.csdn.net/wizardforcel/article/details/54177960​

kaggle:​

https://blog.csdn.net/Koala_Tree/article/details/78725881​

https://blog.csdn.net/guoxinian/article/details/73740746​

学习资料:​

https://download.csdn.net/download/qq_21578125/10353963​

https://blog.csdn.net/u012448083/article/details/57419723​

https://blog.csdn.net/qq_26898461/article/details/49275401​

https://blog.csdn.net/starzhou/article/details/73930150​

https://blog.csdn.net/Koala_Tree/article/details/78725881​

https://blog.csdn.net/hermito/article/details/51862733​

https://blog.csdn.net/jdbc/article/details/72468001​

https://blog.csdn.net/qq_33614902/article/details/80712348​

https://blog.csdn.net/levy_cui/article/details/72831001​

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值