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
6
votes
1 answer

Extract and Visualize Model Trees from Sparklyr

Does anyone have any advice about how to convert the tree information from sparklyr's ml_decision_tree_classifier, ml_gbt_classifier, or ml_random_forest_classifier models into a.) a format that can be understood by other R tree-related libraries…
RealViaCauchy
  • 237
  • 1
  • 10
6
votes
0 answers

Visualizing decision tree not using graphviz/web

Due to some restriction I cannot use graphviz , webgraphviz.com to visualize decision tree (work network is closed from the other world). Question: Is there some alternative utilite or some Python code for at least very simple visualization may be…
Alexander Chervov
  • 616
  • 3
  • 7
  • 23
6
votes
1 answer

Sklearn Decision Rules for Specific Class in Decision tree

I am creating a decision tree.My data is of the following type X1 |X2 |X3|.....X50|Y _____________________________________ 1 |5 |7 |.....0 |1 1.5|34 |81|.....0 |1 4 |21 |21|.... 1 |0 65 |34 |23|.....1 |1 I am trying following code to…
6
votes
1 answer

MemoryError when fitting scikit-learn Decision Tree and Random Forest Classifiers

I have a pandas DataFrame with 86k rows, 5 features and 1 target column. I'm trying to train a DecisionTreeClassifier using 70% of the DataFrame as train data, and I get a MemoryError from the fit method. I've tried changing some of the parameters…
julia
  • 153
  • 1
  • 10
6
votes
1 answer

how extraction decision rules of random forest in python

I have one question though. I heard from someone that in R, you can use extra packages to extract the decision rules implemented in RF, I try to google the same thing in python but without luck, if there is any help on how to achieve that. thanks…
6
votes
1 answer

Why is my decision tree creating a split that doesn't actually divide the samples?

Here's my basic code for two-feature classification of the well-known Iris dataset: from sklearn.datasets import load_iris from sklearn.tree import DecisionTreeClassifier, export_graphviz from graphviz import Source iris = load_iris() iris_limited…
naiveai
  • 590
  • 2
  • 14
  • 42
6
votes
1 answer

What does scikit-learn DecisionTreeClassifier.tree_.value do?

I am working on a DecisionTreeClassifier model and I want to understand the path chosen by the model. So I need to know what values give the DecisionTreeClassifier.tree_.value
Oussama Jabri
  • 674
  • 1
  • 7
  • 18
6
votes
1 answer

What is the meaning of the value property in a generated scikit learn decision tree?

I am following the excellent talk on Pandas and Scikit learn given by Skipper Seabold. I am utilizing his cleaned data set that originates from UCI adult names. Upon running this code and generating the tree image via graphviz, we can observe there…
Igor L.
  • 3,159
  • 7
  • 40
  • 61
6
votes
3 answers

GraphViz's executables not found : Anaconda-3

I am trying to display the tree output , but when I run the script below, I receive an error like : InvocationException: GraphViz's executables not found I've searched similar topics here, but most of them are Mac related. I'm using Windows 10…
Cagdas Kanar
  • 713
  • 4
  • 13
  • 23
6
votes
1 answer

Missing values error in train() function Caret for trees

I'm new using R and I'm trying to build a decision tree. I've already used the package party for ctree and rpart for rpart. But, as I needed to do cross validation for my model I start using the caret package since I'm able to do that by using the…
6
votes
1 answer

Want to build a decision tree when i have 4 categories in my dependent variable

I want to build a decision tree but I have 4 categories(1,2,3,4) in my dependent variable. How can I build? I am familiar with rpart package which can be used for binary dependent variable. I think if we have more categories then we need to build…
Sanchit Aluna
  • 455
  • 2
  • 6
  • 20
6
votes
1 answer

Random Forests and ROC Curves in Julia

I'm using the ScikitLearn flavour of the DecisionTree.jl package to create a random forest model for a binary classification problem of one of the RDatasets data sets (see bottom of the DecisionTree.jl home page for what I mean by ScikitLearn…
lara
  • 835
  • 1
  • 8
  • 20
6
votes
1 answer

Does presorting slow down training of large decision trees?

In Scikit-Learn's documentation for the DecisionTreeClassifier class, the presort hyperparameter is described like this: presort : bool, optional (default=False) Whether to presort the data to speed up the finding of best splits in fitting. For…
MiniQuark
  • 46,633
  • 36
  • 147
  • 183
6
votes
2 answers

how to obtain the trained best model from a crossvalidator

I built a pipeline including a DecisionTreeClassifier(dt) like this val pipeline = new Pipeline().setStages(Array(labelIndexer, featureIndexer, dt, labelConverter)) Then I used this pipeline as the estimator in a CrossValidator in order to get a…
6
votes
6 answers

Interactive Decision Tree Classifier

Can anyone recommend a decision tree classifier implementation, in either Python or Java, that can be used incrementally? All the implementations I've found require you to provide all the features to the classifier at once in order to get a…
Cerin
  • 60,957
  • 96
  • 316
  • 522