You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Q1: Dose IronPython 3.4.2 support scikit-learn? is yes, how to solve this problem.
Q2: I want to load a line-regression model to c#, how to achieve this if IronPython 3.4.2 don't support scikit-learn.
The text was updated successfully, but these errors were encountered:
Use Python 3.13.2 and scikit-learn 1.6.1 to generate the line-regression module and save it by "pickle.dump(model, file)"
Use Python 3.13.2 can load the model successfully by "model = pickle.load(file)"
The problem happened when I tried to load the model in .net8.0 use IronPython version: 3.4.2.
//C# code
using IronPython.Hosting;
class Program
{
static void Main(string[] args)
{
var engine = Python.CreateEngine();
engine.Execute(code);
dynamic py = engine.ExecuteFile("sklearn_line_load.py");
}
}
##sklearn_line_load.py
import pickle
with open('linear_model.pkl', 'rb') as file:
model = pickle.load(file)
def predict_price(data):
result = model.predict([data])
result = round(result[0])
return result
Environments:
Windows11, Visual Studio Version: 17.13.2 ;
IronPython version: 3.4.2; scikit-learn Version: 1.6.1 ;
Q1: Dose IronPython 3.4.2 support scikit-learn? is yes, how to solve this problem.
Q2: I want to load a line-regression model to c#, how to achieve this if IronPython 3.4.2 don't support scikit-learn.
The text was updated successfully, but these errors were encountered: