Questions tagged [decision-tree]

A decision tree is a decision support tool that uses a tree-like graph or model of decisions and their possible consequences, including chance event outcomes, resource costs, and utility. It is one way to display an algorithm.

Decision Tree could be just a graphical tool or the learning algorithm in a post.

2545 questions
0
votes
0 answers

Sort_values for know created DF

I am trying to sort values descendingly for:- FeatureImportances=pd.DataFrame(Tclf.feature_importances_,index=Name_features).sort_values(by='',axis = 0, ascending = False) whenever I try to assign a feature"column" Name to the attribute 'by', it…
Ahmed Adel
  • 49
  • 6
0
votes
1 answer

How to make a decision based on illumination and array input in Matlab?

I'm trying to complete a code that I started on. I have an .bmp image that I transferred into a thermal image. I also changed the orientation of the output into a r and theta from the central point of the picture. What I am trying to do is take in…
0
votes
0 answers

Recursion in context with decision trees

So I am struggling with understanding recursion in the context of decision trees. I have looked at two different codes from two different websites: Example 1 and Example 2. This is a part of the code from the first example: class…
Mathomat55
  • 109
  • 5
0
votes
1 answer

Matlab's TreeBagger and k-fold cross validation

I am trying to get the 5-fold cross validation error of a model created with TreeBagger using the function crossval but I keep getting an error Error using crossval>evalFun The function 'regrTree' generated the following error: Too many input…
xoani
  • 107
  • 1
  • 1
  • 13
0
votes
1 answer

Plot validation and training accuracy/scores for each iteration of a GradientBoostingRegressor model?

I am using the sklearn library for gradient boosted regression. What I would like to do, is plot the validation and training accuracy (or MSE) through each estimator iteration. I see methods for obtaining the training scores,…
0
votes
1 answer

Regression tree output

I'm confused about the intuition behind decision trees when used to describe continuous targets in machine learning. I understand that decision trees uses splits based on feature values to decide which branches of a tree to go down to get to a leaf…
leontp587
  • 791
  • 2
  • 9
  • 21
0
votes
2 answers

Boosting vs. Ensemble models

Can someone compare and contrast these two concepts in layman terms for me? The definitions sound similar but I know there has to be more differences between the two. I have: Ensemble models: Combines multiple ML models together to get a…
Katsu
  • 8,479
  • 3
  • 15
  • 16
0
votes
1 answer

Error doing Random Forest from data frame using pandas

I am performing a random forest on my data frame using pandas, but I can't seem to get it right, my data frame contains two columns with nonbinary values (letters), so I think that's why it's not letting me divide the data into values and…
0
votes
0 answers

Python decision tree and random forest results

I have a data set of 11800 lines and around 50 rows. I have performed both Decision tree regression and Random forest regression. Both have weights applied to them, to take care of right censored information issues. My code for the Decision tree (a…
Marie
  • 1
0
votes
2 answers

What is the best way to implement a text-based adventure game in fluter/dart with a decision tree model?

I am building a text-based adventure game as follows: I have 2 models Node and Message, in Node will contain: 1 list of messages 1 list of branching conditions 1 list of child nodes My idea is to use Listview to print to the screen and when the…
An Tran
  • 119
  • 9
0
votes
2 answers

Obtain the number of occurrences a decision tree path has been used when classifying data

I am trying to obtain the number of occurrences a decision tree path is used to classify an instance. For example, suppose I have the following rules (not sure if they make sense): Rule 1: [x<3 and y<5 => 'Low'] Rule 2: [x<3 and x>1 and y<5 =>…
0
votes
1 answer

How are decision trees in random forest algorithms made?

I was suddenly presented with the profound question of how does a computer generate a decision tree. For example, consider the problem of predicting a specific flower species using the random forest algorithm. There are two specific attributes of a…
0
votes
1 answer

Bug on rpart.plot predict when rules set to TRUE?

I was reading the rpart.plot document and was interested in using the rules parameter on rpart.predict. However, when following the example I get an error message. Am I missing something? Update: this is my sessionInfo():
user5029763
  • 1,903
  • 1
  • 15
  • 23
0
votes
0 answers

save all random forest decision trees in a same pdf file

I’ ve tried to save every decision tree of a Random Forest in just One pdf file, however, I only have got save the last decision tree… Anybody knows how I could save every tree? I would appreciate a Python code that could help me. Thank you very…
0
votes
2 answers

sklearn DecisionTreeClassifier loop for max_depth

I am currently running a basic scikit-learn decision tree using the below code: tree = tree.DecisionTreeClassifier(max_depth=10) tree = tree.fit(X_train, y_train) Is there a way to test multiple values of max_depth (e.g. between 10 and 15) without…