Menu

KNN Model Training and Evaluation Metrics Explained

Model Training

After preprocessing and feature engineering, the KNN Regression model is trained using the training dataset.

During training, the model learns the relationship between the engineered features and the stock’s closing price.

The trained model can then estimate future closing prices for new market observations.

Model Evaluation Metrics

Regression models are evaluated differently from classification models.

Several performance metrics are used to measure prediction quality.

Mean Absolute Error (MAE)

Measures the average absolute difference between predicted and actual prices.

Lower MAE indicates better prediction accuracy.

Mean Squared Error (MSE)

Measures the average squared prediction error.

Large prediction errors receive greater penalties.

Lower MSE indicates better model performance.

Root Mean Squared Error (RMSE)

RMSE is the square root of the Mean Squared Error.

It measures prediction error in the same units as stock prices, making it easier to interpret.

Lower RMSE indicates more accurate predictions.

R² Score

The R² Score measures how well the regression model explains variations in stock prices.

An R² Score closer to 1 indicates a stronger predictive model.