Note
Click here to download the full example code
STRidgeΒΆ
Out:
[32.12551734 76.33080772 33.6926875 9.42759779 5.16621758 58.28693612
29.43481665 7.18075454 10.30191944 75.31997019]
[28.61707383 69.15831382 29.89240922 8.88785683 4.38809077 53.08038878
26.86251397 6.64254402 9.76695373 68.28360746]
import numpy as np
from sklearn.datasets import make_regression
from sparsereg.model.base import STRidge
x, y = make_regression(n_samples=1000, n_features=10, n_informative=10, n_targets=1, random_state=42)
coef = STRidge().fit(x, y).coef_
print(STRidge().fit(x, y).coef_)
print(STRidge(unbias=False).fit(x, y).coef_)
Total running time of the script: ( 0 minutes 0.034 seconds)