change Predict to const function
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user