CCS-Lab / easyml

A toolkit for easily building and evaluating machine learning models.
https://ccs-lab.github.io/easyml
Other
40 stars 16 forks source link

Error in randomForest.default(X, y, ...) : NA not permitted in predictors #37

Closed paulhendricks closed 7 years ago

paulhendricks commented 7 years ago

Code:

library(easyml)

# Load data
political_ideology <- read.csv("../../data/political_ideology.csv", 
                               stringsAsFactors = FALSE)

# Process data
mask <- (political_ideology$y != 3)
political_ideology <- political_ideology[mask, ]
political_ideology$y <- political_ideology$y - 1

# Analyze data
easy_random_forest(political_ideology, "y", 
                   family = "binomial", random_state = 1, n_core = 1)

Result:

[1] "Bootstrapping predictions:"
Error in randomForest.default(X, y, ...) : NA not permitted in predictors
In addition: Warning message:
In randomForest.default(X, y, ...) :
  The response has five or fewer unique values.  Are you sure you want to do regression?
paulhendricks commented 7 years ago

Closing because unable to replicate bug; must have been fixed somewhere along the way.

husain223 commented 4 years ago

Error in randomForest.default(feature_extraction(testdata), as.factor(testdata$survived), : NA not permitted in predictors In addition: Warning message: In Ops.factor(features$emabarked, as.factor(features$emabrked)) : ‘<’ not meaningful for factors

getting error in R