1
votes

I'm developing C# application where I need to use machine learning algorithm (Random Forest). C# is not very suitable for data analysis, so I saved data to .csv file and then analyzed them in Python using great scikit-learn library. I trained RandomForestRegressor (like there Python Scikit Random Forest Regressor Error) and it gives pretty nice results. But now I need to use this model in my C# application. Is there way to export model from scikit-learn lib and use it in C#?

1
I don't know if anyone has written a module s.t. you can use the sci-kit library in C#, but you could just do all of the processing in python and send the results to your C# application. Not sure if this will work for you, but it's an idea...Steve P.

1 Answers

1
votes

Implementing the prediction in random forests is a bit non-trivial. You basically need to program the evaluation of a decision tree. It is not as hard as implementing the training, but is probably still some work if you want it to be efficient.

Together with reading the python data structures, I would imagine that you might be better off using scikit-learn as an external library that you communicate with, as Steve P. suggested.