From be07867e46b25c3cc97b03bfaaf862d171ffd541 Mon Sep 17 00:00:00 2001 From: AYESDIE <34449856+AYESDIE@users.noreply.github.com> Date: Wed, 24 Oct 2018 13:08:20 +0530 Subject: [PATCH] Updated syntax styling (yet again...) Updated syntax styling (yet again...) --- src/mlpack/methods/cf/cf_main.cpp | 43 +++++++++++++++---------- src/mlpack/methods/cf/cf_model_impl.hpp | 6 ++-- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/mlpack/methods/cf/cf_main.cpp b/src/mlpack/methods/cf/cf_main.cpp index 6cc9eed8ac..8aba9a8673 100644 --- a/src/mlpack/methods/cf/cf_main.cpp +++ b/src/mlpack/methods/cf/cf_main.cpp @@ -135,11 +135,11 @@ PARAM_INT_IN("recommendations", "Number of recommendations to generate for each" PARAM_INT_IN("seed", "Set the random seed (0 uses std::time(NULL)).", "s", 0); // Interpolation and Neighbour Search Algorithms -PARAM_STRING_IN("interpolation", "Algorithm used for weight interpolation.", "i", - "Average"); +PARAM_STRING_IN("interpolation", "Algorithm used for weight interpolation.", + "i", "Average"); -PARAM_STRING_IN("neighbour_search", "Algorithm used for neighbour search.", "f", - "Euclidean"); +PARAM_STRING_IN("neighbour_search", "Algorithm used for neighbour search.", + "f", "Euclidean"); void ComputeRecommendations(CFModel* cf, const size_t numRecs, @@ -312,45 +312,54 @@ void ComputeRMSE(CFModel* cf) { if (iw_algo == "Average") { - cf->Predict(combinations, predictions); + cf->Predict(combinations, predictions); } else if (iw_algo == "Regression") { - cf->Predict(combinations, predictions); + cf->Predict(combinations, predictions); } else if (iw_algo == "Similarity") { - cf->Predict(combinations, predictions); + cf->Predict(combinations, predictions); } } else if (ns_algo == "Euclidean") { if (iw_algo == "Average") { - cf->Predict(combinations, predictions); + cf->Predict(combinations, predictions); } else if (iw_algo == "Regression") { - cf->Predict(combinations, predictions); + cf->Predict(combinations, predictions); } else if (iw_algo == "Similarity") { - cf->Predict(combinations, predictions); + cf->Predict(combinations, predictions); } } else if (ns_algo == "Pearson") { if (iw_algo == "Average") { - cf->Predict(combinations, predictions); + cf->Predict(combinations, predictions); } else if (iw_algo == "Regression") { - cf->Predict(combinations, predictions); + cf->Predict(combinations, predictions); } else if (iw_algo == "Similarity") { - cf->Predict(combinations, predictions); + cf->Predict(combinations, predictions); } } @@ -474,11 +483,11 @@ static void mlpackMain() "RandSVD", "BiasSVD", "SVDPP" }, true, "unknown algorithm"); // Validate the interpolation and neighbour_search policy - RequireParamInSet("interpolation", { "Average", "Regression", "Similarity" }, - true, "unknown interpolation algorithm"); + RequireParamInSet("interpolation", { "Average", + "Regression", "Similarity" }, true, "unknown interpolation algorithm"); - RequireParamInSet("neighbour_search", { "Cosine", "Euclidean", "Pearson" }, - true, "unknown neighbour search algorithm"); + RequireParamInSet("neighbour_search", { "Cosine", + "Euclidean", "Pearson" }, true, "unknown neighbour search algorithm"); ReportIgnoredParam({{ "iteration_only_termination", true }}, "min_residue"); diff --git a/src/mlpack/methods/cf/cf_model_impl.hpp b/src/mlpack/methods/cf/cf_model_impl.hpp index 530f23f14b..b503f5f868 100644 --- a/src/mlpack/methods/cf/cf_model_impl.hpp +++ b/src/mlpack/methods/cf/cf_model_impl.hpp @@ -46,7 +46,7 @@ PredictVisitor::PredictVisitor( template template -void PredictVisitor +void PredictVisitor ::operator()(CFType* c) const { if (!c) @@ -61,7 +61,7 @@ void PredictVisitor template -RecommendationVisitor +RecommendationVisitor ::RecommendationVisitor( const size_t numRecs, arma::Mat& recommendations, @@ -76,7 +76,7 @@ RecommendationVisitor template template -void RecommendationVisitor +void RecommendationVisitor ::operator()(CFType* c) const { if (!c)