Skip to main content
. 2023 Aug 25;13(17):2754. doi: 10.3390/diagnostics13172754
Algorithm 2: Support Vector Machine (SVM) algorithm pseudocode
Input:
- Training data: X_train, y_train
- Testing data: X_test
- Kernel function: K
- Regularization parameter: C
- Class weighting: w
Output: Predicted macrosomia risk for each test
Train SVM:
         Compute K_train and W_train
         Solve optimization problem to obtain α and b
Predict macrosomia risk:
         Compute K_test
         Compute predicted risk using α, b, and K_test
Return predicted risk for each test