How to identify feature names from indices in a decision tree using scikit-learn’s CountVectorizer?
I have the following data for training a model to detect whether a sentence is about:
a cat or dog
NOT about a cat or dog
https://i.stack.imgur.com/gNnh6.png▾
I ran the following code to train a DecisionTreeClassifier() model then view the tree visualisation:
import numpy as np
from numpy.random import seed
import random as rn
import os
import pandas as pd
seed_num = 1
os.environ['PYTHONHASHSEED'] = '0'
np.random.seed(seed_num)
rn.seed(seed_num)
from...