From 960ad78fb10861164aaa0c0923a3fc820a463ae1 Mon Sep 17 00:00:00 2001 From: Lucy Liu Date: Fri, 21 Jul 2023 15:26:31 +1000 Subject: [PATCH] directly import class in example --- sklearn/preprocessing/_label.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sklearn/preprocessing/_label.py b/sklearn/preprocessing/_label.py index d621c6c410153..f5044f9c9d417 100644 --- a/sklearn/preprocessing/_label.py +++ b/sklearn/preprocessing/_label.py @@ -56,8 +56,8 @@ class LabelEncoder(TransformerMixin, BaseEstimator): -------- `LabelEncoder` can be used to normalize labels. - >>> from sklearn import preprocessing - >>> le = preprocessing.LabelEncoder() + >>> from sklearn.preprocessing import LabelEncoder + >>> le = LabelEncoder() >>> le.fit([1, 2, 2, 6]) LabelEncoder() >>> le.classes_ @@ -70,7 +70,7 @@ class LabelEncoder(TransformerMixin, BaseEstimator): 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 = LabelEncoder() >>> le.fit(["paris", "paris", "tokyo", "amsterdam"]) LabelEncoder() >>> list(le.classes_) @@ -221,8 +221,8 @@ class LabelBinarizer(TransformerMixin, BaseEstimator): Examples -------- - >>> from sklearn import preprocessing - >>> lb = preprocessing.LabelBinarizer() + >>> from sklearn.preprocessing import LabelBinarizer + >>> lb = LabelBinarizer() >>> lb.fit([1, 2, 6, 4, 2]) LabelBinarizer() >>> lb.classes_ @@ -233,7 +233,7 @@ class LabelBinarizer(TransformerMixin, BaseEstimator): Binary targets transform to a column vector - >>> lb = preprocessing.LabelBinarizer() + >>> lb = LabelBinarizer() >>> lb.fit_transform(['yes', 'no', 'no', 'yes']) array([[1], [0],