-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: bug in OPLS predict method + testcase #25
Conversation
Codecov Report
@@ Coverage Diff @@
## master #25 +/- ##
==========================================
+ Coverage 94.51% 95.78% +1.26%
==========================================
Files 6 6
Lines 529 546 +17
Branches 62 80 +18
==========================================
+ Hits 500 523 +23
+ Misses 28 23 -5
+ Partials 1 0 -1
Continue to review full report at Codecov.
|
features.scale('column', { scale: this.stdevs }); | ||
if (labels.rows > 0 && this.mode === 'regression') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why aren't you scaling the labels on regression's mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I'm doing it (between lines 341 and 343). But this if
in those lines are because the labels are optional (if you know which class the sample belongs) in order to calculate statistical parameters Q2y
and AUC
and that's the bug that I want to fix, some cases I want to test a sample without knowing which class belongs, and that's not currently working.
src/OPLS.js
Outdated
@@ -313,35 +313,40 @@ export class OPLS { | |||
* @param {Number} [options.nc] - the number of components to be used | |||
* @return {Object} - predictions | |||
*/ | |||
predict(newData, options = {}) { | |||
const { trueLabels = [] } = options; | |||
predict(data, options = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could you is jsdoc:
- specify that [options={}]
- use the same name in the method as in the jsdoc (so either data or features)
src/OPLS.js
Outdated
} | ||
|
||
const features = new Matrix(newData); | ||
const features = new Matrix(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me in the call of the method you may replace data
by features
and just specify features = new Matrix(features)
to ensure it is a Matrix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
No description provided.