Skip to content

SL.ridge leads to no weights estimated #26

@mleipzig

Description

@mleipzig

I tried to use SuperLearner with WeightIt using this code and everything worked just fine with Sl.glm, but ridge led to some errors.

W.out <- weightit(treat ~ age + educ + race + married + nodegree + re74 + re75, data = lalonde, estimand = "ATE", method = "super", SL.method = "method.balance", SL.library = c("SL.glm", "SL.ridge" ))

and got this

Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning message:
In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning message:
In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning messages:
1: In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

2: In predict.lm(object, newdata, se.fit, scale = 1, type = if (type ==  :
  prediction from a rank-deficient fit may be misleading
Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning message:
In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning message:
In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning message:
In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning message:
In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning message:
In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning message:
In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

Error in (function (Y, X, newX, family, lambda = seq(1, 20, 0.1), ...)  : 
  Currently only works with gaussian data
In addition: Warning message:
In FUN(X[[i]], ...) : Error in algorithm SL.ridge 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

Warning messages:
1: In FUN(X[[i]], ...) : Error in algorithm SL.ridge  on full data 
  The Algorithm will be removed from the Super Learner (i.e. given weight 0) 

2: In (function (Y, X, newX = NULL, family = gaussian(), SL.library,  :
  Re-running estimation of coefficients removing failed algorithm(s)
Original coefficients are: 
0.00934546386419807, 0.990654536135802

3: No weights were estimated. This is probably a bug,
     and you should report it at https://github.com/ngreifer/WeightIt/issues. 
4: Some weights were estimated as NA, which means a value was impossible to compute (e.g., Inf). Check for extreme values of the treatment or covariates and try removing them. Non-finite weights will be set to 0. 
5: All weights are 0, possibly indicating an estimation failure. 

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