hi,

try this:

---
from sklearn import datasets, linear_model

d = datasets.load_diabetes()

print linear_model.Lasso(normalize=True).fit(d['data'], d['target']).coef_

print linear_model.Lasso(normalize=False).fit(2. * d['data'], d['target']).coef_
----

returns:

[   0.           -0.          367.70185207    6.30190419    0.            0.
   -0.            0.          307.6057        0.        ]
[   0.           -0.          235.5193666    68.25355407   -0.           -0.
  -29.1597744     0.          204.01166218    0.        ]

the diabetes dataset is normalized.

best,
Alex

On Sat, Jun 1, 2013 at 3:48 AM, o m <oda...@gmail.com> wrote:
> The following script shows no difference in coefficients with or without
> normalization:
>
>
>>>> d = datasets.load_diabetes()
>
>>>> linear_model.Lasso(normalize=True).fit(d['data'], d['target']).coef_
> array([   0.        ,   -0.        ,  367.70185207,    6.30190419,
>           0.        ,    0.        ,   -0.        ,    0.        ,
>         307.6057    ,    0.        ])
>
>>>> clf = linear_model.Lasso(normalize=False).fit(d['data'],
>>>> d['target']).coef_
> array([   0.        ,   -0.        ,  367.70185207,    6.30190419,
>           0.        ,    0.        ,   -0.        ,    0.        ,
>         307.6057    ,    0.        ])
>>>>
>
> What am I doing wrong?
> Is it possible that coef_ are always reported unnormalized?
>
> Best Regards.
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to