Skip to content
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

save and load #239

Closed
1093919186 opened this issue Aug 15, 2022 · 2 comments
Closed

save and load #239

1093919186 opened this issue Aug 15, 2022 · 2 comments

Comments

@1093919186
Copy link

Hi,

How do you save and then re-open a trained network?
It doesn't seem to be explained anywhere in the doc.

Thanks.

@alvgoro
Copy link

alvgoro commented Sep 8, 2022

Hi @1093919186. ScikitJS does not have implemented neural network, I guess.

For saving and loading a trained "transformer" you can use toJson() and fromJson() methods.

`
// Initialize One-Hot-Encoder (whatever)
let OHE = new scikitjs.OneHotEncoder();

// Fit stage
OHE.fit(yourData);

// Save
let savedOHE = OHE.toJson()

// ...
// Your amazing code
// ...

// Load stage
// First initialize a new OHE
let newOHE = new scikitjs.OneHotEncoder();

// Then use .fromJson() method
newOHE = newOHE.fromJson(savedOHE);
`

@1093919186
Copy link
Author

Hi Alvgoro, I’m grateful for your sharing. By learning the source code, I have found this implementation method. There is another issue here issue, do you have a solution?
Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants