I have a python wrapper that allows me to export datasets to Python for
analysis. But since my features are computed in C++, I'd like to compute
predictions in C++ as well. Then I would simply set the coefficients at
startup (v.first) and update the feature values continuously (v.second).
The entire computation can be done extremely quickly (at least for simple
classifiers).
On Mon, Sep 23, 2013 at 11:48 AM, Olivier Grisel
<[email protected]>wrote:
> 2013/9/23 Fred Baba <[email protected]>:
> > Thanks, Olivier. The application involves continuous classification of
> > real-time input features. So I only make on prediction at a time. My
> > intention would be to observe the structure of the fitted model and then
> > optimize the prediction function by hand in c++. For instance, a linear
> > classifier would be implemented something like:
> >
> > std::vector<std::pair<double,double> > vals;
> > ...
> > double val = 0, z = 0;
> > for (const auto& v : vals)
> > val += v.first * v.second;
> > z = std::copysign(1, val);
> >
> > The above code computes a 20-feature linear classifier in about 25ns.
> >
> > I'm not sure if a PMML exporter will be necessary for my current
> > application, but if so I'd be happy to contribute it to scikit-learn.
>
> But again, I think the time required to pack the data model into your
> std::vector<std::pair<double,double>> datastructure will dominate
> your prediction function.
>
> --
> Olivier
> http://twitter.com/ogrisel - http://github.com/ogrisel
>
>
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8,
> SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack
> includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general