You can pickle the label encoder too and use inverse_transform to transform
the integer predictions back into strings.

My 2 yens,
Mathieu

On Thu, Jul 18, 2013 at 3:56 AM, Wifi Gi <[email protected]>wrote:

> I'm aware of how to use LabelEncoder to convert string classes to numeric
> and back again. However, in my applications, I frequently save my models to
> disk (by pickling them) and reload them when I want to use them. When I use
> predict(), it of course returns only numerical classes, and if you don't
> remember what the numbers stood for, it's useless. Is there a way to
> somehow include a LabelEncoder in with the classifier object model when it
> is saved, so I don't have to write the class encodings to a separate file
> somewhere else?
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
>
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to