[Sklearn应用2] Preprocessing data (二)Binarization 二分化
来源:互联网 发布:多得美工学院b段班 编辑:程序博客网 时间:2024/06/03 22:18
此内容在sklearn官网地址:http://scikit-learn.org/stable/modules/preprocessing.html#
sklearn版本:0.18.2
Binarization
Feature binarization is the process of thresholding numerical features to get boolean values. This can be useful for downstream probabilistic estimators that make assumption that the input data is distributed according to a multi-variate Bernoulli distribution. For instance, this is the case for the sklearn.neural_network.BernoulliRBM. ——scikit-learn.org
根据设定的阈值将连续的变量离散化,转化成0、1。具有以下优点:
- 可以用稀疏矩阵表示,节省存储空间,加快计算速度。
- 可以有效处理 miss_value(NA)
稀疏矩阵(sparse matrix):零元素数目远远多于非零元素数目,并且非零元素的分布没有规律的矩阵。
from sklearn.preprocessing import Binarizerbi = Binarizer(threshold=0) # threshold为阈值,>threshold将对应的值设为1,<=threshold设为0bi.fit(X) # fit does nothingX_bi = bi.transform(X)
多组分类
pandas.cut() # 分组内容需为数值
阅读全文
0 0
- [Sklearn应用2] Preprocessing data (二)Binarization 二分化
- [Sklearn应用1] Preprocessing data(一) 标准化 正则化
- [Sklearn应用3] Preprocessing data (三)编码分类特征 Encoding categorical features
- [Sklearn应用4] Preprocessing data (四)missing values 缺失值处理
- Preprocessing data-sklearn数据预处理
- data-sklearn数据预处理 Preprocessing
- Preprocessing data-sklearn数据预处理
- scikit-learn Preprocessing学习笔记(二)
- sklearn preprocessing
- sklearn-Preprocessing
- [Sklearn应用6] Feature Selection 特征选择(二)
- sklearn preprocessing 数据预处理(OneHotEncoder)
- sklearn preprocessing 数据预处理(OneHotEncoder)
- sklearn 常用api(二)
- sklearn 数据集(二)
- Sklearn-preprocessing.PolynomialFeatures
- sklearn.preprocessing.PolynomialFeatures 用法
- sklearn.preprocessing.PolynomialFeatures
- Java反射机制详解
- 剑指offer——数组中的逆序数_____(归并排序)
- 大二这个年纪
- 前端学习笔记4:CSS的继承、层叠和特殊性
- HTML常用标签小结
- [Sklearn应用2] Preprocessing data (二)Binarization 二分化
- 设计模式--工厂模式(六)
- 设计模式--工厂模式(简要)(七)
- Spark分布式消息发送流程
- win10 MongoDB 服务自启动及数据导出
- HTTP详解--HTTP方法(五)
- Java面试题
- 石子问题
- Xcode8使用出现 Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/P