Files
mlpack/doc/html/naive__bayes__classifier_8hpp_source.html
T

129 lines
25 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>mlpack: src/mlpack/methods/naive_bayes/naive_bayes_classifier.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra-stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">mlpack
&#160;<span id="projectnumber">master</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_44a936ef30fc126706c6284a2fc0c990.html">mlpack</a></li><li class="navelem"><a class="el" href="dir_3cfbf900288ec2fe8dd2c2c8482f216e.html">methods</a></li><li class="navelem"><a class="el" href="dir_0c9cebbae2836f20c48fc7820984e89e.html">naive_bayes</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">naive_bayes_classifier.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="naive__bayes__classifier_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="preprocessor">#ifndef MLPACK_METHODS_NAIVE_BAYES_NAIVE_BAYES_CLASSIFIER_HPP</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="preprocessor">#define MLPACK_METHODS_NAIVE_BAYES_NAIVE_BAYES_CLASSIFIER_HPP</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="prereqs_8hpp.html">mlpack/prereqs.hpp</a>&gt;</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacemlpack.html">mlpack</a> {</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="namespacemlpack_1_1naive__bayes.html"> 20</a></span>&#160;<span class="keyword">namespace </span>naive_bayes {</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatType = arma::mat&gt;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html"> 47</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html">NaiveBayesClassifier</a></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;{</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a27aa5f96b14a7e73dde1b994049965f4">NaiveBayesClassifier</a>(<span class="keyword">const</span> MatType&amp; data,</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keyword">const</span> arma::Row&lt;size_t&gt;&amp; labels,</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> classes,</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keyword">const</span> <span class="keywordtype">bool</span> incrementalVariance = <span class="keyword">false</span>);</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a27aa5f96b14a7e73dde1b994049965f4">NaiveBayesClassifier</a>(<span class="keyword">const</span> <span class="keywordtype">size_t</span> dimensionality = 0,</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> classes = 0);</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a9439d0a83f597b91d523aaeefc0d2a96">Train</a>(<span class="keyword">const</span> MatType&amp; data,</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keyword">const</span> arma::Row&lt;size_t&gt;&amp; labels,</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keyword">const</span> <span class="keywordtype">bool</span> incremental = <span class="keyword">true</span>);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> VecType&gt;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a9439d0a83f597b91d523aaeefc0d2a96">Train</a>(<span class="keyword">const</span> VecType&amp; point, <span class="keyword">const</span> <span class="keywordtype">size_t</span> label);</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a566d9abe10898de6749d74b9aa4f7220">Classify</a>(<span class="keyword">const</span> MatType&amp; data, arma::Row&lt;size_t&gt;&amp; results);</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a00c4df4fb43e1f1965c1c4dda73d1fc3"> 129</a></span>&#160; <span class="keyword">const</span> MatType&amp; <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a00c4df4fb43e1f1965c1c4dda73d1fc3">Means</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#af50fa618926013933a71f5185e4c829d">means</a>; }</div><div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a31803d8ea383b0c1e45caf9d4fa3b480"> 131</a></span>&#160; MatType&amp; <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a31803d8ea383b0c1e45caf9d4fa3b480">Means</a>() { <span class="keywordflow">return</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#af50fa618926013933a71f5185e4c829d">means</a>; }</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#aa9a802c8a6f22ba4d211d035d3fc470d"> 134</a></span>&#160; <span class="keyword">const</span> MatType&amp; <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#aa9a802c8a6f22ba4d211d035d3fc470d">Variances</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#aea01921c2d5af0ca1d586d2427601a91">variances</a>; }</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#abe5b082c716f0620177180a782db588e"> 136</a></span>&#160; MatType&amp; <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#abe5b082c716f0620177180a782db588e">Variances</a>() { <span class="keywordflow">return</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#aea01921c2d5af0ca1d586d2427601a91">variances</a>; }</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a5f82b58bb155c60d6f35071e4535d727"> 139</a></span>&#160; <span class="keyword">const</span> arma::vec&amp; <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a5f82b58bb155c60d6f35071e4535d727">Probabilities</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#abf6beeca22ee20c34d59f37b2591f052">probabilities</a>; }</div><div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#ae41541dc69c7153c33a14185130b82d8"> 141</a></span>&#160; arma::vec&amp; <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#ae41541dc69c7153c33a14185130b82d8">Probabilities</a>() { <span class="keywordflow">return</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#abf6beeca22ee20c34d59f37b2591f052">probabilities</a>; }</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Archive&gt;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a209b49a629e119848aae27771cd57ecd">Serialize</a>(Archive&amp; ar, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="comment">/* version */</span>);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00149"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#af50fa618926013933a71f5185e4c829d"> 149</a></span>&#160; MatType <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#af50fa618926013933a71f5185e4c829d">means</a>;</div><div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#aea01921c2d5af0ca1d586d2427601a91"> 151</a></span>&#160; MatType <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#aea01921c2d5af0ca1d586d2427601a91">variances</a>;</div><div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#abf6beeca22ee20c34d59f37b2591f052"> 153</a></span>&#160; arma::vec <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#abf6beeca22ee20c34d59f37b2591f052">probabilities</a>;</div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a7309b5829e5e7d40ef7831055b653042"> 155</a></span>&#160; <span class="keywordtype">size_t</span> <a class="code" href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a7309b5829e5e7d40ef7831055b653042">trainingPoints</a>;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;};</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;} <span class="comment">// namespace naive_bayes</span></div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;} <span class="comment">// namespace mlpack</span></div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="comment">// Include implementation.</span></div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="preprocessor">#include &quot;naive_bayes_classifier_impl.hpp&quot;</span></div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_a31803d8ea383b0c1e45caf9d4fa3b480"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a31803d8ea383b0c1e45caf9d4fa3b480">mlpack::naive_bayes::NaiveBayesClassifier::Means</a></div><div class="ttdeci">MatType &amp; Means()</div><div class="ttdoc">Modify the sample means for each class. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00131">naive_bayes_classifier.hpp:131</a></div></div>
<div class="ttc" id="namespacemlpack_html"><div class="ttname"><a href="namespacemlpack.html">mlpack</a></div><div class="ttdoc">Linear algebra utility functions, generally performed on matrices or vectors. </div><div class="ttdef"><b>Definition:</b> <a href="binarize_8hpp_source.html#l00018">binarize.hpp:18</a></div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_a209b49a629e119848aae27771cd57ecd"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a209b49a629e119848aae27771cd57ecd">mlpack::naive_bayes::NaiveBayesClassifier::Serialize</a></div><div class="ttdeci">void Serialize(Archive &amp;ar, const unsigned int)</div><div class="ttdoc">Serialize the classifier. </div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_a00c4df4fb43e1f1965c1c4dda73d1fc3"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a00c4df4fb43e1f1965c1c4dda73d1fc3">mlpack::naive_bayes::NaiveBayesClassifier::Means</a></div><div class="ttdeci">const MatType &amp; Means() const </div><div class="ttdoc">Get the sample means for each class. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00129">naive_bayes_classifier.hpp:129</a></div></div>
<div class="ttc" id="prereqs_8hpp_html"><div class="ttname"><a href="prereqs_8hpp.html">prereqs.hpp</a></div><div class="ttdoc">The core includes that mlpack expects; standard C++ includes and Armadillo. </div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html">mlpack::naive_bayes::NaiveBayesClassifier</a></div><div class="ttdoc">The simple Naive Bayes classifier. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00047">naive_bayes_classifier.hpp:47</a></div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_abf6beeca22ee20c34d59f37b2591f052"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#abf6beeca22ee20c34d59f37b2591f052">mlpack::naive_bayes::NaiveBayesClassifier::probabilities</a></div><div class="ttdeci">arma::vec probabilities</div><div class="ttdoc">Class probabilities. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00153">naive_bayes_classifier.hpp:153</a></div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_a9439d0a83f597b91d523aaeefc0d2a96"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a9439d0a83f597b91d523aaeefc0d2a96">mlpack::naive_bayes::NaiveBayesClassifier::Train</a></div><div class="ttdeci">void Train(const MatType &amp;data, const arma::Row&lt; size_t &gt; &amp;labels, const bool incremental=true)</div><div class="ttdoc">Train the Naive Bayes classifier on the given dataset. </div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_af50fa618926013933a71f5185e4c829d"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#af50fa618926013933a71f5185e4c829d">mlpack::naive_bayes::NaiveBayesClassifier::means</a></div><div class="ttdeci">MatType means</div><div class="ttdoc">Sample mean for each class. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00149">naive_bayes_classifier.hpp:149</a></div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_abe5b082c716f0620177180a782db588e"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#abe5b082c716f0620177180a782db588e">mlpack::naive_bayes::NaiveBayesClassifier::Variances</a></div><div class="ttdeci">MatType &amp; Variances()</div><div class="ttdoc">Modify the sample variances for each class. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00136">naive_bayes_classifier.hpp:136</a></div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_aa9a802c8a6f22ba4d211d035d3fc470d"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#aa9a802c8a6f22ba4d211d035d3fc470d">mlpack::naive_bayes::NaiveBayesClassifier::Variances</a></div><div class="ttdeci">const MatType &amp; Variances() const </div><div class="ttdoc">Get the sample variances for each class. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00134">naive_bayes_classifier.hpp:134</a></div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_ae41541dc69c7153c33a14185130b82d8"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#ae41541dc69c7153c33a14185130b82d8">mlpack::naive_bayes::NaiveBayesClassifier::Probabilities</a></div><div class="ttdeci">arma::vec &amp; Probabilities()</div><div class="ttdoc">Modify the prior probabilities for each class. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00141">naive_bayes_classifier.hpp:141</a></div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_a27aa5f96b14a7e73dde1b994049965f4"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a27aa5f96b14a7e73dde1b994049965f4">mlpack::naive_bayes::NaiveBayesClassifier::NaiveBayesClassifier</a></div><div class="ttdeci">NaiveBayesClassifier(const MatType &amp;data, const arma::Row&lt; size_t &gt; &amp;labels, const size_t classes, const bool incrementalVariance=false)</div><div class="ttdoc">Initializes the classifier as per the input and then trains it by calculating the sample mean and var...</div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_a7309b5829e5e7d40ef7831055b653042"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a7309b5829e5e7d40ef7831055b653042">mlpack::naive_bayes::NaiveBayesClassifier::trainingPoints</a></div><div class="ttdeci">size_t trainingPoints</div><div class="ttdoc">Number of training points seen so far. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00155">naive_bayes_classifier.hpp:155</a></div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_a566d9abe10898de6749d74b9aa4f7220"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a566d9abe10898de6749d74b9aa4f7220">mlpack::naive_bayes::NaiveBayesClassifier::Classify</a></div><div class="ttdeci">void Classify(const MatType &amp;data, arma::Row&lt; size_t &gt; &amp;results)</div><div class="ttdoc">Given a bunch of data points, this function evaluates the class of each of those data points...</div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_aea01921c2d5af0ca1d586d2427601a91"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#aea01921c2d5af0ca1d586d2427601a91">mlpack::naive_bayes::NaiveBayesClassifier::variances</a></div><div class="ttdeci">MatType variances</div><div class="ttdoc">Sample variances for each class. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00151">naive_bayes_classifier.hpp:151</a></div></div>
<div class="ttc" id="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier_html_a5f82b58bb155c60d6f35071e4535d727"><div class="ttname"><a href="classmlpack_1_1naive__bayes_1_1NaiveBayesClassifier.html#a5f82b58bb155c60d6f35071e4535d727">mlpack::naive_bayes::NaiveBayesClassifier::Probabilities</a></div><div class="ttdeci">const arma::vec &amp; Probabilities() const </div><div class="ttdoc">Get the prior probabilities for each class. </div><div class="ttdef"><b>Definition:</b> <a href="naive__bayes__classifier_8hpp_source.html#l00139">naive_bayes_classifier.hpp:139</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
<script type="text/javascript">
var x = document.getElementsByClassName("formulaDsp");
var i;
for (i = 0; i < x.length; i++)
{
x[i].width /= 4;
}
</script>
</html>