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
0 votes
1 answer
104 views

I have made a basic HDBSCAN model (picture output below) but I need to figure out names for the individual clusters. Is there a way I can get something like a decision tree or the parameters for each ...
Garrett's user avatar
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
1 answer
96 views

I'm trying to use HalvingGridSearch to find the best DecisionTree model. My model performs a multi-label prediction on a single example, it is trained on a batch of data of size (n_samples x ...
Gabriele Benanti's user avatar
0 votes
0 answers
71 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
3 votes
1 answer
94 views

A new code-generating tool is given only one input - n, the size of an input array. The tool should then generate a simple decision tree program that contains 2 kinds of nodes: decision node with ...
sanitizedUser's user avatar
0 votes
0 answers
48 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
0 votes
2 answers
84 views

According to the sklearn docs, if you apply predict_proba to DecisionTreeClassifier: The predicted class probability is the fraction of samples of the same class in a leaf. Let's say that the rows ...
SRJCoding's user avatar
  • 521
1 vote
1 answer
54 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
148 views

I'm trying to use the dtreeviz library to visualize a decision tree, but I’m encountering an error: TypeError: 'int' object is not subscriptable Here’s the code I’m trying to run: viz = dtreeviz(...
Rodrigo Higashi De Figueiredo'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
1 vote
0 answers
38 views

I'm currently working on a decision tree for an enemy character. I'm not sure how to use the actions for the decision tree. Does the actions either: 1. void AttackAction::ExecuteAction(EnemyBase& ...
user9206234's user avatar
0 votes
1 answer
49 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
1 answer
48 views

I am using the REEMtree package in R to build a tree with random effects, but when I attempt to make predictions on the test data, I encounter the following error: Error in predict.REEMtree(...
Linus's user avatar
  • 343
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
0 answers
31 views

Currently, I'm working on a project where we desire the labels under the tree diagram to show the accuracy rate (I figured out how to calculate this using values given in the tree data frame). I've ...
Carz's user avatar
  • 21
2 votes
1 answer
147 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
23 views

When plotting scikit-learn trees (on iris data as an example), as in the below code: from sklearn.datasets import load_iris from sklearn import tree iris = load_iris() X, y = iris.data, iris.target ...
Antonio Piemontese's user avatar
1 vote
1 answer
56 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
0 votes
0 answers
122 views

I am creating a decision tree from scratch and implementing pruning. Currently I believe the problem in my code is that when I prune a tree, the new leaf node I create does not get placed into the ...
isuf's user avatar
  • 51
-3 votes
2 answers
77 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
0 answers
29 views

I'm pretty new to machine learning. I was using fetch_olivetti_faces as my database for practice in my coding class. I ran the code, and it worked since I was following the teacher's instructions. ...
Jonathan Chan's user avatar
0 votes
1 answer
83 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
1 vote
1 answer
106 views

I am migrating from R to PySpark. I have a process that creates a regression tree that is currently built using R's rpart algorithm. While configuring this in PySpark, I am unable to see an option to ...
willing_astronomer'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
-1 votes
1 answer
61 views

I have a Pandas dataframe built like this: Fruit Color Eaten? Date Eaten Apple Red Yes 14-Mar-2024 Apple Green No 14-Mar-2024 Apple Yellow Yes Banana Red Banana Yellow Yes 14-Mar-2024 I'm trying to ...
Him's user avatar
  • 1
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
0 votes
1 answer
81 views

I'm trying to create a decision tree to predict whether a given loan applicant would default or repay their debt. I'm using the following dataset library(readr) library(dplyr) library(rpart) library(...
OzkanGelincik's user avatar
1 vote
0 answers
245 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
478 views

Currently I am solving a problem on where I have to create a flexible multi-dimensional decision tree from a JSON structure in Python. There are composed decision rules in the JSON and each decision ...
kiruthikpurpose'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
2 votes
2 answers
360 views

I have a HistGradientBoostingClassifier model and I want to plot one or more of its decision trees, nevertheless I can't manage to find a native function to do it, I can access the Tree predictor ...
Alejandro Gonzalez 's user avatar
1 vote
2 answers
163 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
0 votes
0 answers
37 views

I was training a model using DecisionTreeClassifier and just like the LinearRegression / LogisticRegression algorithms testing and training datasets I use the 2D array for X values and 1D array for y ...
Ayandip Pal'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
1 answer
377 views

I am reading deep face library paper,"LightFace: A Hybrid Deep Face Recognition Framework". Q1. Is there code to explain how to determine the distance threshold? The decision tree(C4.5) ...
Luckydipper'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 vote
1 answer
58 views

I have written a decision tree class in Python which uses the Node class as tree nodes, as shown below: class Node: ''' Helper class which implements a single tree node. ''' def ...
Narges Ghanbari's user avatar
-1 votes
1 answer
54 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
183 views

I'm currently having trouble switching the following code to fit a multiclass variable (3 levels). # data import from ucimlrepo import fetch_ucirepo import numpy as np import pandas as pd import ...
Daniel Shiverman's user avatar
0 votes
1 answer
111 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
1 vote
0 answers
79 views

I am trying to make a decision tree using rpart function in r. I have the y variable "outcome" and 4 variables as x. All of them are factors. Every tree I tried to make returns only the ...
Konstantina S. '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
0 votes
1 answer
185 views

I have the following data for training a model to detect whether a sentence is about: a cat or dog NOT about a cat or dog I ran the following code to train a DecisionTreeClassifier() model then view ...
code_to_joy's user avatar
-4 votes
1 answer
57 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
0 answers
163 views

I am training a BDT for binary classification of signal/background (I work in particle physics). My model (implemented in python) looks like: import xgboost as xgb train = xgb.DMatrix(data=train_df[...
Rodrigo's user avatar
  • 21
0 votes
1 answer
116 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
152 views

I am trying to use Weka and the J48 classifier, specifically for the C4.5 algorithm. Specifically, I am looking to limit the depth of the decision tree produced (1 layer, 2 layers, etc.) but I do not ...
Nick B.'s user avatar
  • 63
0 votes
1 answer
141 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
0 votes
1 answer
156 views

i upload a csv file in weka tool. After preprocessing, i want to apply J48 classifier but J48 is not highlighted there. i want to apply decision tree classifier but it is not highlighted
Adnan Abass's user avatar

1
2 3 4 5
51