Preprocessing Pipeline
A clear view of the server-side pipeline used before model training.
Pipeline Flow
Load dataset
The Python backend reads data/ev_battery_degradation_v1.csv from the server filesystem.
Check missing values
Missing values are counted and numeric/categorical imputers are configured for robust model input.
Check duplicates
Duplicate rows are counted to explain dataset quality before modeling.
Exclude identifier and leakage columns
Vehicle_ID and Battery_Status are removed by default.
Separate target variable
SoH_Percent is separated from input features as the regression target.
Encode categorical variables
Car_Model, Battery_Type, and Driving_Style are transformed with one-hot encoding.
Split train/test
The default split is 80% training and 20% testing with random_state 42.
Train and evaluate models
Random Forest and XGBoost are trained on the server and evaluated with MAE, RMSE, and R².
Concept Explanations
Preprocessing
Preprocessing converts raw dataset columns into a reliable matrix that machine learning models can use.
One-hot encoding
One-hot encoding turns categories into numeric indicator columns, such as Battery_Type_LFP and Battery_Type_NMC.
Train/test split
The model learns from training data and is evaluated on test data it did not see during training.
Data leakage
Data leakage happens when a model receives information that would not be available during a real prediction.