How mohamedadhil10/faang-predict-stock-prices works
Project Type & Purpose
• This is a data science/machine learning application with a web-based UI deployed via Streamlit.
• Its primary purpose is to predict the closing stock prices of FAANG stocks using a RandomForestRegressor model, while also integrating MLflow for experiment tracking and model logging.
File Structure
• The project contains only a few files: a dataset (FAANG.csv), the main app (FAANG.py), a requirements.txt file listing dependencies, and a README file.
• All functionality is integrated in a single Python file (FAANG.py), which serves both the ML pipeline and web app interface. This indicates a streamlined architecture rather than a segregated frontend/backend system.
• Configuration/deployment related aspects are handled externally (e.g., via requirements.txt for dependencies).
Key Components and Their Relationships
a. Data Input & Preprocessing:
• FAANG.csv serves as the dataset.
• Data cleaning, handling missing values, removing outliers, and feature standardization are performed as a preprocessing step.
b. Exploratory Data Analysis (EDA):
c. ML Model Training & Evaluation:
• A RandomForestRegressor is trained on historical data.
• The training process includes hyperparameter tuning using both randomized search and grid search techniques.
• Performance metrics (MAE, RMSE, R² Score) are calculated to evaluate the model.
d. Experiment Tracking with MLflow:
• MLflow is integrated to log experiments, track hyperparameters, and save the best performing model.
e. Streamlit-based Deployment:
• FAANG.py is a Streamlit application that provides a simple UI where users input stock features (Open, High, Low, Volume) and receive predictions for the closing price.
• This component ties together the preprocessing, model prediction, and user interaction.