diff --git a/CPP_Implementation/rbf_model.cpp b/CPP_Implementation/rbf_model.cpp index 9af2bad..123ab0d 100644 --- a/CPP_Implementation/rbf_model.cpp +++ b/CPP_Implementation/rbf_model.cpp @@ -51,3 +51,15 @@ double RBFModel::gaussian(const double* input, const double* center) { } return exp(-0.5 * norm / (sigma * sigma)); } + +/** + * @brief Predict the RBF output for a given input. + */ +double RBFModel::predict(const double* input) { + double output = 0.0; + for (int i = 0; i < numCenters; ++i) { + output += weights[i] * gaussian(input, centers[i]); + } + return output; +} +