-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exporting & Loading Trained Model? #290
Comments
The models should implement the |
I'm having a little problem hehe, I'm trying to serialize the model (I'm using the example of linfa_svm) but I don't know if I'm using the correct syntax since I get the error in the line where I use cbor:
This is the code I'm using (linfa_svm/examples/winequality_multi.rs) :
Could you give me a more detailed example? I would appreciate it too much! |
Seems like |
Oh! I will try with normal SVM then, thank you! |
One last question, Code for creating and exporting the model :
Attempt to use the trained model in other .rs program :
But I keep getting error when trying to converting form ciborium::Value to SVM, the rust-analyzer suggests : consider specifying the generic argument: I know this has nothing to do with linfa, but I really think that exporting and importing the models can be very useful. Thank you! |
My bad, it turns out the example SVM model uses Svm<f64, bool> not Svm<_, bool>. I only changed the line to :
And it works super cool! |
I use cbor!(model), it show errors,how to resolve? the trait bound |
Is there a method to save a trained (GaussianNb)model and the load it?
I'm just learning how to use Rust, I just managed to implement a Gaussian Naive Bayes classifier model, is there any way to use the "predict" method without having to train the whole model again?
I know that in libraries like Sklearn you can export them models and then load them in .pkl formats, is there a similar implementation in linfa?
Thank you so much!
The text was updated successfully, but these errors were encountered: