I think you misunderstood me. I meant something (more efficiently written)
along the lines of below.

import numpy as np

X0 = [[-1, 0], [0,-1]]
X1 = [[ 1, 0], [0, 1]]

trData = { 0: X0, 1: X1 }

X = np.array( [v for v in trData.values()] ).reshape( -1, 2 )
Y = np.array( [np.ones( len(v) ) * k for k, v in trData.iteritems()]
).ravel()




On Fri, Apr 5, 2013 at 10:42 AM, Philipp Singer <[email protected]> wrote:

> Dictionaries do not have duplicate keys (labels). You could only make a
> list of datawithLabelX for each key label. But what is the benefit of this?
>
> Philipp
>
> Am 05.04.2013 11:37, schrieb Bill Power:
> > i know this is going to sound a little silly, but I was thinking there
> > that it might be nice to be able to do this with scikit learn
> >
> > clf = sklearn.anyClassifier()
> > clf.fit( { 0: dataWithLabel0,
> >             1: dataWithLabel1 } )
> >
> > instead of having to separate the data/labels manually. i guess fit
> > would do that internally, but it might be nice to have this
> >
> > bill
> >
> >
> >
> ------------------------------------------------------------------------------
> > Minimize network downtime and maximize team effectiveness.
> > Reduce network management and security costs.Learn how to hire
> > the most talented Cisco Certified professionals. Visit the
> > Employer Resources Portal
> > http://www.cisco.com/web/learning/employer_resources/index.html
> >
> >
> >
> > _______________________________________________
> > Scikit-learn-general mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
> >
>
>
>
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to