change Predict to const function

This commit is contained in:
stereomatchingkiss
2015-11-11 16:28:33 +08:00
parent c1e25a37f1
commit 3d1aae40bb
2 changed files with 2 additions and 2 deletions
@@ -111,7 +111,7 @@ class SoftmaxRegression
* @param testData Matrix of data points for which predictions are to be made.
* @param predictions Vector to store the predictions in.
*/
void Predict(const arma::mat& testData, arma::vec& predictions);
void Predict(const arma::mat& testData, arma::vec& predictions) const;
/**
* Computes accuracy of the learned model given the feature data and the
@@ -58,7 +58,7 @@ SoftmaxRegression<OptimizerType>::SoftmaxRegression(
template<template<typename> class OptimizerType>
void SoftmaxRegression<OptimizerType>::Predict(const arma::mat& testData,
arma::vec& predictions)
arma::vec& predictions) const
{
// Calculate the probabilities for each test input.
arma::mat hypothesis, probabilities;