Untitled
unknown
plain_text
2 years ago
1.5 kB
2
Indexable
--------------------------------------------------------------------------- NotFittedError Traceback (most recent call last) Input In [199], in <cell line: 57>() 54 label_encoder = LabelEncoder() 56 # Fit the label encoder to the encoded column and transform it back to the original form ---> 57 decoded_column = label_encoder.inverse_transform(df['unique_top_5_person_who_resolved']) 59 # Display the updated dataframe 60 print(df.head()) File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/sklearn/preprocessing/_label.py:288, in LabelEncoder.inverse_transform(self, y) 276 def inverse_transform(self, y): 277 """Transform labels back to original encoding. 278 279 Parameters (...) 286 y : numpy array of shape [n_samples] 287 """ --> 288 check_is_fitted(self) 289 y = column_or_1d(y, warn=True) 290 # inverse transform of empty array is empty array File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/sklearn/utils/validation.py:967, in check_is_fitted(estimator, attributes, msg, all_or_any) 963 attrs = [v for v in vars(estimator) 964 if v.endswith("_") and not v.startswith("__")] 966 if not attrs: --> 967 raise NotFittedError(msg % {'name': type(estimator).__name__}) NotFittedError: This LabelEncoder instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.
Editor is loading...