Backround:
I work on a project regarding a mulit-class classification problem using scikit-learn. My dataset contains 112 feature vectors for each of the 40 measured objects (MO). In total 4480 feature vectors, equally divided in 4 classes, and 533 features. (More information on the data set here)
Approach:
After splitting the dataset (train:34 MO, test:6 MO) and reducing the number of features, mostly through PCA, I tuned the hyperparameters with gridsearchcv using KFold for different models to make a comparison.
Questions:
The comment by @4.Pi.n solved my problem:
- It's exactly as your professor says,
- The most common way is to storing k-models, then averaging there predictions, ex.
y_pred = (pred_1 + pred_2 + ... + pred_k) / k
, or you might use sklearn.model_selection.cross_val_predict