Skip to content

Error: invalid type (list) for variable 'I(W^1)' #21

Description

@kenneth-lee-ch

Issue:

Got the following error message when only one feature is passed into the function polyFit().

"
getPoly() expects a matrix or a data.frame. The input will be coerced to a data.frame but you may wish to stop and provide one directly.

Error in t.default(xdata) : argument is not a matrix
In addition: Warning message:
In model_matrix(modelFormula, W, intercept, noisy, ...) :
model.matrix() reported the following error:
Error in model.frame.default(object, data, xlev = xlev) :
invalid type (list) for variable 'I(W^1)'
"

Code for reproducing the problem:
y <- as.factor(rep(c(0,1,1),20))
s <- rnorm(length(y))
dta <- data.frame(scores = s, y=y)
polyFit(dta,deg=1,use='glm')

I tried the following and it seems the function works for two features

dta2 <- data.frame(scores = s,scores_two = sort(s), y=y)
polyFit(dta2,deg=1,use='glm')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions