Implemented predict.

This commit is contained in:
Andru Liu
2024-10-08 21:02:38 -07:00
parent 88ced7a06e
commit c069343e6a
+12
View File
@@ -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;
}