Skip to main content
Filter by
Sorted by
Tagged with
6 votes
2 answers
103 views

I am trying to replicate a specific decision tree trained by a RandomForestRegressor class, using DecisionTreeRegressor. However, I cannot get the exact results, even with using the exact same ...
NOnaMe's user avatar
  • 99
1 vote
0 answers
88 views

When trying to fit scikit-learn DecisionTreeClassifier on my data, I am observing some weird behavior. x[54] (a boolan feature) is used to break the 19 samples into 2 and 17 on top left node. Then ...
Krishna's user avatar
  • 1,632
0 votes
0 answers
67 views

Following the example for h2o rulefit model from the documentation (https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/rulefit.html), I checked the variable importance of the rules or linear ...
Drunkpiano's user avatar
0 votes
0 answers
47 views

I'm trying to define a custom splitter using sklearn Classification Trees classes, but I'm getting no results so far. I got no errors but the tree is not developed. How to achieve this? My strategy is ...
Jojo's user avatar
  • 356
1 vote
1 answer
49 views

I have come around a strange thing when plotting a decision tree in sklearn. I just wanted to compare a Random Forest model consisting of one estimator using bootstrapping and one without ...
EleniSop's user avatar
0 votes
0 answers
38 views

I want to simplify the decision tree output and hide the values ​​in the "value" field.Below is the code I am using enter image description here fig, ax = plt.subplots(figsize=(10, 10)) ...
user29687883's user avatar
0 votes
1 answer
42 views

I use the following code to plot a decisions trees: plt.figure(figsize=(12, 12)) plot_tree(estimator, feature_names=feature_names, label= 'all', ...
Addon's user avatar
  • 95
0 votes
0 answers
55 views

I have a tree structure that I'm using to represent a set of decisions and the resulting payout: Here there are two choices to be made: 0 can be either a, b or c, and 1 can be either d or e. The ...
danvk's user avatar
  • 17.2k
2 votes
1 answer
138 views

I am learning how to build a single decision tree and random forests in R. I understand that set.seed() is needed before building a random forest to ensure reproducibility of the results, e.g. if ...
Jabjab4's user avatar
  • 21
1 vote
1 answer
52 views

from sklearn.tree import DecisionTreeRegressor, export_text cols_X = ['f1', 'f2'] df_train = pd.DataFrame([[1, 3, 4], [2, 5, 1], [7, 8, 7]], columns=['f1', 'f2', 'label']) df_test = pd.DataFrame([[2, ...
user6703592's user avatar
  • 1,136
-3 votes
2 answers
71 views

I am using the auto-mpg dataset . I am giving the link of the dataset below: https://www.kaggle.com/datasets/uciml/autompg-dataset I am giving the code below: df = pd.read_csv('data/auto-mpg.csv') df....
Sahil Mantoo's user avatar
0 votes
1 answer
82 views

I built a decision tree with surrogate splits using rpart. Now, after inspection of the tree by a subject matter expert, the tree needs some small manual adjustment (addition of an extra branch). ...
cliffhanger-be's user avatar
0 votes
0 answers
74 views

I am trying to replicate a decision tree from SPSS in python using DecisionTreeClassifier. I am unable to do the following. Unable to use a feature to do the first force split. If I use the same ...
FNU Chirag's user avatar
0 votes
1 answer
73 views

I want to create predict and predict_proba methods in my DecisionTreeClassifier implementation, but it gives the error Traceback (most recent call last): File "c:\Users\Nijat\project.py", ...
Kibar Jafarguliyev's user avatar
1 vote
0 answers
243 views

I want to apply rules that I've created from modelling on data using a decision tree to unseen data. I've parsed the rules to get a CASE WHEN statement like so: CASE WHEN variable_1 = "Value1&...
bullet_proof's user avatar
-1 votes
1 answer
95 views

I have a very simple dataset of employee age and years of experience as features and income as label. The ask is to predict the income level using various regressors and I am using 4: Decision Trees (...
TotalGadha's user avatar
1 vote
2 answers
161 views

I am designing a binary classifier random forest model using python and scikitlearn, in which I would like to retrieve the probability of my test set being one of the two labels. To my understanding, ...
cheese_guy's user avatar
1 vote
1 answer
1k views

I'm implementing an decision tree classifier using sklearn and testing out different criteria, but I can't seem to find what the difference is between the 'entropy' and 'log_loss' criteria. The ...
jordanpastry's user avatar
0 votes
0 answers
47 views

Im trying to predict new data with a ctree object. I get this warning message when I run the function: b1b2_party <- ctree(factor(final_category_bin) ~ ., data = train, control = ctree_control(...
weendeen's user avatar
-1 votes
1 answer
50 views

I'm trying to build a second dataframe in Jupyter Notebook to train a stronger model. This is the line of code: dtc2 = DecisionTreeClassifier(criterion = 'entropy', ccp_alpha=0.04) I'm getting a type ...
sonofjupyter's user avatar
0 votes
1 answer
104 views

In my experiment, I used Decision Trees to predict whether participants will pass or fail, and I will provide feedback to them based on the reason for their failure. The Decision Tree includes three ...
Leila Moradi Avargani's user avatar
0 votes
1 answer
136 views

Is possible to build a decision forest with TensorFlow from many individual decision trees? Also, remove and add individual trees that are in the decision forest based on some performance criteria? ...
Marcio 's user avatar
-4 votes
1 answer
53 views

import pandas as pd from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score, f1_score whitewine_data = pd....
Henry's user avatar
  • 13
0 votes
1 answer
113 views

I am trying to use the random forest model to predict social media ads effects based on age and estimated salary, this is my code but i keep getting Attribute error prompting up. from sklearn.tree ...
Ebube Imoh's user avatar
0 votes
1 answer
140 views

When I try to import a DecisionTreeClassifier from sklearn.tree I receive the following attribute error: AttributeError: module 'numpy' has no attribute 'float' My code is: import sklearn print(...
Chris Kucewicz's user avatar

1
2 3 4 5
51