Re: [scikit-learn] Error with Kfold cross vailidation

2018-10-24 Thread Joel Nothman
Yes, it is not iterable. You are copying a tutorial or code that describes
the usage of sklearn.cross_validation.KFold, which no longer exists in
version 0.20. Find an example with the newer sklearn.model_selection.KFold.

On Thu, 25 Oct 2018 at 00:36, bright silas Aboh 
wrote:

> Okey. I did removed the data.shape as suggested but I am now having a new
> error that says:
> Kfold object not iterable
>
> On Wed, 24 Oct 2018 at 13:23, Gael Varoquaux <
> gael.varoqu...@normalesup.org> wrote:
>
>> >   kf = KFold(data.shape[0], n_splits=5)
>> > TypeError: __init__() got multiple values for argument 'n_splits'
>>
>> Don't specify data.shape[0], this is no longer necessary in the recent
>> versions of scikit-learn.
>> ___
>> scikit-learn mailing list
>> scikit-learn@python.org
>> https://mail.python.org/mailman/listinfo/scikit-learn
>>
> ___
> scikit-learn mailing list
> scikit-learn@python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn


Re: [scikit-learn] Error with Kfold cross vailidation

2018-10-24 Thread serafim loukas
What is your scikit learn version?

In case you have the latest  try to reinstall the module.

On 24 Oct 2018, at 15:36, bright silas Aboh 
mailto:sbrighta...@gmail.com>> wrote:

Okey. I did removed the data.shape as suggested but I am now having a new error 
that says:
Kfold object not iterable

On Wed, 24 Oct 2018 at 13:23, Gael Varoquaux 
mailto:gael.varoqu...@normalesup.org>> wrote:
>   kf = KFold(data.shape[0], n_splits=5)
> TypeError: __init__() got multiple values for argument 'n_splits'

Don't specify data.shape[0], this is no longer necessary in the recent
versions of scikit-learn.
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn


Re: [scikit-learn] Error with Kfold cross vailidation

2018-10-24 Thread bright silas Aboh
Okey. I did removed the data.shape as suggested but I am now having a new
error that says:
Kfold object not iterable

On Wed, 24 Oct 2018 at 13:23, Gael Varoquaux 
wrote:

> >   kf = KFold(data.shape[0], n_splits=5)
> > TypeError: __init__() got multiple values for argument 'n_splits'
>
> Don't specify data.shape[0], this is no longer necessary in the recent
> versions of scikit-learn.
> ___
> scikit-learn mailing list
> scikit-learn@python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn


Re: [scikit-learn] Error with Kfold cross vailidation

2018-10-24 Thread Gael Varoquaux
>   kf = KFold(data.shape[0], n_splits=5)
> TypeError: __init__() got multiple values for argument 'n_splits'

Don't specify data.shape[0], this is no longer necessary in the recent
versions of scikit-learn.
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn


[scikit-learn] ​Re: Error with Kfold cross vailidation

2018-10-24 Thread eamanu15
Hello Bright!


> I am Bright and am trying to build a machine learning model with sklearn
> I get the following error however, can someone please help me?
>
>   kf = KFold(data.shape[0], n_splits=5)
> TypeError: __init__() got multiple values for argument 'n_splits'
>
>
Reading the doc [1] I think that the problem is that you are setting the
parameters from a wrong way.

The first parameter is n_split, but you set data.shape[0] and then you set
again "n_splits=5"

That is the error.

[1]
http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.KFold.html
-- 
Arias Emmanuel
http://eamanu.com
Github/Gitlab; @eamanu
Debian: @eamanu-guest
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn


Re: [scikit-learn] Error with Kfold cross vailidation

2018-10-24 Thread bright silas Aboh
yes please. I import KFold from sklearn.model_selection

On Wed, Oct 24, 2018 at 12:02 PM serafim loukas 
wrote:

> Hello,
>
>
> Do you import KFold from sklearn.model_selection ?
>
>
>
> On 24 Oct 2018, at 13:29, bright silas Aboh  wrote:
>
> Hi Everyone,
>
> I am Bright and am trying to build a machine learning model with sklearn
> I get the following error however, can someone please help me?
>
>   kf = KFold(data.shape[0], n_splits=5)
> TypeError: __init__() got multiple values for argument 'n_splits'
>
> Thank you
>
>
>
> ___
> scikit-learn mailing list
> scikit-learn@python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
>
> ___
> scikit-learn mailing list
> scikit-learn@python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn


Re: [scikit-learn] Error with Kfold cross vailidation

2018-10-24 Thread serafim loukas
Hello,


Do you import KFold from sklearn.model_selection ?



On 24 Oct 2018, at 13:29, bright silas Aboh 
mailto:sbrighta...@gmail.com>> wrote:

Hi Everyone,

I am Bright and am trying to build a machine learning model with sklearn
I get the following error however, can someone please help me?

  kf = KFold(data.shape[0], n_splits=5)
TypeError: __init__() got multiple values for argument 'n_splits'

Thank you



___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn

___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn


[scikit-learn] Error with Kfold cross vailidation

2018-10-24 Thread bright silas Aboh
Hi Everyone,

I am Bright and am trying to build a machine learning model with sklearn
I get the following error however, can someone please help me?

  kf = KFold(data.shape[0], n_splits=5)
TypeError: __init__() got multiple values for argument 'n_splits'

Thank you
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn


[scikit-learn] Pipegraph example: KMeans + LDA

2018-10-24 Thread Manuel Castejón Limas
Dear all,
as a way of improving the documentation of PipeGraph we intend to provide
more examples of its usage. It was a popular demand to show application
cases to motivate its usage, so here it is a very simple case with two
steps: a KMeans followed by a LDA.

https://mcasl.github.io/PipeGraph/auto_examples/plot_Finding_Number_of_clusters.html#sphx-glr-auto-examples-plot-finding-number-of-clusters-py

This short example points out the following challenges:
- KMeans is not a transformer but an estimator
- LDA score function requires the y parameter, while its input does not
come from a known set of labels, but from the previous KMeans
- Moreover, the GridSearchCV.fit call would also require a 'y' parameter
- It would be nice to have access to the output of the KMeans step as well.

PipeGraph is capable of addressing these challenges.

The rationale for this example lies in the identification-reconstruction
realm. In a scenario where the class labels are unknown, we might want to
associate the quality of the clustering structure to the capability of a
later model to be able to reconstruct this structure. So the basic idea
here is that if LDA is capable of getting good results it was because the
information of the KMeans was good enough for that purpose, hinting the
discovery of a good structure.
___
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn