Skip to content

Commit e25e4e2

Browse files
committed
Change arma::mean to mean in core/
Signed-off-by: Omar Shrit <[email protected]>
1 parent 32d9a7f commit e25e4e2

File tree

14 files changed

+16
-16
lines changed

14 files changed

+16
-16
lines changed

src/mlpack/core/cv/k_fold_cv_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ double KFoldCV<MLAlgorithm,
270270
return 0.0;
271271
}
272272

273-
return arma::mean(evaluations.elem(arma::find_finite(evaluations)));
273+
return mean(evaluations.elem(arma::find_finite(evaluations)));
274274
}
275275

276276
template<typename MLAlgorithm,
@@ -300,7 +300,7 @@ double KFoldCV<MLAlgorithm,
300300
modelPtr.reset(new MLAlgorithm(std::move(model)));
301301
}
302302

303-
return arma::mean(evaluations);
303+
return mean(evaluations);
304304
}
305305

306306
template<typename MLAlgorithm,

src/mlpack/core/cv/metrics/f1_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ double F1<AS, PC>::Evaluate(MLAlgorithm& model,
8888
2.0 * precision * recall / (precision + recall);
8989
}
9090

91-
return arma::mean(f1s);
91+
return mean(f1s);
9292
}
9393

9494
} // namespace mlpack

src/mlpack/core/cv/metrics/precision_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ double Precision<AS, PC>::Evaluate(MLAlgorithm& model,
7777
precisions(c) = double(tp) / numberOfPositivePredictions;
7878
}
7979

80-
return arma::mean(precisions);
80+
return mean(precisions);
8181
}
8282

8383
} // namespace mlpack

src/mlpack/core/cv/metrics/r2_score_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ double R2Score<AdjustedR2>::Evaluate(MLAlgorithm& model,
2727
// Taking Predicted Output from the model.
2828
model.Predict(data, predictedResponses);
2929
// Mean value of response.
30-
double meanResponses = arma::mean(responses);
30+
double meanResponses = mean(responses);
3131

3232
// Calculate the numerator i.e. residual sum of squares.
3333
double residualSumSquared = arma::accu(arma::square(responses -

src/mlpack/core/cv/metrics/recall_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ double Recall<AS, PC>::Evaluate(MLAlgorithm& model,
7777
recalls(c) = double(tp) / positiveLabels;
7878
}
7979

80-
return arma::mean(recalls);
80+
return mean(recalls);
8181
}
8282

8383
} // namespace mlpack

src/mlpack/core/cv/metrics/silhouette_score_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ double SilhouetteScore::Overall(const DataType& X,
2222
const Metric& metric)
2323
{
2424
util::CheckSameSizes(X, labels, "SilhouetteScore::Overall()");
25-
return arma::mean(SamplesScore(X, labels, metric));
25+
return mean(SamplesScore(X, labels, metric));
2626
}
2727

2828
template<typename DataType>

src/mlpack/core/data/scaler_methods/mean_normalization.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class MeanNormalization
5454
template<typename MatType>
5555
void Fit(const MatType& input)
5656
{
57-
itemMean = arma::mean(input, 1);
57+
itemMean = mean(input, 1);
5858
itemMin = arma::min(input, 1);
5959
itemMax = arma::max(input, 1);
6060
scale = itemMax - itemMin;

src/mlpack/core/data/scaler_methods/pca_whitening.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class PCAWhitening
7070
template<typename MatType>
7171
void Fit(const MatType& input)
7272
{
73-
itemMean = arma::mean(input, 1);
73+
itemMean = mean(input, 1);
7474
// Get eigenvectors and eigenvalues of covariance of input matrix.
7575
eig_sym(eigenValues, eigenVectors, ColumnCovariance(
7676
input.each_col() - itemMean));

src/mlpack/core/data/scaler_methods/standard_scaler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class StandardScaler
5555
template<typename MatType>
5656
void Fit(const MatType& input)
5757
{
58-
itemMean = arma::mean(input, 1);
58+
itemMean = mean(input, 1);
5959
itemStdDev = arma::stddev(input, 1, 1);
6060
// Handle zeros in scale vector.
6161
itemStdDev.for_each([](arma::vec::elem_type& val) { val =

src/mlpack/core/dists/gamma_distribution_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ inline void GammaDistribution::Train(const arma::mat& rdata, const double tol)
5656
return;
5757

5858
// Calculate log(mean(x)) and mean(log(x)) of each dataset row.
59-
const arma::vec meanLogxVec = arma::mean(arma::log(rdata), 1);
60-
const arma::vec meanxVec = arma::mean(rdata, 1);
59+
const arma::vec meanLogxVec = mean(arma::log(rdata), 1);
60+
const arma::vec meanxVec = mean(rdata, 1);
6161
const arma::vec logMeanxVec = arma::log(meanxVec);
6262

6363
// Call the statistics-only GammaDistribution::Train() function to fit the

0 commit comments

Comments
 (0)