How sayandeep02/state-of-charge-soc-estimation-using-machine-learning works
Main Components
• Data Sources and Ingestion:
• The “data” folder includes CSV files divided into training, validation, and testing sets.
• The dataset is prepared through the “dataset.py” module.
• Data Preprocessing and Utilities:
• The code in “custom.py”, “libraries.py”, and “utils.py” handles preprocessing, feature normalization/standardization, and other utility functions.
• Model Definitions and Storage:
• The “models” directory contains pre-trained models saved as .sav (for scikit-learn based models) and .keras (for the neural network).
• The machine learning pipelines, including training configuration and model evaluations, are mainly referenced from the “soc_estimation.ipynb” notebook.
• Visualization and Analysis:
• Experimentation/Execution:
• The main flow of experiments and SOC estimation is demonstrated in the notebook (“soc_estimation.ipynb”) and supported by associated scripts.
Relationships and Interactions
• Data Flow:
• Raw CSV data from the “data” directory is ingested, preprocessed (e.g., normalization, handling of outliers and missing values) and then fed into various model training modules.
• Model Training Flow:
• Preprocessed data passes to each modeling component (Linear Regression, Decision Tree, KNN, MLP-FNN).
• Each model might use its own defined parameters and algorithms, possibly referencing external libraries such as scikit-learn and TensorFlow (for the neural network).
• Model Evaluation and Metrics:
• There’s a clear flow from training to evaluation. After model training, predictions are compared to actual values, and metrics (MSE, MAE, etc.) are computed (as seen in the multiple graphs and images).
• Visualization:
• The outputs (e.g., observed vs predicted plots and SHAP visualization) reflect the system’s evaluation stage.
• Persistence:
• Trained models are saved in the “models” folder for future inference or analysis.
Incorporate Important Architectural Patterns and Technologies
• Data Layer: Includes data ingestion and preprocessing (modules like “dataset.py” and “utils.py”) on top of raw CSVs.
• Processing Layer: Implements various supervised learning algorithms using standard ML libraries (scikit-learn for regression and decision trees; TensorFlow/Keras for the neural network).
• Visualization & Analysis Layer: Uses plotting libraries (Plotly, Matplotlib, Seaborn) to display distributions, performance metrics, and model explainability (SHAP).
• Modularity: The project splits functions into logically separated modules (for data handling, modeling, and utility functions), ensuring ease of maintenance and experimentation.
• External Dependencies: Leverages popular Python libraries such as NumPy, Pandas, TensorFlow, scikit-learn, and visualization libraries.
Elements
• “Preprocessing & Feature Engineering” (supported by “custom.py”, “utils.py”, “dataset.py”)
• “Machine Learning Models” with sub-components:
• “Linear Regression Model”
• “Decision Tree Regression”
• “K-Nearest Neighbors Regression”
• “MLP-FNN (Neural Network)” – include activation functions and optimizer details as noted in the README.
• “Model Evaluation & Metrics” (including performance graphs and metrics)
• “Explainable AI (SHAP Analysis)”
• From raw data to preprocessing, then to modeling, and finally to evaluation and visualization.