random-forest Questions

2

I am trying to implement bag of word model from kaggle site with a twitter sentiments data which has around 1M raw. I already clean it but in last part when I applied my features vectors and sentim...
Lustring asked 26/4, 2017 at 17:9

3

I have 7 classes and the total number of records are 115 and I wanted to run Random Forest model over this data. But as the data is not enough to get a high accuracy. So i wanted to apply oversampl...
Paulettepauley asked 26/12, 2018 at 20:31

4

I understand that random_state is used in various sklearn algorithms to break tie between different predictors (trees) with same metric value (say for example in GradientBoosting). But the document...
Zwiebel asked 29/9, 2014 at 10:38

5

Solved

Is there a way to retrieve the list of feature names used for training of a classifier, once it has been trained with the fit method? I would like to get this information before applying to unseen ...
Doolittle asked 8/11, 2016 at 11:6

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()...

7

I want to plot a decision tree of a random forest. So, i create the following code: clf = RandomForestClassifier(n_estimators=100) import pydotplus import six from sklearn import tree dotfile = six...
Blanche asked 20/10, 2016 at 12:56

9

Solved

Given is a simple CSV file: A,B,C Hello,Hi,0 Hola,Bueno,1 Obviously the real dataset is far more complex than this, but this one reproduces the error. I'm attempting to build a random forest cla...
Bluh asked 21/5, 2015 at 21:51

2

Solved

I am trying to build a model in R with random forest classification. (By editing the code by Ned Horning) I first used randomForest package but then found ranger, which promises faster calculations...
Comprise asked 12/4, 2019 at 15:8

3

The label in my data is a (N by 1) vector. The label values are either 0 for negative samples or 1 for positive samples (so, it's a binary classification problem). I use the .fit function of sklear...
Durkee asked 26/6, 2019 at 21:50

4

Solved

I am using scikit-learn's Random Forest Regressor to fit a random forest regressor on a dataset. Is it possible to interpret the output in a format where I can then implement the model fit without ...

7

Is it possible to train a model by xgboost that has multiple continuous outputs (multi-regression)? What would be the objective of training such a model? Thanks in advance for any suggestions
Cushman asked 16/9, 2016 at 21:10

2

Solved

I am trying to plot SHAP This is my code rnd_clf is a RandomForestClassifier: import shap explainer = shap.TreeExplainer(rnd_clf) shap_values = explainer.shap_values(X) shap.summary_plot(shap_va...
Shallop asked 3/1, 2021 at 12:0

5

Solved

There is absolutely helpful class GridSearchCV in scikit-learn to do grid search and cross validation, but I don't want to do cross validataion. I want to do grid search without cross validation an...
Quant asked 6/1, 2016 at 3:9

1

Solved

I'm learning machine learning in R and making a decision tree in R of expired products, where i have the following data: Product, Category, Temperature, Expire_Day, Rotation_Day, Weight, State Tapa...
Simpleminded asked 12/4, 2023 at 23:53

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

2

I want to improve the parameters of this GridSearchCV for a Random Forest Regressor. def Grid_Search_CV_RFR(X_train, y_train): from sklearn.model_selection import GridSearchCV from sklearn.model...
Paramount asked 24/4, 2017 at 14:14

6

Solved

Say I have a categorical feature, color, which takes the values ['red', 'blue', 'green', 'orange'], and I want to use it to predict something in a random forest. If I one-hot encode it (i.e. I ch...
Ruching asked 12/7, 2014 at 16:54

2

Solved

I have an imbalanced dataset containing a binary classification problem. I have built Random Forest Classifier and used k-fold cross-validation with 10 folds. kfold = model_selection.KFold(n_splits...

1

If we serialize randomforest model using joblib on a 64-bit machine, and then unpack on a 32-bit machine, there is an exception: ValueError: Buffer dtype mismatch, expected 'SIZE_t' but got 'long ...
Amador asked 30/8, 2016 at 23:14

1

I am attempting to use Random Forest. The training data has 7000 observations with 12 variables. These variables include both categorical and continuous variables. When I submit the code I receive ...
Onaonager asked 9/7, 2019 at 0:30

3

Solved

I'm relatively new to Python and am trying to get some data prepped to train a RandomForest. For various reasons, we want the data to be discrete, so there are a few continuous variables that need ...
Dermott asked 26/8, 2019 at 7:54

3

Solved

I have a few questions concerning Randomized grid search in a Random Forest Regression Model. My parameter grid looks like this: random_grid = {'bootstrap': [True, False], 'max_depth': [10, 20, 3...
Confiding asked 14/12, 2018 at 15:2

2

Solved

I'm trying to use GridSearchCV for RandomForestRegressor, but always get ValueError: Found array with dim 100. Expected 500. Consider this toy example: import numpy as np from sklearn import ense...
Gustation asked 11/1, 2015 at 18:14

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

1

Solved

For the code given below, I am getting different bar plots for the shap values. In this example, I have a dataset of 1000 train samples with 9 classes and 500 test samples. I then use the random fo...
Adit asked 12/8, 2022 at 4:17

© 2022 - 2025 — McMap. All rights reserved.