Giter Site home page Giter Site logo

mmpf's People

Contributors

giuseppec avatar zmjones avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mmpf's Issues

marginalPrediction calls 'predict' changes order of data columns before calling predict

See mlr-org/mlr#2439. makeDesign changes the order of data columns:

> colnames(iris)
[1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"  "Species"
> colnames(mmpf::makeDesign(iris, "Petal.Width", dim(iris)))
[1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Species"      "Petal.Width"

which is fine by itself. However, when it is used in marginalPrediction, the predict function is then called with this reordered data, which breaks in some cases where predict expects the order of columns to match the order during model fitting. A fix for this would be a design = design[colnames(vars)data)], or a change in makeDesign that preserves column order.

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

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.