Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
wink-perceptron
Advanced tools
Multi-class averaged perceptron
Wink Perceptron is a fast and effective way to learn linearly separable patterns from either dense or sparse data. Its averaging function results in better generalization compared to the vanilla implementation of perceptron.
Use npm to install:
npm install wink-perceptron --save
Here is an example of predicting type of iris plant from the Iris Data Set.
// Load training data — the Iris Data Set obtained from
// UCI Machine Learning Repository; it has been converted
// into JSON format.
// You may need to update the path in the "require" statement
// according to your working directory.
const trainingExamples = require( 'wink-perceptron/sample-data/iris-train.json' );
// Initialize a test data sample.
const testData = {
setosa: { sepalLength: 4.9, sepalWidth: 3, petalLength: 1.4, petalWidth: 0.2 },
versicolor: { sepalLength: 6.4, sepalWidth: 3.2, petalLength: 4.5, petalWidth: 1.5 },
virginica: { sepalLength: 7.2, sepalWidth: 3.6, petalLength: 6.1, petalWidth: 2.5 }
};
// Load wink perceptron.
var winkPerceptron = require( 'wink-perceptron' );
// Instantiate wink perceptron.
var perceptron = winkPerceptron();
// Define configurtaion.
perceptron.defineConfig( { shuffleData: true, maxIterations: 21 } );
// Learn from training data.
perceptron.learn( trainingExamples );
// Attempt prediction for each iris plant type.
console.log( perceptron.predict( testData.setosa ) );
// -> Iris-setosa
console.log( perceptron.predict( testData.versicolor ) );
// -> Iris-versicolor
console.log( perceptron.predict( testData.virginica ) );
// -> Iris-virginica
Try experimenting with this example on Runkit in the browser.
Check out the perceptron API documentation to learn more.
If you spot a bug and the same has not yet been reported, raise a new issue or consider fixing it and sending a pull request.
Wink is a family of open source packages for Statistical Analysis, Natural Language Processing and Machine Learning in NodeJS. The code is thoroughly documented for easy human comprehension and has a test coverage of ~100% for reliability to build production grade solutions.
wink-perceptron is copyright 2017-18 GRAYPE Systems Private Limited.
It is licensed under the terms of the MIT License.
FAQs
Multi-class averaged perceptron
We found that wink-perceptron demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.