UNPKG

node-nlp

Version:

Library for NLU (Natural Language Understanding) done in Node.js

582 lines (137 loc) 9.41 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: LogisticRegressionClassifier</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: LogisticRegressionClassifier</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>LogisticRegressionClassifier<span class="signature">()</span><span class="type-signature"></span></h2> <div class="class-description">Class for a Logistic Regression Classifier.</div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="LogisticRegressionClassifier"><span class="type-signature"></span>new LogisticRegressionClassifier<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="classifiers_logistic-regression-classifier.js.html">classifiers/logistic-regression-classifier.js</a>, <a href="classifiers_logistic-regression-classifier.js.html#line30">line 30</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="classifyObservation"><span class="type-signature"></span>classifyObservation<span class="signature">(srcObservation, classifications)</span><span class="type-signature"></span></h4> <div class="description"> Given an observation and an array for inserting the results, it calculates the score of the observation for each of the classifications and fills the array with the result objects. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>srcObservation</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">Source observation.</td> </tr> <tr> <td class="name"><code>classifications</code></td> <td class="type"> <span class="param-type">Array.&lt;Object></span> </td> <td class="description last">Array of classifications.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="classifiers_logistic-regression-classifier.js.html">classifiers/logistic-regression-classifier.js</a>, <a href="classifiers_logistic-regression-classifier.js.html#line74">line 74</a> </li></ul></dd> </dl> <h4 class="name" id="newClassification"><span class="type-signature"></span>newClassification<span class="signature">(observation, indexClassification)</span><span class="type-signature"></span></h4> <div class="description"> Given an observation vector and the index of one of the classifications, it returns an object that contains the label of the classification and the score of the vector for this classification. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>observation</code></td> <td class="type"> <span class="param-type"><a href="Vector.html">Vector</a></span> </td> <td class="description last">Observation vector.</td> </tr> <tr> <td class="name"><code>indexClassification</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">Index of the classification.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="classifiers_logistic-regression-classifier.js.html">classifiers/logistic-regression-classifier.js</a>, <a href="classifiers_logistic-regression-classifier.js.html#line60">line 60</a> </li></ul></dd> </dl> <h4 class="name" id="train"><span class="type-signature">(async) </span>train<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Train the logistic regression clasifier, that means that it calculates the thetas that relates all the features with the classifications, so when a new vector of features is the input to classify, these thetas are the weights for the calculation of the scores of each classification. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="classifiers_logistic-regression-classifier.js.html">classifiers/logistic-regression-classifier.js</a>, <a href="classifiers_logistic-regression-classifier.js.html#line38">line 38</a> </li></ul></dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryNeuralNetworkClassifier.html">BinaryNeuralNetworkClassifier</a></li><li><a href="Classifier.html">Classifier</a></li><li><a href="ConversationContext.html">ConversationContext</a></li><li><a href="DutchStemmer.html">DutchStemmer</a></li><li><a href="EnglishStemmer.html">EnglishStemmer</a></li><li><a href="EnumNamedEntity.html">EnumNamedEntity</a></li><li><a href="Evaluator.html">Evaluator</a></li><li><a href="HungarianStemmer.html">HungarianStemmer</a></li><li><a href="ItalianStemmer.html">ItalianStemmer</a></li><li><a href="Language.html">Language</a></li><li><a href="LogisticRegressionClassifier.html">LogisticRegressionClassifier</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="MemoryConversationContext.html">MemoryConversationContext</a></li><li><a href="NamedEntity.html">NamedEntity</a></li><li><a href="NerManager.html">NerManager</a></li><li><a href="NlgManager.html">NlgManager</a></li><li><a href="NlpClassifier.html">NlpClassifier</a></li><li><a href="NlpManager.html">NlpManager</a></li><li><a href="NorwegianStemmer.html">NorwegianStemmer</a></li><li><a href="PortugueseStemmer.html">PortugueseStemmer</a></li><li><a href="Recognizer.html">Recognizer</a></li><li><a href="RegexNamedEntity.html">RegexNamedEntity</a></li><li><a href="RomanianStemmer.html">RomanianStemmer</a></li><li><a href="RussianStemmer.html">RussianStemmer</a></li><li><a href="SentimentAnalyzer.html">SentimentAnalyzer</a></li><li><a href="SentimentManager.html">SentimentManager</a></li><li><a href="SimilarSearch.html">SimilarSearch</a></li><li><a href="SlotManager.html">SlotManager</a></li><li><a href="StemmerJa.html">StemmerJa</a></li><li><a href="SwedishStemmer.html">SwedishStemmer</a></li><li><a href="Tokenizer.html">Tokenizer</a></li><li><a href="TrimNamedEntity.html">TrimNamedEntity</a></li><li><a href="TurkishStemmer.html">TurkishStemmer</a></li><li><a href="Vector.html">Vector</a></li><li><a href="XTable.html">XTable</a></li></ul><h3>Global</h3><ul><li><a href="global.html#endsinArr">endsinArr</a></li><li><a href="global.html#prelude">prelude</a></li><li><a href="global.html#regions">regions</a></li><li><a href="global.html#stem">stem</a></li><li><a href="global.html#stopwords">stopwords</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Oct 13 2018 19:14:51 GMT+0200 (CEST) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>