blob: 1611b42a6e46966972f848ade060a8dd1db9cf74 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Fri Apr 14 22:11:36 PDT 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GradientMachine (Mahout Map-Reduce 0.13.0 API)</title>
<meta name="date" content="2017-04-14">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="GradientMachine (Mahout Map-Reduce 0.13.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/GradientMachine.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/mahout/classifier/sgd/Gradient.html" title="interface in org.apache.mahout.classifier.sgd"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/mahout/classifier/sgd/L1.html" title="class in org.apache.mahout.classifier.sgd"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/mahout/classifier/sgd/GradientMachine.html" target="_top">Frames</a></li>
<li><a href="GradientMachine.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.mahout.classifier.sgd</div>
<h2 title="Class GradientMachine" class="title">Class GradientMachine</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html" title="class in org.apache.mahout.classifier">org.apache.mahout.classifier.AbstractVectorClassifier</a></li>
<li>
<ul class="inheritance">
<li>org.apache.mahout.classifier.sgd.GradientMachine</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a>, org.apache.hadoop.io.Writable, <a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html" title="interface in org.apache.mahout.classifier">OnlineLearner</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">GradientMachine</span>
extends <a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html" title="class in org.apache.mahout.classifier">AbstractVectorClassifier</a>
implements <a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html" title="interface in org.apache.mahout.classifier">OnlineLearner</a>, org.apache.hadoop.io.Writable</pre>
<div class="block">Online gradient machine learner that tries to minimize the label ranking hinge loss.
Implements a gradient machine with one sigmpod hidden layer.
It tries to minimize the ranking loss of some given set of labels,
so this can be used for multi-class, multi-label
or auto-encoding of sparse data (e.g. text).</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#WRITABLE_VERSION">WRITABLE_VERSION</a></span></code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.mahout.classifier.AbstractVectorClassifier">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.mahout.classifier.<a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html" title="class in org.apache.mahout.classifier">AbstractVectorClassifier</a></h3>
<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#MIN_LOG_LIKELIHOOD">MIN_LOG_LIKELIHOOD</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#GradientMachine-int-int-int-">GradientMachine</a></span>(int&nbsp;numFeatures,
int&nbsp;numHidden,
int&nbsp;numOutput)</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#classify-org.apache.mahout.math.Vector-">classify</a></span>(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</code>
<div class="block">Compute and return a vector containing <code>n-1</code> scores, where
<code>n</code> is equal to <code>numCategories()</code>, given an input
vector <code>instance</code>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#classifyNoLink-org.apache.mahout.math.Vector-">classifyNoLink</a></span>(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</code>
<div class="block">Compute and return a vector of scores before applying the inverse link
function.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#classifyScalar-org.apache.mahout.math.Vector-">classifyScalar</a></span>(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</code>
<div class="block">Classifies a vector in the special case of a binary classifier where
<a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classify-org.apache.mahout.math.Vector-"><code>AbstractVectorClassifier.classify(Vector)</code></a> would return a vector with only one element.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#close--">close</a></span>()</code>
<div class="block">Prepares the classifier for classification and deallocates any temporary data structures.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#copy--">copy</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#copyFrom-org.apache.mahout.classifier.sgd.GradientMachine-">copyFrom</a></span>(<a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a>&nbsp;other)</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/DenseVector.html?is-external=true" title="class or interface in org.apache.mahout.math">DenseVector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#hiddenToOutput-org.apache.mahout.math.Vector-">hiddenToOutput</a></span>(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;hiddenActivation)</code>
<div class="block">Feeds forward from hidden to output</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#initWeights-java.util.Random-">initWeights</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</a>&nbsp;gen)</code>
<div class="block">Initialize weights.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/DenseVector.html?is-external=true" title="class or interface in org.apache.mahout.math">DenseVector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#inputToHidden-org.apache.mahout.math.Vector-">inputToHidden</a></span>(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;input)</code>
<div class="block">Feeds forward from input to hidden unit..</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#learningRate-double-">learningRate</a></span>(double&nbsp;learningRate)</code>
<div class="block">Chainable configuration option.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#numCategories--">numCategories</a></span>()</code>
<div class="block">Returns the number of categories that a target variable can be assigned to.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#numFeatures--">numFeatures</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#numHidden--">numHidden</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#readFields-java.io.DataInput-">readFields</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/DataInput.html?is-external=true" title="class or interface in java.io">DataInput</a>&nbsp;in)</code>&nbsp;</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#regularization-double-">regularization</a></span>(double&nbsp;regularization)</code>
<div class="block">Chainable configuration option.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#sparsity-double-">sparsity</a></span>(double&nbsp;sparsity)</code>
<div class="block">Chainable configuration option.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#sparsityLearningRate-double-">sparsityLearningRate</a></span>(double&nbsp;sparsityLearningRate)</code>
<div class="block">Chainable configuration option.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#train-int-org.apache.mahout.math.Vector-">train</a></span>(int&nbsp;actual,
<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</code>
<div class="block">Updates the model using a particular target variable value and a feature vector.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#train-long-int-org.apache.mahout.math.Vector-">train</a></span>(long&nbsp;trackingKey,
int&nbsp;actual,
<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</code>
<div class="block">Updates the model using a particular target variable value and a feature vector.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#train-long-java.lang.String-int-org.apache.mahout.math.Vector-">train</a></span>(long&nbsp;trackingKey,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;groupKey,
int&nbsp;actual,
<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</code>
<div class="block">Updates the model using a particular target variable value and a feature vector.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#updateRanking-org.apache.mahout.math.Vector-java.util.Collection-int-java.util.Random-">updateRanking</a></span>(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;hiddenActivation,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;goodLabels,
int&nbsp;numTrials,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</a>&nbsp;gen)</code>
<div class="block">Updates using ranking loss.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html#write-java.io.DataOutput-">write</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/DataOutput.html?is-external=true" title="class or interface in java.io">DataOutput</a>&nbsp;out)</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.mahout.classifier.AbstractVectorClassifier">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.mahout.classifier.<a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html" title="class in org.apache.mahout.classifier">AbstractVectorClassifier</a></h3>
<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classify-org.apache.mahout.math.Matrix-">classify</a>, <a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classifyFull-org.apache.mahout.math.Matrix-">classifyFull</a>, <a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classifyFull-org.apache.mahout.math.Vector-">classifyFull</a>, <a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classifyFull-org.apache.mahout.math.Vector-org.apache.mahout.math.Vector-">classifyFull</a>, <a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classifyScalar-org.apache.mahout.math.Matrix-">classifyScalar</a>, <a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#logLikelihood-int-org.apache.mahout.math.Vector-">logLikelihood</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="WRITABLE_VERSION">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>WRITABLE_VERSION</h4>
<pre>public static final&nbsp;int WRITABLE_VERSION</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.mahout.classifier.sgd.GradientMachine.WRITABLE_VERSION">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="GradientMachine-int-int-int-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>GradientMachine</h4>
<pre>public&nbsp;GradientMachine(int&nbsp;numFeatures,
int&nbsp;numHidden,
int&nbsp;numOutput)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="initWeights-java.util.Random-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initWeights</h4>
<pre>public&nbsp;void&nbsp;initWeights(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</a>&nbsp;gen)</pre>
<div class="block">Initialize weights.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>gen</code> - random number generator.</dd>
</dl>
</li>
</ul>
<a name="learningRate-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>learningRate</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a>&nbsp;learningRate(double&nbsp;learningRate)</pre>
<div class="block">Chainable configuration option.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>learningRate</code> - New value of initial learning rate.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>This, so other configurations can be chained.</dd>
</dl>
</li>
</ul>
<a name="regularization-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>regularization</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a>&nbsp;regularization(double&nbsp;regularization)</pre>
<div class="block">Chainable configuration option.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>regularization</code> - A positive value that controls the weight vector size.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>This, so other configurations can be chained.</dd>
</dl>
</li>
</ul>
<a name="sparsity-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sparsity</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a>&nbsp;sparsity(double&nbsp;sparsity)</pre>
<div class="block">Chainable configuration option.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sparsity</code> - A value between zero and one that controls the fraction of hidden units
that are activated on average.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>This, so other configurations can be chained.</dd>
</dl>
</li>
</ul>
<a name="sparsityLearningRate-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sparsityLearningRate</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a>&nbsp;sparsityLearningRate(double&nbsp;sparsityLearningRate)</pre>
<div class="block">Chainable configuration option.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sparsityLearningRate</code> - New value of initial learning rate for sparsity.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>This, so other configurations can be chained.</dd>
</dl>
</li>
</ul>
<a name="copyFrom-org.apache.mahout.classifier.sgd.GradientMachine-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copyFrom</h4>
<pre>public&nbsp;void&nbsp;copyFrom(<a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a>&nbsp;other)</pre>
</li>
</ul>
<a name="numCategories--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>numCategories</h4>
<pre>public&nbsp;int&nbsp;numCategories()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#numCategories--">AbstractVectorClassifier</a></code></span></div>
<div class="block">Returns the number of categories that a target variable can be assigned to.
A vector classifier will encode it's output as an integer from
<code>0</code> to <code>numCategories()-1</code> (inclusive).</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#numCategories--">numCategories</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html" title="class in org.apache.mahout.classifier">AbstractVectorClassifier</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The number of categories.</dd>
</dl>
</li>
</ul>
<a name="numFeatures--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>numFeatures</h4>
<pre>public&nbsp;int&nbsp;numFeatures()</pre>
</li>
</ul>
<a name="numHidden--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>numHidden</h4>
<pre>public&nbsp;int&nbsp;numHidden()</pre>
</li>
</ul>
<a name="inputToHidden-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>inputToHidden</h4>
<pre>public&nbsp;<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/DenseVector.html?is-external=true" title="class or interface in org.apache.mahout.math">DenseVector</a>&nbsp;inputToHidden(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;input)</pre>
<div class="block">Feeds forward from input to hidden unit..</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Hidden unit activations.</dd>
</dl>
</li>
</ul>
<a name="hiddenToOutput-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hiddenToOutput</h4>
<pre>public&nbsp;<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/DenseVector.html?is-external=true" title="class or interface in org.apache.mahout.math">DenseVector</a>&nbsp;hiddenToOutput(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;hiddenActivation)</pre>
<div class="block">Feeds forward from hidden to output</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Output unit activations.</dd>
</dl>
</li>
</ul>
<a name="updateRanking-org.apache.mahout.math.Vector-java.util.Collection-int-java.util.Random-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>updateRanking</h4>
<pre>public&nbsp;void&nbsp;updateRanking(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;hiddenActivation,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;goodLabels,
int&nbsp;numTrials,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</a>&nbsp;gen)</pre>
<div class="block">Updates using ranking loss.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>hiddenActivation</code> - the hidden unit's activation</dd>
<dd><code>goodLabels</code> - the labels you want ranked above others.</dd>
<dd><code>numTrials</code> - how many times you want to search for the highest scoring bad label.</dd>
<dd><code>gen</code> - Random number generator.</dd>
</dl>
</li>
</ul>
<a name="classify-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>classify</h4>
<pre>public&nbsp;<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;classify(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classify-org.apache.mahout.math.Vector-">AbstractVectorClassifier</a></code></span></div>
<div class="block">Compute and return a vector containing <code>n-1</code> scores, where
<code>n</code> is equal to <code>numCategories()</code>, given an input
vector <code>instance</code>. Higher scores indicate that the input vector
is more likely to belong to that category. The categories are denoted by
the integers <code>0</code> through <code>n-1</code> (inclusive), and the
scores in the returned vector correspond to categories 1 through
<code>n-1</code> (leaving out category 0). It is assumed that the score for
category 0 is one minus the sum of the scores in the returned vector.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classify-org.apache.mahout.math.Vector-">classify</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html" title="class in org.apache.mahout.classifier">AbstractVectorClassifier</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>instance</code> - A feature vector to be classified.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A vector of probabilities in 1 of <code>n-1</code> encoding.</dd>
</dl>
</li>
</ul>
<a name="classifyNoLink-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>classifyNoLink</h4>
<pre>public&nbsp;<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;classifyNoLink(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classifyNoLink-org.apache.mahout.math.Vector-">AbstractVectorClassifier</a></code></span></div>
<div class="block">Compute and return a vector of scores before applying the inverse link
function. For logistic regression and other generalized linear models, this
is just the linear part of the classification.
<p>
The implementation of this method provided by <code>AbstractVectorClassifier</code> throws an
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang"><code>UnsupportedOperationException</code></a>. Your subclass must explicitly override this method to support
this operation.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classifyNoLink-org.apache.mahout.math.Vector-">classifyNoLink</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html" title="class in org.apache.mahout.classifier">AbstractVectorClassifier</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>instance</code> - A feature vector to be classified.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A vector of scores. If transformed by the link function, these will become probabilities.</dd>
</dl>
</li>
</ul>
<a name="classifyScalar-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>classifyScalar</h4>
<pre>public&nbsp;double&nbsp;classifyScalar(<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classifyScalar-org.apache.mahout.math.Vector-">AbstractVectorClassifier</a></code></span></div>
<div class="block">Classifies a vector in the special case of a binary classifier where
<a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classify-org.apache.mahout.math.Vector-"><code>AbstractVectorClassifier.classify(Vector)</code></a> would return a vector with only one element. As
such, using this method can avoid the allocation of a vector.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classifyScalar-org.apache.mahout.math.Vector-">classifyScalar</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html" title="class in org.apache.mahout.classifier">AbstractVectorClassifier</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>instance</code> - The feature vector to be classified.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The score for category 1.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/mahout/classifier/AbstractVectorClassifier.html#classify-org.apache.mahout.math.Vector-"><code>AbstractVectorClassifier.classify(Vector)</code></a></dd>
</dl>
</li>
</ul>
<a name="copy--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/mahout/classifier/sgd/GradientMachine.html" title="class in org.apache.mahout.classifier.sgd">GradientMachine</a>&nbsp;copy()</pre>
</li>
</ul>
<a name="write-java.io.DataOutput-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public&nbsp;void&nbsp;write(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/DataOutput.html?is-external=true" title="class or interface in java.io">DataOutput</a>&nbsp;out)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>write</code>&nbsp;in interface&nbsp;<code>org.apache.hadoop.io.Writable</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="readFields-java.io.DataInput-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readFields</h4>
<pre>public&nbsp;void&nbsp;readFields(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/DataInput.html?is-external=true" title="class or interface in java.io">DataInput</a>&nbsp;in)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>readFields</code>&nbsp;in interface&nbsp;<code>org.apache.hadoop.io.Writable</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>public&nbsp;void&nbsp;close()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html#close--">OnlineLearner</a></code></span></div>
<div class="block">Prepares the classifier for classification and deallocates any temporary data structures.
An online classifier should be able to accept more training after being closed, but
closing the classifier may make classification more efficient.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true#close--" title="class or interface in java.io">close</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true#close--" title="class or interface in java.lang">close</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html#close--">close</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html" title="interface in org.apache.mahout.classifier">OnlineLearner</a></code></dd>
</dl>
</li>
</ul>
<a name="train-long-java.lang.String-int-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>train</h4>
<pre>public&nbsp;void&nbsp;train(long&nbsp;trackingKey,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;groupKey,
int&nbsp;actual,
<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html#train-long-java.lang.String-int-org.apache.mahout.math.Vector-">OnlineLearner</a></code></span></div>
<div class="block">Updates the model using a particular target variable value and a feature vector.
<p/>
There may an assumption that if multiple passes through the training data are necessary that
the tracking key for a record will be the same for each pass and that there will be a
relatively large number of distinct tracking keys and that the low-order bits of the tracking
keys will not correlate with any of the input variables. This tracking key is used to assign
training examples to different test/training splits.
<p/>
Examples of useful tracking keys include id-numbers for the training records derived from
a database id for the base table from the which the record is derived, or the offset of
the original data record in a data file.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html#train-long-java.lang.String-int-org.apache.mahout.math.Vector-">train</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html" title="interface in org.apache.mahout.classifier">OnlineLearner</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>trackingKey</code> - The tracking key for this training example.</dd>
<dd><code>groupKey</code> - An optional value that allows examples to be grouped in the computation of
the update to the model.</dd>
<dd><code>actual</code> - The value of the target variable. This value should be in the half-open
interval [0..n) where n is the number of target categories.</dd>
<dd><code>instance</code> - The feature vector for this example.</dd>
</dl>
</li>
</ul>
<a name="train-long-int-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>train</h4>
<pre>public&nbsp;void&nbsp;train(long&nbsp;trackingKey,
int&nbsp;actual,
<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html#train-long-int-org.apache.mahout.math.Vector-">OnlineLearner</a></code></span></div>
<div class="block">Updates the model using a particular target variable value and a feature vector.
<p/>
There may an assumption that if multiple passes through the training data are necessary that
the tracking key for a record will be the same for each pass and that there will be a
relatively large number of distinct tracking keys and that the low-order bits of the tracking
keys will not correlate with any of the input variables. This tracking key is used to assign
training examples to different test/training splits.
<p/>
Examples of useful tracking keys include id-numbers for the training records derived from
a database id for the base table from the which the record is derived, or the offset of
the original data record in a data file.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html#train-long-int-org.apache.mahout.math.Vector-">train</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html" title="interface in org.apache.mahout.classifier">OnlineLearner</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>trackingKey</code> - The tracking key for this training example.</dd>
<dd><code>actual</code> - The value of the target variable. This value should be in the half-open
interval [0..n) where n is the number of target categories.</dd>
<dd><code>instance</code> - The feature vector for this example.</dd>
</dl>
</li>
</ul>
<a name="train-int-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>train</h4>
<pre>public&nbsp;void&nbsp;train(int&nbsp;actual,
<a href="http://mahout.apache.org/mahout-math/apidocs/org/apache/mahout/math/Vector.html?is-external=true" title="class or interface in org.apache.mahout.math">Vector</a>&nbsp;instance)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html#train-int-org.apache.mahout.math.Vector-">OnlineLearner</a></code></span></div>
<div class="block">Updates the model using a particular target variable value and a feature vector.
<p/>
There may an assumption that if multiple passes through the training data are necessary, then
the training examples will be presented in the same order. This is because the order of
training examples may be used to assign records to different data splits for evaluation by
cross-validation. Without the order invariance, records might be assigned to training and test
splits and error estimates could be seriously affected.
<p/>
If re-ordering is necessary, then using the alternative API which allows a tracking key to be
added to the training example can be used.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html#train-int-org.apache.mahout.math.Vector-">train</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/OnlineLearner.html" title="interface in org.apache.mahout.classifier">OnlineLearner</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>actual</code> - The value of the target variable. This value should be in the half-open
interval [0..n) where n is the number of target categories.</dd>
<dd><code>instance</code> - The feature vector for this example.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/GradientMachine.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/mahout/classifier/sgd/Gradient.html" title="interface in org.apache.mahout.classifier.sgd"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/mahout/classifier/sgd/L1.html" title="class in org.apache.mahout.classifier.sgd"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/mahout/classifier/sgd/GradientMachine.html" target="_top">Frames</a></li>
<li><a href="GradientMachine.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2008&#x2013;2017 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>