标签:
参考:http://scikit-learn.org/stable/modules/preprocessing_targets.html
没什么好翻译的,直接给例子。
1、Label binarization
LabelBinarizer is a utility class to help create a label indicator matrix from a list of multi-class labels:
Binary targets transform to a column vector
Passing a 2D matrix for multilabel classification
For multiple labels per instance, use MultiLabelBinarizer:
2、Lable encoding
LabelEncoder is a utility class to help normalize labels such that they contain only values between 0 and n_classes-1. LabelEncoder can be used as follows:
It can also be used to transform non-numerical labels (as long as they are hashable and comparable) to numerical labels:
版权声明:本文为博主原创文章,未经博主允许不得转载。
scikit-learn:4.8. Transforming the prediction target (y)
标签:
原文地址:http://blog.csdn.net/mmc2015/article/details/47069869