Scikit-Learn



Yüklə 1,92 Mb.
Pdf görüntüsü
səhifə47/124
tarix23.02.2023
ölçüsü1,92 Mb.
#101394
1   ...   43   44   45   46   47   48   49   50   ...   124
sklearn

Output 
array([0.90909216]) 
#weight vectors 
ENreg.coef_ 
Output 
array([0.09091128, 0.09090784]) 
#Calculating intercept 
ENreg.intercept_ 
Output 
0.818180878658411 
#Calculating number of iterations 
ENreg.n_iter_ 
Output 
10 
From the above examples, we can see the difference in the outputs.
 
MultiTaskElasticNet 
It is an Elastic-Net model that allows to fit multiple regression problems jointly enforcing 
the selected features to be same for all the regression problems, also called tasks. Sklearn 
provides a linear model named 
MultiTaskElasticNet

trained with a mixed L1, L2-norm 
and L2 for regularisation,
 
which estimates sparse coefficients for multiple regression 
problems jointly. In this, the response y is a 2D array of shape (n_samples, n_tasks). 


Scikit-Learn
52 
Following is the objective function to minimize: 
min
𝑤
1
2𝑛
𝑠𝑎𝑚𝑝𝑙𝑒𝑠
||𝑋
𝑤
− 𝑦||
𝐹𝑟𝑜
2
+ 𝛼𝜌||𝑤||
21
+
𝛼(1 − 𝜌)
2
||𝑤||
𝐹𝑟𝑜
2
As in MultiTaskLasso, here also, Fro indicates the Frobenius norm: 
||𝐴||
𝐹𝑟𝑜 
= √∑ 𝑎
𝑖𝑗
2
𝑖𝑗
And L1L2 leads to the following: 
||𝐴||
21 
= ∑ √∑ 𝑎
𝑖𝑗
2
𝑗
𝑖
The 
parameters
and the 
attributes
for 
MultiTaskElasticNet
are like that of 
ElasticNet

The only difference is in li_ratio i.e. ElasticNet mixing parameter. In
 
MultiTaskElasticNet
its range is 0 < l1_ratio < = 1. If l1_ratio = 1, the penalty would be L1/L2 penalty. If 
l1_ratio = 0, the penalty would be an L2 penalty. If the value of l1 ratio is between 0 and 
1, the penalty would be the combination of L1/L2 and L2. 
And, opposite to 

Yüklə 1,92 Mb.

Dostları ilə paylaş:
1   ...   43   44   45   46   47   48   49   50   ...   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ə