Scikit-Learn


Output  array([1.00000007])  Similarly, we can access the coefficient w of the model as follows:  BayReg.coef_  Output



Yüklə 1,92 Mb.
Pdf görüntüsü
səhifə40/124
tarix23.02.2023
ölçüsü1,92 Mb.
#101394
1   ...   36   37   38   39   40   41   42   43   ...   124
sklearn

Output 
array([1.00000007]) 
Similarly, we can access the coefficient w of the model as follows: 
BayReg.coef_ 
Output 


Scikit-Learn
43 
array([0.49999993, 0.49999993])
LASSO (Least Absolute Shrinkage and Selection Operator) 
LASSO is the regularisation technique that performs L1 regularisation. It modifies the loss 
function by adding the penalty (shrinkage quantity) equivalent to the summation of the 
absolute value of coefficients. 
∑ (𝑌
𝑖
− 𝑊
0
− ∑ 𝑊
𝑖
𝑋
𝑗𝑖
𝑛
𝑖=1
)
2

𝑚
𝑗=1
𝛼 ∑|𝑊
𝑖
|
𝑛
𝑖=1
= 𝑙𝑜𝑠𝑠_𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 + 𝛼 ∑|𝑊
𝑖
|
𝑛
𝑖=1
sklearn.linear_model. 
Lasso is a linear model, with an added regularisation term, used 
to estimate sparse coefficients. 
Parameters 
Followings table consist the parameters used by 
Lasso 
module: 
Parameter 
Description 
alpha
: float, optional, default = 1.0 
Alpha, the constant that multiplies the L1 term, is 
the tuning parameter that decides how much we 
want to penalize the model. The default value is 
1.0. 
fit_intercept

Boolean, 
optional. 
Default=True 
This parameter specifies that a constant (bias or 
intercept) should be added to the decision 
function. No intercept will be used in calculation, if 
it will set to false.
tol
: float, optional 
This parameter represents the tolerance for the 
optimization. The 
tol
value and updates would be 
compared and if found updates smaller than 

Yüklə 1,92 Mb.

Dostları ilə paylaş:
1   ...   36   37   38   39   40   41   42   43   ...   124




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə