Open mytarmail opened 6 months ago
@mytarmail , thanks for this question.
abess
would consider multiple possible size of subset. In your code example, since the dimension of x
is 4, the possible size of subsets are 0, 1, 2, 3, 4. This leads to 5 sets of coefficients.
I guess you want the coefficients under the optimal size (i.e., well balance predictive accuracy and model complexity). Then you can use the following code to get the coefficient under the optimal subset size:
abess_fit <- abess(x, y, family = "mgaussian")
extract(abess_fit)
@mytarmail , thanks for this question.
abess
would consider multiple possible size of subset. In your code example, since the dimension ofx
is 4, the possible size of subsets are 0, 1, 2, 3, 4. This leads to 5 sets of coefficients.I guess you want the coefficients under the optimal size (i.e., well balance predictive accuracy and model complexity). Then you can use the following code to get the coefficient under the optimal subset size:
abess_fit <- abess(x, y, family = "mgaussian") extract(abess_fit)
Thanks for the quick response.
My problem is that I want not only to get coefficient
using extract(abess_fit)
but also be able to change these coefficients inside the abess_fit
model
see my first example here
Here's a more detailed question Why does the model have several sets of coefficients, in this case there are 5 of them, and how to tell which set of coefficients belongs to the current trained model
Code for Reproduction
Paste your code for reproducing the bug: