Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving Error: Assertion on 'x' failed: Must be of type 'data.frame', not 'logical'. #3

Open
DeFilippis opened this issue Jun 6, 2019 · 1 comment

Comments

@DeFilippis
Copy link

I'm getting the following error, and it's not clear how to resolve this:

Error in marginalPrediction(sample.features[, -c("revenue_log_s")], "empcount_s",  :
  Assertion on 'x' failed: Must be of type 'data.frame', not 'logical'.
I successfully fit a randomForest model, and then call marginalPrediction like so:

mp = marginalPrediction(data[, -c('revenue_log_s')], 
                        "empcount_s", 
                        c(10, nrow(data)), 
                        fit)

I'm not sure what 'x' is referring to, as the data I pass in the first row is a dataframe, and I'm sure that the second argument is supposed to be a character vector, and not a dataframe.

Any thoughts?

@DeFilippis
Copy link
Author

DeFilippis commented Jun 6, 2019

Figured it out. data was both a data.table and a data.frame. This throws an error. Also throws an error with the imp library. Re-cast data as a dataframe and it will work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant