blob: 1b8cde228c98f6f39e342629355e83f2b8ccb3de [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>CsvRecordFactory (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="CsvRecordFactory (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};
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/CsvRecordFactory.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/CrossFoldLearner.html" title="class in org.apache.mahout.classifier.sgd"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/mahout/classifier/sgd/DefaultGradient.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/CsvRecordFactory.html" target="_top">Frames</a></li>
<li><a href="CsvRecordFactory.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>Field&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>Field&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 CsvRecordFactory" class="title">Class CsvRecordFactory</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>org.apache.mahout.classifier.sgd.CsvRecordFactory</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">CsvRecordFactory</span>
extends <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>
implements <a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></pre>
<div class="block">Converts CSV data lines to vectors.
Use of this class proceeds in a few steps.
<ul>
<li> At construction time, you tell the class about the target variable and provide
a dictionary of the types of the predictor values. At this point,
the class yet cannot decode inputs because it doesn't know the fields that are in the
data records, nor their order.
<li> Optionally, you tell the parser object about the possible values of the target
variable. If you don't do this then you probably should set the number of distinct
values so that the target variable values will be taken from a restricted range.
<li> Later, when you get a list of the fields, typically from the first line of a CSV
file, you tell the factory about these fields and it builds internal data structures
that allow it to decode inputs. The most important internal state is the field numbers
for various fields. After this point, you can use the factory for decoding data.
<li> To encode data as a vector, you present a line of input to the factory and it
mutates a vector that you provide. The factory also retains trace information so
that it can approximately reverse engineer vectors later.
<li> After converting data, you can ask for an explanation of the data in terms of
terms and weights. In order to explain a vector accurately, the factory needs to
have seen the particular values of categorical fields (typically during encoding vectors)
and needs to have a reasonably small number of collisions in the vector encoding.
</ul></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== 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/CsvRecordFactory.html#CsvRecordFactory-java.lang.String-java.util.Map-">CsvRecordFactory</a></span>(<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;targetName,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>,<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>&gt;&nbsp;typeMap)</code>
<div class="block">Construct a parser for CSV lines that encodes the parsed data in vector form.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#CsvRecordFactory-java.lang.String-java.lang.String-java.util.Map-">CsvRecordFactory</a></span>(<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;targetName,
<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;idName,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>,<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>&gt;&nbsp;typeMap)</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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#defineTargetCategories-java.util.List-">defineTargetCategories</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<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>&gt;&nbsp;values)</code>
<div class="block">Defines the values and thus the encoding of values of the target variables.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#firstLine-java.lang.String-">firstLine</a></span>(<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;line)</code>
<div class="block">Processes the first line of a file (which should contain the variable names).</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><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></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#getIdName--">getIdName</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><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></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#getIdString-java.lang.CharSequence-">getIdString</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;line)</code>
<div class="block">Extract the id column value from the CSV record</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<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>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#getPredictors--">getPredictors</a></span>()</code>
<div class="block">Returns a list of the names of the predictor variables.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<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>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#getTargetCategories--">getTargetCategories</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><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></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#getTargetLabel-int-">getTargetLabel</a></span>(int&nbsp;code)</code>
<div class="block">Extract the corresponding raw target label according to a code</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><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></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#getTargetString-java.lang.CharSequence-">getTargetString</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;line)</code>
<div class="block">Extract the raw target string from a line read from a CSV file.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>,<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#getTraceDictionary--">getTraceDictionary</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html" title="class in org.apache.mahout.classifier.sgd">CsvRecordFactory</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#includeBiasTerm-boolean-">includeBiasTerm</a></span>(boolean&nbsp;useBias)</code>&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html" title="class in org.apache.mahout.classifier.sgd">CsvRecordFactory</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#maxTargetValue-int-">maxTargetValue</a></span>(int&nbsp;max)</code>
<div class="block">Defines the number of target variable categories, but allows this parser to
pick encodings for them as they appear.</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/CsvRecordFactory.html#processLine-java.lang.CharSequence-org.apache.mahout.math.Vector-boolean-">processLine</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;line,
<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;featureVector,
boolean&nbsp;returnTarget)</code>
<div class="block">Decodes a single line of CSV data and records the target(if retrunTarget is true)
and predictor variables in a record.</div>
</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/CsvRecordFactory.html#processLine-java.lang.String-org.apache.mahout.math.Vector-">processLine</a></span>(<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;line,
<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;featureVector)</code>
<div class="block">Decodes a single line of CSV data and records the target and predictor variables in a record.</div>
</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/CsvRecordFactory.html#setIdName-java.lang.String-">setIdName</a></span>(<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;idName)</code>&nbsp;</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html#usesFirstLineAsSchema--">usesFirstLineAsSchema</a></span>()</code>&nbsp;</td>
</tr>
</table>
<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">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="CsvRecordFactory-java.lang.String-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CsvRecordFactory</h4>
<pre>public&nbsp;CsvRecordFactory(<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;targetName,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>,<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>&gt;&nbsp;typeMap)</pre>
<div class="block">Construct a parser for CSV lines that encodes the parsed data in vector form.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>targetName</code> - The name of the target variable.</dd>
<dd><code>typeMap</code> - A map describing the types of the predictor variables.</dd>
</dl>
</li>
</ul>
<a name="CsvRecordFactory-java.lang.String-java.lang.String-java.util.Map-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CsvRecordFactory</h4>
<pre>public&nbsp;CsvRecordFactory(<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;targetName,
<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;idName,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>,<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>&gt;&nbsp;typeMap)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="defineTargetCategories-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>defineTargetCategories</h4>
<pre>public&nbsp;void&nbsp;defineTargetCategories(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<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>&gt;&nbsp;values)</pre>
<div class="block">Defines the values and thus the encoding of values of the target variables. Note
that any values of the target variable not present in this list will be given the
value of the last member of the list.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html#defineTargetCategories-java.util.List-">defineTargetCategories</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - The values the target variable can have.</dd>
</dl>
</li>
</ul>
<a name="maxTargetValue-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>maxTargetValue</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html" title="class in org.apache.mahout.classifier.sgd">CsvRecordFactory</a>&nbsp;maxTargetValue(int&nbsp;max)</pre>
<div class="block">Defines the number of target variable categories, but allows this parser to
pick encodings for them as they appear.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html#maxTargetValue-int-">maxTargetValue</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>max</code> - The number of categories that will be expected. Once this many have been
seen, all others will get the encoding max-1.</dd>
</dl>
</li>
</ul>
<a name="usesFirstLineAsSchema--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>usesFirstLineAsSchema</h4>
<pre>public&nbsp;boolean&nbsp;usesFirstLineAsSchema()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html#usesFirstLineAsSchema--">usesFirstLineAsSchema</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></code></dd>
</dl>
</li>
</ul>
<a name="firstLine-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>firstLine</h4>
<pre>public&nbsp;void&nbsp;firstLine(<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;line)</pre>
<div class="block">Processes the first line of a file (which should contain the variable names). The target and
predictor column numbers are set from the names on this line.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html#firstLine-java.lang.String-">firstLine</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>line</code> - Header line for the file.</dd>
</dl>
</li>
</ul>
<a name="processLine-java.lang.String-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>processLine</h4>
<pre>public&nbsp;int&nbsp;processLine(<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;line,
<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;featureVector)</pre>
<div class="block">Decodes a single line of CSV data and records the target and predictor variables in a record.
As a side effect, features are added into the featureVector. Returns the value of the target
variable.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html#processLine-java.lang.String-org.apache.mahout.math.Vector-">processLine</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>line</code> - The raw data.</dd>
<dd><code>featureVector</code> - Where to fill in the features. Should be zeroed before calling
processLine.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value of the target variable.</dd>
</dl>
</li>
</ul>
<a name="processLine-java.lang.CharSequence-org.apache.mahout.math.Vector-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>processLine</h4>
<pre>public&nbsp;int&nbsp;processLine(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;line,
<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;featureVector,
boolean&nbsp;returnTarget)</pre>
<div class="block">Decodes a single line of CSV data and records the target(if retrunTarget is true)
and predictor variables in a record. As a side effect, features are added into the featureVector.
Returns the value of the target variable. When used during classify against production data without
target value, the method will be called with returnTarget = false.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>line</code> - The raw data.</dd>
<dd><code>featureVector</code> - Where to fill in the features. Should be zeroed before calling
processLine.</dd>
<dd><code>returnTarget</code> - whether process and return target value, -1 will be returned if false.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value of the target variable.</dd>
</dl>
</li>
</ul>
<a name="getTargetString-java.lang.CharSequence-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTargetString</h4>
<pre>public&nbsp;<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;getTargetString(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;line)</pre>
<div class="block">Extract the raw target string from a line read from a CSV file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>line</code> - the line of content read from CSV file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the raw target value in the corresponding column of CSV line</dd>
</dl>
</li>
</ul>
<a name="getTargetLabel-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTargetLabel</h4>
<pre>public&nbsp;<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;getTargetLabel(int&nbsp;code)</pre>
<div class="block">Extract the corresponding raw target label according to a code</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>code</code> - the integer code encoded during training process</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the raw target label</dd>
</dl>
</li>
</ul>
<a name="getIdString-java.lang.CharSequence-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIdString</h4>
<pre>public&nbsp;<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;getIdString(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;line)</pre>
<div class="block">Extract the id column value from the CSV record</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>line</code> - the line of content read from CSV file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the id value of the CSV record</dd>
</dl>
</li>
</ul>
<a name="getPredictors--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPredictors</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<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>&gt;&nbsp;getPredictors()</pre>
<div class="block">Returns a list of the names of the predictor variables.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html#getPredictors--">getPredictors</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A list of variable names.</dd>
</dl>
</li>
</ul>
<a name="getTraceDictionary--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTraceDictionary</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>,<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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;&gt;&nbsp;getTraceDictionary()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html#getTraceDictionary--">getTraceDictionary</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></code></dd>
</dl>
</li>
</ul>
<a name="includeBiasTerm-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>includeBiasTerm</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/mahout/classifier/sgd/CsvRecordFactory.html" title="class in org.apache.mahout.classifier.sgd">CsvRecordFactory</a>&nbsp;includeBiasTerm(boolean&nbsp;useBias)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html#includeBiasTerm-boolean-">includeBiasTerm</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></code></dd>
</dl>
</li>
</ul>
<a name="getTargetCategories--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTargetCategories</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<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>&gt;&nbsp;getTargetCategories()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html#getTargetCategories--">getTargetCategories</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/mahout/classifier/sgd/RecordFactory.html" title="interface in org.apache.mahout.classifier.sgd">RecordFactory</a></code></dd>
</dl>
</li>
</ul>
<a name="getIdName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIdName</h4>
<pre>public&nbsp;<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;getIdName()</pre>
</li>
</ul>
<a name="setIdName-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setIdName</h4>
<pre>public&nbsp;void&nbsp;setIdName(<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;idName)</pre>
</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/CsvRecordFactory.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/CrossFoldLearner.html" title="class in org.apache.mahout.classifier.sgd"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/mahout/classifier/sgd/DefaultGradient.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/CsvRecordFactory.html" target="_top">Frames</a></li>
<li><a href="CsvRecordFactory.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>Field&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>Field&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>