decision-tree Questions

4

I'm using Catboost and would like to visualize shap_values: from catboost import CatBoostClassifier model = CatBoostClassifier(iterations=300) model.fit(X, y,cat_features=cat_features) pool1 = Po...
Unbeatable asked 27/6, 2019 at 12:31

2

Solved

I apply the decision tree classifier and the random forest classifier to my data with the following code: def decision_tree(train_X, train_Y, test_X, test_Y): clf = tree.DecisionTreeClassifier()...

2

Understand the difference between CART and DecisionTreeClassifier of Sklearn. In Sklearn's documentation, it says that "scikit-learn uses an optimised version of the CART algorithm". However, I co...
Shanley asked 7/10, 2019 at 17:48

2

Solved

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 gra...

4

I have to create decision trees with the R software and the rpart Package. In my paper I should first define the ID3 algorithm and then implement various decision trees. I found out that the rpart...
Gallon asked 20/11, 2013 at 9:57

5

I have an output from ctree() (party package) that looks like the following. How do I get the list of splitting conditions for each terminal node, like like sns <= 0, dta <= 1; sns <= 0, d...
Stevenson asked 29/1, 2014 at 21:38

6

Solved

I would like to inspect all the observations that reached some node in an rpart decision tree. For example, in the following code: fit <- rpart(Kyphosis ~ Age + Start, data = kyphosis) fit n= ...
Tetramethyldiarsine asked 20/4, 2016 at 15:28

4

Solved

I'm trying to reproduce this GitHub project on my machine, on Topological Data Analysis (TDA). My steps: get best parameters from a cross-validation output load my dataset feature selection extrac...
Sampling asked 15/1, 2021 at 20:17

3

Solved

I have managed to build a decision tree model using the tidymodels package but I am unsure how to pull the results and plot the tree. I know I can use the rpart and rpart.plot packages to achieve t...
Subjoinder asked 21/8, 2020 at 17:44

6

Solved

Confused about random_state parameter, not sure why decision tree training needs some randomness. My thoughts is it related to random forest? is it related to split training testing data set? If s...

2

Solved

I've trained a gradient boost classifier, and I would like to visualize it using the graphviz_exporter tool shown here. When I try it I get: AttributeError: 'GradientBoostingClassifier' object has ...
Madeup asked 7/7, 2017 at 15:18

25

Solved

Can I extract the underlying decision-rules (or 'decision paths') from a trained tree in a decision tree as a textual list? Something like: if A>0.4 then if B<0.2 then if C>0.8 then class=...
Leisaleiser asked 26/11, 2013 at 17:58

1

Solved

We can visualize decision tree with training set distribution, for example from matplotlib import pyplot as plt from sklearn import datasets from sklearn.tree import DecisionTreeClassifier from sk...
Birgit asked 14/4, 2022 at 4:56

3

Solved

I have a data set where the classes are unbalanced. The classes are either 0, 1 or 2. How can I calculate the prediction error for each class and then re-balance weights accordingly in scikit-lea...
Lingo asked 30/5, 2016 at 9:29

8

Solved

There are several posts about how to encode categorical data to Sklearn Decision trees, but from Sklearn documentation, we got these Some advantages of decision trees are: (...) Able to handle bot...
Narcho asked 29/6, 2016 at 19:47

3

Solved

Good Afternoon, I am working on a decision tree classifier and am having trouble visualizing it. I can output the decision tree, however I cannot get my feature or class names/labels into it. My d...
Meliamelic asked 13/9, 2016 at 17:42

3

In sci-kit learn, it's possible to access the entire tree structure, that is, each node of the tree. This allows to explore the attributes used at each split of the tree and which values are used f...
Knipe asked 13/11, 2018 at 12:17

2

Solved

Why pickling a sklearn decision tree can generate a pickle thousands times bigger (in terms of memory) than the original estimator? I ran into this issue at work where a random forest estimator (wi...
Tupler asked 9/6, 2022 at 13:56

1

Solved

I have been trying to build a RandomForestClassifier() (RF) model and a DecisionTreeClassifier() (DT) model in order to get the same output (only for learning purposes). I have found some questions...
Physiologist asked 7/4, 2022 at 17:41

4

I'm pretty new to R and I'm stuck with a pretty dumb problem. I'm calibrating a regression tree using the rpart package in order to do some classification and some forecasting. Thanks to R the ca...
Roux asked 24/2, 2011 at 9:33

6

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...
Lester asked 13/7, 2010 at 13:54

2

Is there a way to do transfer learning with a decision tree or a random forest model? Concretely, I was wondering if there is a good and easy way of doing so in Python with a model trained with Sci...
Rhetor asked 11/5, 2021 at 7:53

3

Hi, I am taking a course on Coursera and came into this question. My answer is 1-(4048+3456)/8124=0.076. However, the answer is 0.067. Anybody can help me to solve this? Thank you!!
Georgena asked 24/1, 2018 at 3:7

2

Solved

I am training a decision tree with sklearn. When I use: dt_clf = tree.DecisionTreeClassifier() the max_depth parameter defaults to None. According to the documentation, if max_depth is None, the...
Bitt asked 3/2, 2019 at 1:23

2

I am using RandomForestClassifier implemented in python sklearn package to build a binary classification model. The below is the results of cross validations: Fold 1 : Train: 164 Test: 40 Train Ac...

© 2022 - 2025 — McMap. All rights reserved.