Questions tagged [random-forest]

In learning algorithms and statistical classification, a random forest is an ensemble classifier that consists in many decision trees. It outputs the class that is the mode of the classes output by individual trees, in other words, the class with the highest frequency.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

Biomod2 r package: selecting different cross validation and PA datasets for each type of modeling algorithm

I am trying to create a species distribution model using Random Forest and Maxent algoritms in biomod2. Based on Barbet-Massin et al 2012, I want to use a balanced number of pseudo-absence (PA) points ...
Gladfish's user avatar
0 votes
0 answers
12 views

Predict standard errors with caret::rfe() using ranger method?

I would like to get predictions and associated standard errors using the ranger method, but from caret::rfe() function. For example, if I were to do this without using rfe, I could get predictions and ...
Kevin's user avatar
  • 229
-1 votes
0 answers
39 views

How to solve "['Column_names'] not found in axis"

I'm a noobie to programming and working on one of my very first assignment about applying random forest ML model after sorting and cleaning data. I obtained the dataset from keggle and try to use my ...
yuan hsin liao's user avatar
0 votes
0 answers
20 views

How to compute two-way partial dependence (ie, how to marginalize a model over multiple variables)?

I'd like to understand the computation of a 2-way partial dependence. In this case I'm working with a random forest. Toy model: library(ggplot2) # access the mpg data set mod <- ranger::ranger(...
cmcrowley's user avatar
-1 votes
0 answers
13 views

error in unserialize(socklist[[n]]) : error reading from connection while executing RF model in caret [closed]

I am trying to run random forest code to classify satellite imageries using the caret package in R studio. While training the model I always get an error "error in unserialize(socklist[[n]]) : ...
Sanjo Jose's user avatar
0 votes
1 answer
46 views

How does sklearn calculate AUC for random forest and why it is different when using different functions?

I start with the example given for ROC Curve with Visualization API: import matplotlib.pyplot as plt from sklearn.datasets import load_wine from sklearn.ensemble import RandomForestClassifier from ...
Roger V.'s user avatar
  • 399
0 votes
0 answers
31 views

randomforest variable importance: results of mlr3 is different from randomForest packages

i want to know why the results are different? Thanks for the help! mlr3 library(mlr3) library(mlr3verse) library(mlr3learners) library(randomForest) library(tidyverse) library(tidymodels) tasks = ...
hzl's user avatar
  • 1
0 votes
0 answers
14 views

How to make a prediction with Random Forest in R [duplicate]

I have got the following model modelo_rf13 <- randomForest(df_depurado13$CuT_Calc ~ df_depurado13$XRF_Geomet) My dataset is as following enter image description here As you see, it has 4 columns: ...
César Carvallo's user avatar
0 votes
0 answers
37 views

Shap error: Additivity check failed in TreeExplainer

Im trying to use shap as explainable AI and plot the summary but it keeps giving error : ExplainerError: Additivity check failed in TreeExplainer! Please ensure the data matrix you passed to the ...
VeeA's user avatar
  • 1
0 votes
1 answer
15 views

Recursive Feature Elimination with H2O Random Forest

I am using h2o package in python to build a fairly complex model. It has around 1500 features, but I know that most of them are not really important and I would like to extract the subset of a given ...
Mirko's user avatar
  • 113
0 votes
0 answers
24 views

Interpreting Partial Dependence Plot for Continuous Variable in Random Forest Model

I am working with a Random Forest model to analyze survey data, aiming to identify significant variables that influence migration destination choices. Among my model's predictors, the number of family ...
Pres Pre's user avatar
0 votes
0 answers
12 views

This classifier didn't work with my samples

The GEE show me the message "No valid training data were found" Can someone show me which part of the code is wrong?? var gt_samples = ee.FeatureCollection(solo_exposto.merge(campo_pasto)....
Alexandre Messias Reis's user avatar
0 votes
0 answers
48 views

Why does Random Forest give different result when run in paralel?

I am running Random Forest in Databricks (the skitlearn library one). When I run the model : rf = RandomForestRegressor(n_estimators=150,max_features=3,min_samples_leaf=5,min_samples_split=12,n_jobs=7,...
Tiago's user avatar
  • 53
-1 votes
0 answers
7 views

how to apply continuous learning for Random forest regression using river or creme library

I have applied random forest regression for my problem statement and need continuous learning for my model to learn itself as I trained the model with the new data. which is the best way to apply. ...
Rajesh Koyi's user avatar
3 votes
1 answer
35 views

Why is ranger within tidymodels giving a different model to calling ranger directly?

I'm wondering why I am not getting identical models when I use ranger within tidymodels versus ranger directly? Here is a reproducible example: library(tidymodels) library(ranger) # load data data(&...
Anna Jackson's user avatar
0 votes
1 answer
27 views

Meaning of predValue field in H2O Random forest model

I built an H2ORandomForestEstimator model using train() method on my spark dataframe with the target column containing values 0 or 1. I downloaded and printed its mojo files using model.download_mojo(...
Vijay Kansal's user avatar
0 votes
0 answers
9 views

How to run a Bayesian meta-analysis with few studies

I want to run a Bayesian meta-analysis with 3 studies in R: events_treatment <- c(41, 1, 3) trials_treatment <- c(42, 2, 7) events_control <- c(126, 8, 2) trials_control <- c(166, 12, 7) ...
Alexandre Marra's user avatar
0 votes
0 answers
28 views

How do I get Survival Time from Survival Models e-g Random Survival Forests?

I want to know how to interpret the output of the RSF when you use .predict? Is it some kind of risk score or survival time? How do I get the values of survival time from the model? I used the cox ...
Beenish Bakhtawar's user avatar
-1 votes
0 answers
12 views

Supervised Algorithms gave Nulls

I have a general question. I had a prediction project a while ago in which I used 11 months of data (Jan to Nov) as a training set and December as testing data. I used a few methods like SVM, RF, KNN, ...
Ester Silva's user avatar
1 vote
0 answers
59 views

Tensorflow: Could not find matching concrete function to call loaded from the SavedModel

I'm trying to save and load a model across two files. in file 1: rf = tfdf.keras.RandomForestModel(task=tfdf.keras.Task.REGRESSION, verbose=1, num_trees=318, max_depth=20) rf.compile(metrics=["...
MM1's user avatar
  • 922
0 votes
0 answers
56 views

Train-test split with test dataset that contains no values in the target variable

I got a dataset like this in Python (just a small part of it, 20 features in total): State representatives employees Score Alabama 4 3 5 Rhode Island 7 4 2 Maryland 6 8 3 Texas 7 5 5 Florida 6 5 ...
Martha's Vineyard's user avatar
0 votes
1 answer
19 views

R Random Forest Model: Issue with Generating Confusion Matrix

When I can trying to generate a confusion matrix for my random forest model I am getting the following error: Error in !all.equal(nrow(data), ncol(data)) : invalid argument type Here is the code I ...
Doc.s's user avatar
  • 3
0 votes
1 answer
38 views

I wrote same name of date column in my files but it's still errors

I have looked this one up: KeyError: 'Date' How Can I fixed it? I think I wrote date column's name that represent Date same as my files but it's still error Here is my code: !pip install yfinance ...
wxrynz's user avatar
  • 1
0 votes
0 answers
47 views

choose ML model for transportation

0.Suppose, you have to work with an ML problem, where you have to predict the number of oxygen tanks needed to be shipped from Indonesia. Which of the following ML algorithm you will choose: a. ...
Sudipto Kumar's user avatar
0 votes
0 answers
22 views

How to revert back or transform one-hot encoded columns and display feature importance of original features and not in encoded form?

Using RandomForestClassifier, this is the current important feature list: bill_length 0.367075 flipper_length_mm 0.196314 bill_depth 0.153329 body_mass_g 0.152304 ...
S.H's user avatar
  • 137
1 vote
0 answers
49 views

Discrepancy in node values of a single tree in scikit-learn's random forest

I built a random forest model using the scikit-learn package and visualized the first tree. I cannot understand why some nodes' “value” do not equal the average. import numpy as np from sklearn import ...
Tongwen Li's user avatar
0 votes
1 answer
39 views

Class weights in Random Forest model - TFDF library

I want to add class weights to the Random Forest model from the Random Forest Decision Trees library to take into account the minority class. I have not found in the documentation how to do it or how ...
Marta Buetas's user avatar
0 votes
0 answers
54 views

Convert sklearn random forest model into raw python code

If I have a sklearn random forest model like the one below, how would I convert the tree to raw Python code? I.e. rather than call the predict() function for the classifier, I want the tree in raw ...
Graham's user avatar
  • 551
0 votes
1 answer
52 views

How to export the residuals of a random forest regression while using spatialsample?

I am trying to replicate this tutorial but instead of a linear regression I am using random forest (RF). I can make the prediction but now I would like to compute and extract the residuals of the ...
Nikos's user avatar
  • 426
0 votes
0 answers
26 views

Prediction Interval for Random Forest - large prediction dataset

I have an RF model created using randomForest in R with 500 trees. I want to apply it to predict values for a large dataset (2 million rows) and get both the predicted value and prediction interval. I ...
jon's user avatar
  • 3
1 vote
0 answers
31 views

'Object not found' error when trying to run randomForest

Im trying to run a random forest in the data below train_data<-structure(c(38, 184, 38, 7, 38, 380.95, 159, 989.99, 249, 449.99, 15.3642666666667, 27, 15.6, 14, 15.6, 4, 14.7785547785548, 32, 4, ...
firmo23's user avatar
  • 7,734
0 votes
0 answers
14 views

Incorporate seasonality from the day of the year into randomforest model using sine and cosine transformations

I'm currently trying to incorporate day of the year (DOY) into my randomforest model in R using sine and cosine transformations. The reason I'm not simply using DOY is because I'd like the model to ...
TimboJames's user avatar
0 votes
1 answer
35 views

Stuck in model building on Jupyter Notebook

I was trying to fit in a random forest tree model, but I keep on encoutering an error where my CV iterator is being told to be empty, which is not the case. below is the code snippet and the error %%...
Arbab Qaisar's user avatar
0 votes
0 answers
62 views

How to use sklearn random forest model with numpy only (without sklearn) for prediction?

I have a trained Random Forest Regression model using sklearn. However, I need to use the model (i.e. make predictions on new data) in an environment without sklearn. I can use numpy. Basically I need ...
Omar Al-Attraqchi's user avatar
2 votes
1 answer
114 views

SHAP feature importance plots for each class in R

I applied a SHAP model to my random forest multiclass classification model. Is there a way to get: Instead of having 8 different plots (picture1) representing the categories of my Y variable, to have ...
Shunrei's user avatar
  • 189
2 votes
1 answer
69 views

Extract the variable importance using the `randomForest` package from a `cforest`

Is it possible to extract the variable importance using the randomForest package from a cforest using the partykit package? Here is some code, where I try to extract the variable importance of both a &...
Linus's user avatar
  • 109
0 votes
0 answers
30 views

How to stop splitting data in random forest regression

I am currently working on writing a random forest regression code in Python and am struggling with it. My understanding is that, at each tree node, I select a feature (a column) to split the input X ...
Jihyun's user avatar
  • 923
0 votes
0 answers
26 views

How to Fix the Dimension Issues of features and classes from a Multilabel Classification dataset in getting the Out-of-Bag Error of a Random Forest?

I have created a multilabel classification dataset using make_multilabel_classification from scikit learn: from sklearn.datasets import make_multilabel_classification as mmc X, Y, p_c, p_w_c = mmc( ...
Ralph Henry's user avatar
3 votes
1 answer
59 views

"Warm Start" in combination with new data leads to broadcasting error when predicting with Random Forest

I am trying to train a random forest model with sklearn. I have some original data (x, y) that I use to train the RF initially with. from sklearn.ensemble import RandomForestClassifier import numpy as ...
Janosch's user avatar
  • 398
1 vote
1 answer
28 views

RFECV is starting over w/ original number of features

I'm trying to use RFECV to suggest the optimal number of features I should keep in X to predict y. My X is a dataframe with 121 variables (mix of dtypes, some continuous, some categorical) and my y is ...
Watson Gray's user avatar
0 votes
0 answers
33 views

Assessing variable importance of REEMforest and MERF using the "iml" package

I recently started working with the LongituRF package. I'm fitting it to some data, and I'd like to assess the variable importance using the iml package. I have already used iml, and I like its ...
Linus's user avatar
  • 109
0 votes
0 answers
30 views

Prediction of equipment failure based on meteorological data

I have a dataset where there are time stamps and associated weather data in hourly resolution. The last column is "Failure" where the equipment failure is written. This is a classification ...
Joseph's user avatar
  • 13
0 votes
0 answers
19 views

Splitting ML model between classes

I have a ML model where we're testing which genes are being driven by KRAS_variants. I've created a model based on 1000 variable genes with a 80/20 train vs test design. set.seed(123) # Set a seed ...
mmpp's user avatar
  • 125
0 votes
0 answers
26 views

Severity prediction using Random Forest Classifier wont show

I am using Random forest Classifier to predict the severity of Fusarium wilt using 7 in 1 soil sensor. For my project i am using Raspi 4 and Arduino (to easily communicate sensor). In my problem now, ...
Francis Cofreros's user avatar
0 votes
1 answer
62 views

My RandomForest Model for StockPrognosis outputs the same value between 2 set dates

I have made a RandomForest Model for Stock Prognosis. It outputs the same value everytime between 2021-11-03 and 2021-11-15. When applied to the same timeframe in 2020 it outputs it just fine. I tried ...
Tom Anorak's user avatar
0 votes
1 answer
46 views

Is it normal that quantregForest predictions and error metrics are completely different (and worse) than RandomForest ones with same data?

I am using quantregForest to perform quantile regression. Since I already have a script which uses randomForest, at first I simply tried to replace all my calls to randomForest with quantregForest and ...
umbe1987's user avatar
  • 3,016
0 votes
1 answer
22 views

WEKA Execute classifyInstance for Random Forest saved model

Trying to execute classifyInstance against Random Forest pre trained model for Java. I was able to execute SMO Naïve Bayes for the same code but not for bagging random forest pre trained model getting ...
Malinda Peiris's user avatar
1 vote
1 answer
53 views

Model is not retrieved correctly from mongodb

I have an R script which creates a model, serialize it and store it in a models collection inside a test mongo database: library(mongolite) mongo_host="localhost" mongo_port=27017 url_path =...
Lev's user avatar
  • 757
0 votes
1 answer
57 views

Accelerometer Data Classification

I am trying to classify accelerometer data (sampled with a frequency of 100Hz) into 4 different transportation modes (0,1,2,3). I have 41 different CSV files, each representing a time series. I stored ...
Maxl Gemeinderat's user avatar
0 votes
0 answers
52 views

spark-job on spark kubernetes cluster took long time to complete

I have setup 3 node spark kubernetes cluster with spark-kubernetes-operator helm-chart. The kubernetes cluster deployed on aws t2.2xlarge instances with 8 vcpus and 32gb memory. I have build ...
eranga's user avatar
  • 539

1
2 3 4 5
74