poly method
Implementation
List<double> poly(List<double> X) {
List<double> kernels = List.generate(
supportVectors.length,
((index) => index.toDouble()),
);
for (int i = 0; i < supportVectors.length; i++) {
double kernel = 0.0;
for (int j = 0; j < supportVectors[i].length; j++) {
kernel += supportVectors[i][j] * X[j];
}
kernels[i] =
pow((this.gamma * kernel) + this.coef0, this.degree).toDouble();
}
return kernels;
}