I made many models with scikit learn, and i want to make predictions with these models from a C# program, is there any API which will help me to do that ?.
The fit() method takes the training data as arguments, which can be one array in the case of unsupervised learning, or two arrays in the case of supervised learning. Note that the model is fitted using X and y , but the object holds no reference to X and y .
It is not possible to load sklearn models in C# directly (for my knowledge).
There is a language for the language-/tool-independent exchange of ML models called PMML. sklearn doesn't bring native support for PMML however. If you're lucky, your model/pipeline might be exportable to PMML using third party tools and loadable in C# using third party libraries.
The more reliable and way more flexible way is to do the prediction in Python using sklearn and communicate with your C# program via files or (better) a web service. Olivier Grisel (one of the sklearn authors) concisely describes your options in this post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With