Files
mlpack/doc/html/classmlpack_1_1regression_1_1LogisticRegressionFunction.html
T

779 lines
43 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: mlpack::regression::LogisticRegressionFunction&lt; MatType &gt; Class Template Reference</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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><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="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#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="namespacemlpack.html">mlpack</a></li><li class="navelem"><a class="el" href="namespacemlpack_1_1regression.html">regression</a></li><li class="navelem"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">LogisticRegressionFunction</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classmlpack_1_1regression_1_1LogisticRegressionFunction-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>The log-likelihood function for the logistic regression objective function.
<a href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8f8a0ea4307d3f41dd4c2f864245eb12"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a8f8a0ea4307d3f41dd4c2f864245eb12">LogisticRegressionFunction</a> (const MatType &amp;<a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a0b1bd72084ee29066c58b2d8b0bf84ce">predictors</a>, const arma::Row&lt; size_t &gt; &amp;<a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#af7f264fee499538ed85c649f0485e944">responses</a>, const double <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a5058f00c39a8846b5193c5ff81f315e2">lambda</a>=0)</td></tr>
<tr class="separator:a8f8a0ea4307d3f41dd4c2f864245eb12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a721659982eacc9dce114278c6fdcb2a0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a721659982eacc9dce114278c6fdcb2a0">LogisticRegressionFunction</a> (const MatType &amp;<a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a0b1bd72084ee29066c58b2d8b0bf84ce">predictors</a>, const arma::Row&lt; size_t &gt; &amp;<a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#af7f264fee499538ed85c649f0485e944">responses</a>, const arma::vec &amp;<a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#ab436707b0b1bd1d08ad001238dbfd0bd">initialPoint</a>, const double <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a5058f00c39a8846b5193c5ff81f315e2">lambda</a>=0)</td></tr>
<tr class="separator:a721659982eacc9dce114278c6fdcb2a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a200729c6e8d9f433f930b8880f79eef5"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a200729c6e8d9f433f930b8880f79eef5">Evaluate</a> (const arma::mat &amp;parameters) const </td></tr>
<tr class="memdesc:a200729c6e8d9f433f930b8880f79eef5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluate the logistic regression log-likelihood function with the given parameters. <a href="#a200729c6e8d9f433f930b8880f79eef5">More...</a><br /></td></tr>
<tr class="separator:a200729c6e8d9f433f930b8880f79eef5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cdf90d1e37e0d43f175d373342cb5a1"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a2cdf90d1e37e0d43f175d373342cb5a1">Evaluate</a> (const arma::mat &amp;parameters, const size_t i) const </td></tr>
<tr class="memdesc:a2cdf90d1e37e0d43f175d373342cb5a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluate the logistic regression log-likelihood function with the given parameters, but using only one data point. <a href="#a2cdf90d1e37e0d43f175d373342cb5a1">More...</a><br /></td></tr>
<tr class="separator:a2cdf90d1e37e0d43f175d373342cb5a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bd42c32840e753c1e59a9531356d710"><td class="memItemLeft" align="right" valign="top">const arma::mat &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a5bd42c32840e753c1e59a9531356d710">GetInitialPoint</a> () const </td></tr>
<tr class="memdesc:a5bd42c32840e753c1e59a9531356d710"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the initial point for the optimization. <a href="#a5bd42c32840e753c1e59a9531356d710">More...</a><br /></td></tr>
<tr class="separator:a5bd42c32840e753c1e59a9531356d710"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af03884eac1acde5bfcb583d61ea366a4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#af03884eac1acde5bfcb583d61ea366a4">Gradient</a> (const arma::mat &amp;parameters, arma::mat &amp;gradient) const </td></tr>
<tr class="memdesc:af03884eac1acde5bfcb583d61ea366a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluate the gradient of the logistic regression log-likelihood function with the given parameters. <a href="#af03884eac1acde5bfcb583d61ea366a4">More...</a><br /></td></tr>
<tr class="separator:af03884eac1acde5bfcb583d61ea366a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac061b42b43741296343c6ea2abd5b292"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#ac061b42b43741296343c6ea2abd5b292">Gradient</a> (const arma::mat &amp;parameters, const size_t i, arma::mat &amp;gradient) const </td></tr>
<tr class="memdesc:ac061b42b43741296343c6ea2abd5b292"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluate the gradient of the logistic regression log-likelihood function with the given parameters, and with respect to only one point in the dataset. <a href="#ac061b42b43741296343c6ea2abd5b292">More...</a><br /></td></tr>
<tr class="separator:ac061b42b43741296343c6ea2abd5b292"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71c8ab5910f1b3d9d79d2606401a73af"><td class="memItemLeft" align="right" valign="top">const arma::mat &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a71c8ab5910f1b3d9d79d2606401a73af">InitialPoint</a> () const </td></tr>
<tr class="memdesc:a71c8ab5910f1b3d9d79d2606401a73af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the initial point for the optimization. <a href="#a71c8ab5910f1b3d9d79d2606401a73af">More...</a><br /></td></tr>
<tr class="separator:a71c8ab5910f1b3d9d79d2606401a73af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a348c31d2a43ee5f5243ecb1693a09ab5"><td class="memItemLeft" align="right" valign="top">arma::mat &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a348c31d2a43ee5f5243ecb1693a09ab5">InitialPoint</a> ()</td></tr>
<tr class="memdesc:a348c31d2a43ee5f5243ecb1693a09ab5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Modify the initial point for the optimization. <a href="#a348c31d2a43ee5f5243ecb1693a09ab5">More...</a><br /></td></tr>
<tr class="separator:a348c31d2a43ee5f5243ecb1693a09ab5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab142fc11fc0baa2f9137186009ece105"><td class="memItemLeft" align="right" valign="top">const double &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#ab142fc11fc0baa2f9137186009ece105">Lambda</a> () const </td></tr>
<tr class="memdesc:ab142fc11fc0baa2f9137186009ece105"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the regularization parameter (lambda). <a href="#ab142fc11fc0baa2f9137186009ece105">More...</a><br /></td></tr>
<tr class="separator:ab142fc11fc0baa2f9137186009ece105"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac79ecd4c714030022b855822d3797e88"><td class="memItemLeft" align="right" valign="top">double &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#ac79ecd4c714030022b855822d3797e88">Lambda</a> ()</td></tr>
<tr class="memdesc:ac79ecd4c714030022b855822d3797e88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Modify the regularization parameter (lambda). <a href="#ac79ecd4c714030022b855822d3797e88">More...</a><br /></td></tr>
<tr class="separator:ac79ecd4c714030022b855822d3797e88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0d0ff92d64b228e873ff5f78cbc50c8"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#ac0d0ff92d64b228e873ff5f78cbc50c8">NumFunctions</a> () const </td></tr>
<tr class="memdesc:ac0d0ff92d64b228e873ff5f78cbc50c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of separable functions (the number of predictor points). <a href="#ac0d0ff92d64b228e873ff5f78cbc50c8">More...</a><br /></td></tr>
<tr class="separator:ac0d0ff92d64b228e873ff5f78cbc50c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab58c04750d406c3f3e3de5d8b3e65f7f"><td class="memItemLeft" align="right" valign="top">const MatType &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#ab58c04750d406c3f3e3de5d8b3e65f7f">Predictors</a> () const </td></tr>
<tr class="memdesc:ab58c04750d406c3f3e3de5d8b3e65f7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the matrix of predictors. <a href="#ab58c04750d406c3f3e3de5d8b3e65f7f">More...</a><br /></td></tr>
<tr class="separator:ab58c04750d406c3f3e3de5d8b3e65f7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0331f1eb0524c8baca3e6ce7f8af8ed0"><td class="memItemLeft" align="right" valign="top">const arma::vec &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a0331f1eb0524c8baca3e6ce7f8af8ed0">Responses</a> () const </td></tr>
<tr class="memdesc:a0331f1eb0524c8baca3e6ce7f8af8ed0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the vector of responses. <a href="#a0331f1eb0524c8baca3e6ce7f8af8ed0">More...</a><br /></td></tr>
<tr class="separator:a0331f1eb0524c8baca3e6ce7f8af8ed0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:ab436707b0b1bd1d08ad001238dbfd0bd"><td class="memItemLeft" align="right" valign="top">arma::mat&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#ab436707b0b1bd1d08ad001238dbfd0bd">initialPoint</a></td></tr>
<tr class="memdesc:ab436707b0b1bd1d08ad001238dbfd0bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">The initial point, from which to start the optimization. <a href="#ab436707b0b1bd1d08ad001238dbfd0bd">More...</a><br /></td></tr>
<tr class="separator:ab436707b0b1bd1d08ad001238dbfd0bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5058f00c39a8846b5193c5ff81f315e2"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a5058f00c39a8846b5193c5ff81f315e2">lambda</a></td></tr>
<tr class="memdesc:a5058f00c39a8846b5193c5ff81f315e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">The regularization parameter for L2-regularization. <a href="#a5058f00c39a8846b5193c5ff81f315e2">More...</a><br /></td></tr>
<tr class="separator:a5058f00c39a8846b5193c5ff81f315e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b1bd72084ee29066c58b2d8b0bf84ce"><td class="memItemLeft" align="right" valign="top">const MatType &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a0b1bd72084ee29066c58b2d8b0bf84ce">predictors</a></td></tr>
<tr class="memdesc:a0b1bd72084ee29066c58b2d8b0bf84ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">The matrix of data points (predictors). <a href="#a0b1bd72084ee29066c58b2d8b0bf84ce">More...</a><br /></td></tr>
<tr class="separator:a0b1bd72084ee29066c58b2d8b0bf84ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7f264fee499538ed85c649f0485e944"><td class="memItemLeft" align="right" valign="top">const arma::Row&lt; size_t &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#af7f264fee499538ed85c649f0485e944">responses</a></td></tr>
<tr class="memdesc:af7f264fee499538ed85c649f0485e944"><td class="mdescLeft">&#160;</td><td class="mdescRight">The vector of responses to the input data points. <a href="#af7f264fee499538ed85c649f0485e944">More...</a><br /></td></tr>
<tr class="separator:af7f264fee499538ed85c649f0485e944"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename MatType = arma::mat&gt;<br />
class mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;</h3>
<p>The log-likelihood function for the logistic regression objective function. </p>
<p>This is used by various mlpack optimizers to train a logistic regression model. </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00028">28</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a8f8a0ea4307d3f41dd4c2f864245eb12"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::<a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">LogisticRegressionFunction</a> </td>
<td>(</td>
<td class="paramtype">const MatType &amp;&#160;</td>
<td class="paramname"><em>predictors</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const arma::Row&lt; size_t &gt; &amp;&#160;</td>
<td class="paramname"><em>responses</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const double&#160;</td>
<td class="paramname"><em>lambda</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a721659982eacc9dce114278c6fdcb2a0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::<a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">LogisticRegressionFunction</a> </td>
<td>(</td>
<td class="paramtype">const MatType &amp;&#160;</td>
<td class="paramname"><em>predictors</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const arma::Row&lt; size_t &gt; &amp;&#160;</td>
<td class="paramname"><em>responses</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const arma::vec &amp;&#160;</td>
<td class="paramname"><em>initialPoint</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const double&#160;</td>
<td class="paramname"><em>lambda</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a200729c6e8d9f433f930b8880f79eef5"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="memname">
<tr>
<td class="memname">double <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::Evaluate </td>
<td>(</td>
<td class="paramtype">const arma::mat &amp;&#160;</td>
<td class="paramname"><em>parameters</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Evaluate the logistic regression log-likelihood function with the given parameters. </p>
<p>Note that if a point has 0 probability of being classified directly with the given parameters, then <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a200729c6e8d9f433f930b8880f79eef5" title="Evaluate the logistic regression log-likelihood function with the given parameters. ">Evaluate()</a> will return nan (this is kind of a corner case and should not happen for reasonable models).</p>
<p>The optimum (minimum) of this function is 0.0, and occurs when each point is classified correctly with very high probability.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">parameters</td><td>Vector of logistic regression parameters. </td></tr>
</table>
</dd>
</dl>
<p>Referenced by <a class="el" href="logistic__regression__function_8hpp_source.html#l00053">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::Responses()</a>.</p>
</div>
</div>
<a class="anchor" id="a2cdf90d1e37e0d43f175d373342cb5a1"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="memname">
<tr>
<td class="memname">double <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::Evaluate </td>
<td>(</td>
<td class="paramtype">const arma::mat &amp;&#160;</td>
<td class="paramname"><em>parameters</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>i</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Evaluate the logistic regression log-likelihood function with the given parameters, but using only one data point. </p>
<p>This is useful for optimizers such as SGD, which require a separable objective function. Note that if the point has 0 probability of being classified correctly with the given parameters, then <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a200729c6e8d9f433f930b8880f79eef5" title="Evaluate the logistic regression log-likelihood function with the given parameters. ">Evaluate()</a> will return nan (this is kind of a corner case and should not happen for reasonable models).</p>
<p>The optimum (minimum) of this function is 0.0, and occurs when the point is classified correctly with very high probability.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">parameters</td><td>Vector of logistic regression parameters. </td></tr>
<tr><td class="paramname">i</td><td>Index of point to use for objective function evaluation. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a5bd42c32840e753c1e59a9531356d710"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const arma::mat&amp; <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::GetInitialPoint </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the initial point for the optimization. </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00108">108</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>References <a class="el" href="logistic__regression__function_8hpp_source.html#l00115">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::initialPoint</a>.</p>
</div>
</div>
<a class="anchor" id="af03884eac1acde5bfcb583d61ea366a4"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::Gradient </td>
<td>(</td>
<td class="paramtype">const arma::mat &amp;&#160;</td>
<td class="paramname"><em>parameters</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">arma::mat &amp;&#160;</td>
<td class="paramname"><em>gradient</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Evaluate the gradient of the logistic regression log-likelihood function with the given parameters. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">parameters</td><td>Vector of logistic regression parameters. </td></tr>
<tr><td class="paramname">gradient</td><td>Vector to output gradient into. </td></tr>
</table>
</dd>
</dl>
<p>Referenced by <a class="el" href="logistic__regression__function_8hpp_source.html#l00053">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::Responses()</a>.</p>
</div>
</div>
<a class="anchor" id="ac061b42b43741296343c6ea2abd5b292"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::Gradient </td>
<td>(</td>
<td class="paramtype">const arma::mat &amp;&#160;</td>
<td class="paramname"><em>parameters</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">arma::mat &amp;&#160;</td>
<td class="paramname"><em>gradient</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Evaluate the gradient of the logistic regression log-likelihood function with the given parameters, and with respect to only one point in the dataset. </p>
<p>This is useful for optimizers such as SGD, which require a separable objective function.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">parameters</td><td>Vector of logistic regression parameters. </td></tr>
<tr><td class="paramname">i</td><td>Index of points to use for objective function gradient evaluation. </td></tr>
<tr><td class="paramname">gradient</td><td>Vector to output gradient into. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a71c8ab5910f1b3d9d79d2606401a73af"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const arma::mat&amp; <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::InitialPoint </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the initial point for the optimization. </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00041">41</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>References <a class="el" href="logistic__regression__function_8hpp_source.html#l00115">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::initialPoint</a>.</p>
</div>
</div>
<a class="anchor" id="a348c31d2a43ee5f5243ecb1693a09ab5"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">arma::mat&amp; <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::InitialPoint </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Modify the initial point for the optimization. </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00043">43</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>References <a class="el" href="logistic__regression__function_8hpp_source.html#l00115">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::initialPoint</a>.</p>
</div>
</div>
<a class="anchor" id="ab142fc11fc0baa2f9137186009ece105"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const double&amp; <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::Lambda </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the regularization parameter (lambda). </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00046">46</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>References <a class="el" href="logistic__regression__function_8hpp_source.html#l00121">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::lambda</a>.</p>
</div>
</div>
<a class="anchor" id="ac79ecd4c714030022b855822d3797e88"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">double&amp; <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::Lambda </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Modify the regularization parameter (lambda). </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00048">48</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>References <a class="el" href="logistic__regression__function_8hpp_source.html#l00121">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::lambda</a>.</p>
</div>
</div>
<a class="anchor" id="ac0d0ff92d64b228e873ff5f78cbc50c8"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::NumFunctions </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the number of separable functions (the number of predictor points). </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00111">111</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab58c04750d406c3f3e3de5d8b3e65f7f"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const MatType&amp; <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::Predictors </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the matrix of predictors. </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00051">51</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>References <a class="el" href="logistic__regression__function_8hpp_source.html#l00117">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::predictors</a>.</p>
</div>
</div>
<a class="anchor" id="a0331f1eb0524c8baca3e6ce7f8af8ed0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const arma::vec&amp; <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::Responses </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the vector of responses. </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00053">53</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>References <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#a200729c6e8d9f433f930b8880f79eef5">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::Evaluate()</a>, <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html#af03884eac1acde5bfcb583d61ea366a4">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::Gradient()</a>, and <a class="el" href="logistic__regression__function_8hpp_source.html#l00119">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::responses</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="ab436707b0b1bd1d08ad001238dbfd0bd"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">arma::mat <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::initialPoint</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The initial point, from which to start the optimization. </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00115">115</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>Referenced by <a class="el" href="logistic__regression__function_8hpp_source.html#l00108">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::GetInitialPoint()</a>, and <a class="el" href="logistic__regression__function_8hpp_source.html#l00041">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::InitialPoint()</a>.</p>
</div>
</div>
<a class="anchor" id="a5058f00c39a8846b5193c5ff81f315e2"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">double <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::lambda</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The regularization parameter for L2-regularization. </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00121">121</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>Referenced by <a class="el" href="logistic__regression__function_8hpp_source.html#l00046">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::Lambda()</a>.</p>
</div>
</div>
<a class="anchor" id="a0b1bd72084ee29066c58b2d8b0bf84ce"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const MatType&amp; <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::predictors</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The matrix of data points (predictors). </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00117">117</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>Referenced by <a class="el" href="logistic__regression__function_8hpp_source.html#l00051">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::Predictors()</a>.</p>
</div>
</div>
<a class="anchor" id="af7f264fee499538ed85c649f0485e944"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename MatType = arma::mat&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const arma::Row&lt;size_t&gt;&amp; <a class="el" href="classmlpack_1_1regression_1_1LogisticRegressionFunction.html">mlpack::regression::LogisticRegressionFunction</a>&lt; MatType &gt;::responses</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The vector of responses to the input data points. </p>
<p>Definition at line <a class="el" href="logistic__regression__function_8hpp_source.html#l00119">119</a> of file <a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a>.</p>
<p>Referenced by <a class="el" href="logistic__regression__function_8hpp_source.html#l00053">mlpack::regression::LogisticRegressionFunction&lt; MatType &gt;::Responses()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/mlpack/methods/logistic_regression/<a class="el" href="logistic__regression__function_8hpp_source.html">logistic_regression_function.hpp</a></li>
</ul>
</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>