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

How to save and load a OPLS model with nodejs? #32

Closed
JiayiHong opened this issue Apr 1, 2022 · 1 comment · Fixed by #41
Closed

How to save and load a OPLS model with nodejs? #32

JiayiHong opened this issue Apr 1, 2022 · 1 comment · Fixed by #41

Comments

@JiayiHong
Copy link

JiayiHong commented Apr 1, 2022

Hello,

I have trouble saving and loading the OPLS model. I tried to load a OPLS model with PLS.OPLS.load(obj) but it has an error like the below:
OPLS.js:355 Uncaught (in promise) TypeError: model.wOrth.transpose is not a function in OPLS.js:355.
My codes are like below:
`const model = pls.toJSON();
exportJsonFile("pls", model);

const obj = await fetchJson('pls.json');
const pls = PLS.OPLS.load(obj);
const result = pls.predict(testSetx, { trueLabels:testSety});`

Thank you so much in advance!

@targos
Copy link
Member

targos commented Apr 1, 2022

It's probably a bug. You code seems correct.

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

Successfully merging a pull request may close this issue.

2 participants