You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
y =convert(Matrix{Float64}, [i == j for i in y, j in lev])
iflength(lev) ==2
glmnet(X, y, Binomial(); kw...)
else
glmnet(X, y, Multinomial(); kw...)
end
else
error("y has only one level.")
end
end
So this works:
using GLMNet
y = ["M", "B", "M", "B"]
X =rand(4, 10)
glmnet(X, y)
The reason it doesn't need a distribution is because it chooses between Binomial and Multinomial based on the number of unique values in y. This method could probably be extended to support passing a distribution, and I guess throwing an error if the distribution and y are incompatible.
From README:
But the following doesn't work
Fortunately if
y
is a matrix with 2 columns, it does workThe text was updated successfully, but these errors were encountered: