Hi Rex

As Gilles said, this currently is not supported in sklearn. It may be
possible to do this with post processing, by checking to see if child
splits produced the same result. aka if city == 'a' return 0, else if city
== 'b' return 0 else 1 (a simple 2 node decision tree) can be merged into
if city == 'a' or 'b' return 0 else 1.

Jacob

On Fri, Sep 11, 2015 at 11:23 PM, Gilles Louppe <g.lou...@gmail.com> wrote:

> Hi Rex,
>
> This is currently not supported in scikit-learn.
>
> Gilles
>
> On 12 September 2015 at 05:02, Rex X <dnsr...@gmail.com> wrote:
> > Given categorical attributes, for instance
> > city = ['a', 'b', 'c', 'd', 'e', 'f']
> >
> > With DictVectorizer(), we can transform "city" into a sparse matrix,
> using
> > 1-of-k representation.
> >
> > But for each split, the decisionTree evaluate only one single attribute,
> say
> > city == 'a' - True or False?
> >
> > What I want is to ask if the city is in a subset
> > city.isin['a', 'b', 'c'] - True or False?
> >
> >
> > As I know, the implementation of MLlib of spark can do this?
> >
> > Can we make do this within scikit-learn?
> >
> >
> > Best,
> > Rex
> >
> >
> ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Scikit-learn-general mailing list
> > Scikit-learn-general@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
> >
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
------------------------------------------------------------------------------
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to