D
D
dr_olzhas2021-02-15 14:45:33
Python
dr_olzhas, 2021-02-15 14:45:33

Decision tree. How to decode values ​​in a tree?

After constructing the Decision tree classifier, how to decode the values ​​back?

602a5e466ce40765306254.png

Example input string
602a5e7064832545590321.png

Sample string after processing LabelEncoder
602a5e89af007162618011.png

LabelEncoder:

encoder = defaultdict(LabelEncoder)

data.loc[:, categorical_features] = (
    data
    .loc[:, categorical_features]
    .apply(lambda x: encoder[x.name].fit_transform(x), axis=0)
)


Code link - https://colab.research.google.com/drive/1IYQ2sMAg7...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question