Home | Trees | Indices | Help |
|
---|
|
Encode labels with value between 0 and n_classes-1. This node has been automatically generated by wrapping the ``sklearn.preprocessing.label.LabelEncoder`` class from the ``sklearn`` library. The wrapped instance can be accessed through the ``scikits_alg`` attribute. Read more in the :ref:`User Guide <preprocessing_targets>`. **Attributes** ``classes_`` : array of shape (n_class,) Holds the label for each class. **Examples** `LabelEncoder` can be used to normalize labels. >>> from sklearn import preprocessing >>> le = preprocessing.LabelEncoder() >>> le.fit([1, 2, 2, 6]) LabelEncoder() >>> le.classes_ array([1, 2, 6]) >>> le.transform([1, 1, 2, 6]) #doctest: +ELLIPSIS array([0, 0, 1, 2]...) >>> le.inverse_transform([0, 0, 1, 2]) array([1, 1, 2, 6]) It can also be used to transform non-numerical labels (as long as they are hashable and comparable) to numerical labels. >>> le = preprocessing.LabelEncoder() >>> le.fit(["paris", "paris", "tokyo", "amsterdam"]) LabelEncoder() >>> list(le.classes_) ['amsterdam', 'paris', 'tokyo'] >>> le.transform(["tokyo", "tokyo", "paris"]) #doctest: +ELLIPSIS array([2, 2, 1]...) >>> list(le.inverse_transform([2, 2, 1])) ['tokyo', 'tokyo', 'paris']
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|||
Inherited from Cumulator | |||
---|---|---|---|
|
|||
|
|||
Inherited from Node | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
|
|||
|
|
|||
Inherited from |
|||
Inherited from Node | |||
---|---|---|---|
_train_seq List of tuples: |
|||
dtype dtype |
|||
input_dim Input dimensions |
|||
output_dim Output dimensions |
|||
supported_dtypes Supported dtypes |
|
If the input dimension and the output dimension are unspecified, they will be set when the train or execute method is called for the first time. If dtype is unspecified, it will be inherited from the data it receives at the first call of train or execute. Every subclass must take care of up- or down-casting the internal structures to match this argument (use _refcast private method when possible).
|
|
|
|
Transform labels to normalized encoding. This node has been automatically generated by wrapping the sklearn.preprocessing.label.LabelEncoder class from the sklearn library. The wrapped instance can be accessed through the scikits_alg attribute. Parameters
Returns y : array-like of shape [n_samples]
|
|
|
Fit label encoder This node has been automatically generated by wrapping the sklearn.preprocessing.label.LabelEncoder class from the sklearn library. The wrapped instance can be accessed through the scikits_alg attribute. Parameters
Returns self : returns an instance of self.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Mar 8 12:39:48 2016 | http://epydoc.sourceforge.net |