Questions tagged [decisiontreeclassifier]

12 questions
1
vote
0 answers

How do I handle this case (value to classify dosn't exist under node) using decision tree?

I implemented decision tree and let's say for example the following tree is what i got : and my instance to classify is educationField = '2' and departement = 'HR' How can i handle this ? i thought of taking the max class where educationField =…
1
vote
0 answers

Why does printing the DecisionTreeClassifier not display more detail

I am working from this tutorial: https://dataaspirant.com/visualize-decision-tree-python-graphviz/ The code: import pandas as pd import numpy as np from sklearn import tree fruit_data_set = pd.DataFrame() # 1 is an apple, 0 is an…
nicomp
  • 4,344
  • 4
  • 27
  • 60
1
vote
1 answer

Warning : X has feature names, but DecisionTreeClassifier was fitted without feature names

I am training csv file with sklearn using DecesionTreeClassifier, RandomForestClassifier and SVC. when i run it all of them give me the warning says "X has feature names, but Classifier was fitted without feature names" 4 times each. I get the data…
0
votes
0 answers

Decision Tree Classifier Error in anaconda

Trying this code for a decision tree for school project and getting this error: #Building Decision Tree Classifier DT_model = DecisionTreeClassifier() param_dist = {"max_depth": [3, None], "max_features": randint(1, 9), …
0
votes
0 answers

to shown output 10 fold confusion matrix

helo. i have this kind of problem where i couldn't get the output for each fold's confusion matrix, how do i do with the code? I expect to get all fold confusion matrix result, I've tried the code that i put, but the result is different when i try…
0
votes
1 answer

Decision Tree Classifier // Accuracy Score

I printed the "Best accuracy" print("Best accuracy:", best_accuracy) for my model within the console, and it shows me Best accuracy: 0.88, whereas the accuracy for my specific model is Accuracy: 0.83 Is there any chance to change anything on code or…
0
votes
1 answer

Decision tree classifier sees float values as numeric data, however in need to be a one hot encoded data type

I'am running a decision tree classifier on the data within the picture. In the picture you can see that there are type's of data like time signature and signature key that need to be one hot encoded with 1's and 0's. However, within the dataframe…
0
votes
0 answers

Change shape of a decision tree with tree.export_graphviz

I want to change my decision tree boxes to circle or diamond with tree.export_graphviz but I can't. Is there any solotion for this? Actully there is no solotion for this problem based on sklearn site. sklearn.tree.export_graphviz…
0
votes
0 answers

n_splits=10 cannot be greater than the number of members in each class error

I'm trying to build validation curve that relying on max_depth but keep getting an error: n_splits=10 cannot be greater than the number of members in each class. I tried to put n_splits with different values, error doesnt change. I got data from…
-1
votes
1 answer

How to do training and testing for decision tree classifier

im try to do training and testing for my decision tree classifier. im still new in decision tree. i have 150 data with two columns in my csv file and im tried to split it into 100 training and 50 for testing. i've tried using scikit but i still…
-2
votes
1 answer

What is the concept behind the hyperparameter "splitter" in DecisionTreeClassifier by sklearn?

enter image description here screenshot I think that "splitter=random" means to find random threshold w.r.t each selected feature and then select the best threshold out of all random thresholds. And "splitter=best" means to find best threshold…
-2
votes
2 answers

How does sklearn.tree.DecisionTreeClassifier function predict_proba() work internally?

I know how to use predict_proba() and the meaning of the output. Can anyone tell me how predict_proba() internally calculates the probability for decision tree?
ybdesire
  • 1,593
  • 1
  • 20
  • 35