Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ml-regression-base
Advanced tools
Base class for regression modules.
This package is for ml.js internal use.
You only have to implement the _predict
method. It is always called with a number.
The model should be created in the constructor.
Optional methods that can be implemented: toString
, toLaTeX
.
import BaseRegression from 'ml-regression-base';
class MyRegression extends BaseRegression {
constructor(factor) {
super();
this.factor = factor;
}
_predict(x) {
return x * this.factor;
}
toString() {
return `f(x) = x * ${this.factor}`;
}
}
maybeToPrecision(value, digits)
Convenience method to transform numbers to readable strings.
If digits is not specified, "value.toString()" is used. Otherwise "value.toPrecision(digits)" is used.
This method can be used to implement toString()
or toLaTeX()
.
checkArrayLength(x, y)
Convenience method to check if the input and output arrays passed to a regression constructor are effectively arrays with the same length.
FAQs
Base class for regression modules
The npm package ml-regression-base receives a total of 61,140 weekly downloads. As such, ml-regression-base popularity was classified as popular.
We found that ml-regression-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.