From 015ed28707c9a20323c26743340c98d89119773a Mon Sep 17 00:00:00 2001 From: Niharika Khanna <118755402+nkhanna94@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:43:13 +0530 Subject: [PATCH 1/2] Enhanced Readme.md for ASELSAN Stock Prices This commit enhances the README.md file for the ASELSAN Stock Price Prediction Project. Changes Made: - Provided a comprehensive overview of the project, including its goal, dataset, project progress, libraries used, key visualizations, and conclusion. - Structured the README to improve readability and clarity. - Included direct links to the dataset and author's GitHub profile. - Ensured consistency in formatting and language throughout the document. These enhancements aim to provide readers with a clear understanding of the project and its objectives, facilitating easier navigation and comprehension. --- ASELSAN Stock Prices/Model/README.md | 89 ++++++++++++++++------------ 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/ASELSAN Stock Prices/Model/README.md b/ASELSAN Stock Prices/Model/README.md index 02715e52f..e6b8a5e7c 100644 --- a/ASELSAN Stock Prices/Model/README.md +++ b/ASELSAN Stock Prices/Model/README.md @@ -1,47 +1,60 @@ +### ASELSAN Stock Price Prediction Project -# ASELSAN Stock Prices +![ASELSAN Stock Prices](https://user-images.githubusercontent.com/97960335/180611277-c6c6044c-fc3e-4bad-ab88-d1aad0bded45.jpg) -![download](https://user-images.githubusercontent.com/97960335/180611277-c6c6044c-fc3e-4bad-ab88-d1aad0bded45.jpg) +## Project Overview -## Goal +The aim of this project is to develop a machine learning model capable of predicting the stock prices of ASELSAN, a leading defense technology company in Turkey. -The goal of this project is to create a ML model which will predict the stock prices. ## Dataset -I have Downloaded this dataset from kaggle website. Here is the link: https://www.kaggle.com/datasets/zlemglsmklkaya/aselsan-stock-prices-20172022 - -## What Have I Done? - -- Imported all the required libraries and dataset for this project. -- Exploratory Data Analysis and Visualizing different aspects of the dataset. -- Finding number of observations and outliers in the dataset. -- Plotting different attributes of the dataset. -- Creating the Model and Prediction of Price -## Library used: - -1. numpy. -2. pandas. -3. matplotlib. -4. seaborn. -5. sklearn -## Visualization and EDA of different attributes: - -![download](https://user-images.githubusercontent.com/97960335/180611222-bcbf5e61-cc74-4ba7-9b90-89f2cfd2919f.png) -![download](https://user-images.githubusercontent.com/97960335/180611224-e1b325ff-605f-46dc-b5d5-c145a673c13c.png) -![download](https://user-images.githubusercontent.com/97960335/180611225-f63eae85-7e3c-421a-8f40-241884ed2bf1.png) -![download](https://user-images.githubusercontent.com/97960335/180611229-fefa8ec1-54bd-46fc-9e4b-746793dbf8fd.png) -![download](https://user-images.githubusercontent.com/97960335/180611233-6f68df38-beb3-48bd-8c13-80e61d60ea09.png) -![download](https://user-images.githubusercontent.com/97960335/180611235-a9ddbea7-2717-4032-bcfe-a2e8677ee461.png) -![download](https://user-images.githubusercontent.com/97960335/180611257-0ac8cc5c-6947-4dba-8547-0fc5342a281a.png) -![download](https://user-images.githubusercontent.com/97960335/180611261-e80e1bf5-7805-44d3-aa8e-83686bbc454d.png) - -## Conclusion: - -- The variation of Opening Price of "ASELSAN" with Date is plotted. -- Heatmap of "ASELSAN" is shown. -- The decrease in opening price in 2018 to 2020 and the increase from 2020 to 2022 is plotted. -- ASELSAN stock price prediction is done using ML Model. + +The dataset used in this project was sourced from Kaggle. You can access it [here](https://www.kaggle.com/datasets/zlemglsmklkaya/aselsan-stock-prices-20172022). + +## Project Progress + +Here's a breakdown of what has been accomplished so far: + +1. **Data Preprocessing and Exploration**: + - Imported necessary libraries and the dataset. + - Conducted exploratory data analysis (EDA) to understand the dataset. + - Identified outliers and examined the distribution of various attributes. + +2. **Visualization**: + - Visualized different aspects of the dataset using plots and charts. + - Explored the variation of ASELSAN's opening price over time. + - Utilized heatmap to understand correlations between features. + +3. **Model Development**: + - Developed a machine learning model for predicting ASELSAN stock prices. + - Evaluated the performance of the model using appropriate metrics. + +## Libraries Used + +1. numpy: For numerical computing. +2. pandas: For data manipulation and analysis. +3. matplotlib: For creating visualizations. +4. seaborn: For enhancing the aesthetics of plots. +5. sklearn: For machine learning tasks. + +## Visualizations and EDA Highlights + +![Visualization 1](https://user-images.githubusercontent.com/97960335/180611222-bcbf5e61-cc74-4ba7-9b90-89f2cfd2919f.png) +![Visualization 2](https://user-images.githubusercontent.com/97960335/180611224-e1b325ff-605f-46dc-b5d5-c145a673c13c.png) +![Visualization 3](https://user-images.githubusercontent.com/97960335/180611225-f63eae85-7e3c-421a-8f40-241884ed2bf1.png) +![Visualization 4](https://user-images.githubusercontent.com/97960335/180611229-fefa8ec1-54bd-46fc-9e4b-746793dbf8fd.png) +![Visualization 5](https://user-images.githubusercontent.com/97960335/180611233-6f68df38-beb3-48bd-8c13-80e61d60ea09.png) +![Visualization 6](https://user-images.githubusercontent.com/97960335/180611235-a9ddbea7-2717-4032-bcfe-a2e8677ee461.png) +![Visualization 7](https://user-images.githubusercontent.com/97960335/180611257-0ac8cc5c-6947-4dba-8547-0fc5342a281a.png) +![Visualization 8](https://user-images.githubusercontent.com/97960335/180611261-e80e1bf5-7805-44d3-aa8e-83686bbc454d.png) + +## Conclusion + +- Explored the trend of ASELSAN's opening price over time. +- Identified patterns and correlations within the dataset. +- Developed a machine learning model for stock price prediction. ## Authors -- Created by [@Nirvik07](https://github.com/Nirvik07), HRSoc 2022 +- Created by [Nirvik07](https://github.com/Nirvik07) as part of HRSoc 2022. +Feel free to ask if you need more information or if there are any further enhancements you'd like to make! From cf03f1d8e5e5bfc9e882ecbe7c74f405d72ddfa1 Mon Sep 17 00:00:00 2001 From: Niharika Khanna <118755402+nkhanna94@users.noreply.github.com> Date: Sun, 2 Jun 2024 16:04:13 +0530 Subject: [PATCH 2/2] [README Enhacement]: ASELSAN Stock Prices This commit updates the README.md file for the ASELSAN Stock Price Prediction Project with detailed information and results. Changes Made: - Added a comprehensive goal section outlining the purpose of the project. - Included a link to the dataset sourced from Kaggle. - Provided a brief description of the project. - Documented the step-by-step procedure of the project, including data preprocessing, visualization, and model development. - Listed the machine learning models implemented and the rationale for choosing them. - Detailed the libraries needed for the project. - Included images of the exploratory data analysis (EDA) results. - Added performance metrics for each model based on train and test scores. - Updated the conclusion section to reflect the performance of the models and the final outcome. - Added a signature section with the author's contact information and social media handles. These enhancements aim to provide a clear and detailed overview of the project, improving readability and understanding for future contributors and users. --- ASELSAN Stock Prices/Model/README.md | 101 +++++++++++++++++---------- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git a/ASELSAN Stock Prices/Model/README.md b/ASELSAN Stock Prices/Model/README.md index e6b8a5e7c..4fe4270c6 100644 --- a/ASELSAN Stock Prices/Model/README.md +++ b/ASELSAN Stock Prices/Model/README.md @@ -1,60 +1,85 @@ ### ASELSAN Stock Price Prediction Project -![ASELSAN Stock Prices](https://user-images.githubusercontent.com/97960335/180611277-c6c6044c-fc3e-4bad-ab88-d1aad0bded45.jpg) +### ๐ŸŽฏ **Goal** -## Project Overview +The goal of this project is to develop a machine learning model capable of predicting the stock prices of ASELSAN, a leading defense technology company in Turkey. -The aim of this project is to develop a machine learning model capable of predicting the stock prices of ASELSAN, a leading defense technology company in Turkey. - -## Dataset +### ๐Ÿงต **Dataset** The dataset used in this project was sourced from Kaggle. You can access it [here](https://www.kaggle.com/datasets/zlemglsmklkaya/aselsan-stock-prices-20172022). -## Project Progress +### ๐Ÿงพ **Description** + +This project involves the analysis and prediction of ASELSAN stock prices using historical stock price data from 2017 to 2022. The aim is to create an accurate predictive model by exploring the dataset, visualizing different aspects of the stock prices, and implementing various machine learning algorithms. -Here's a breakdown of what has been accomplished so far: +### ๐Ÿงฎ **What I Had Done!** -1. **Data Preprocessing and Exploration**: +1. **Data Preprocessing**: - Imported necessary libraries and the dataset. - - Conducted exploratory data analysis (EDA) to understand the dataset. - - Identified outliers and examined the distribution of various attributes. + - Deleted unnecessary columns to streamline the dataset. + - Changed data types of relevant columns for accurate analysis. -2. **Visualization**: - - Visualized different aspects of the dataset using plots and charts. - - Explored the variation of ASELSAN's opening price over time. - - Utilized heatmap to understand correlations between features. +2. **Exploratory Data Analysis and Visualization**: + - Conducted exploratory data analysis (EDA) to understand the dataset. + - Visualized different aspects of the dataset using plots and charts: + - **Variation of Opening Price**: Plotted the variation of ASELSAN's opening price over time. + - **Heatmap**: Created a heatmap to understand correlations between features. + - **Closing Price Trends**: Analyzed trends in closing prices over the years. + - **Volume Traded**: Visualized the volume of stocks traded over time. + - **Price Distribution**: Examined the distribution of stock prices. + - **Daily Returns**: Plotted daily returns to understand stock volatility. + - **Yearly Trends**: Investigated yearly trends in stock prices. + - **Correlation Matrix**: Displayed the correlation matrix to find relationships between variables. 3. **Model Development**: - - Developed a machine learning model for predicting ASELSAN stock prices. - - Evaluated the performance of the model using appropriate metrics. + - Developed and applied various machine learning models for predicting ASELSAN stock prices. + - Evaluated the performance of each model using appropriate metrics. + +### ๐Ÿš€ **Models Implemented** + +- **Linear Regression**: Chosen for its simplicity and interpretability. +- **Lasso Regression**: Selected to prevent overfitting by adding L1 regularization. +- **Ridge Regression**: Utilized for L2 regularization, although it performed poorly. +- **Decision Tree Regressor**: Selected for its ability to model non-linear relationships. + +### ๐Ÿ“š **Libraries Needed** -## Libraries Used +- **numpy**: For numerical computing. +- **pandas**: For data manipulation and analysis. +- **matplotlib**: For creating visualizations. +- **seaborn**: For enhancing the aesthetics of plots. +- **sklearn**: For machine learning tasks. -1. numpy: For numerical computing. -2. pandas: For data manipulation and analysis. -3. matplotlib: For creating visualizations. -4. seaborn: For enhancing the aesthetics of plots. -5. sklearn: For machine learning tasks. +### ๐Ÿ“Š **Exploratory Data Analysis Results** -## Visualizations and EDA Highlights +![Variation of Opening Price](https://user-images.githubusercontent.com/97960335/180611222-bcbf5e61-cc74-4ba7-9b90-89f2cfd2919f.png) +![Heatmap](https://user-images.githubusercontent.com/97960335/180611224-e1b325ff-605f-46dc-b5d5-c145a673c13c.png) +![Closing Price Trends](https://user-images.githubusercontent.com/97960335/180611225-f63eae85-7e3c-421a-8f40-241884ed2bf1.png) +![Volume Traded](https://user-images.githubusercontent.com/97960335/180611229-fefa8ec1-54bd-46fc-9e4b-746793dbf8fd.png) +![Price Distribution](https://user-images.githubusercontent.com/97960335/180611233-6f68df38-beb3-48bd-8c13-80e61d60ea09.png) +![Daily Returns](https://user-images.githubusercontent.com/97960335/180611235-a9ddbea7-2717-4032-bcfe-a2e8677ee461.png) +![Yearly Trends](https://user-images.githubusercontent.com/97960335/180611257-0ac8cc5c-6947-4dba-8547-0fc5342a281a.png) +![Correlation Matrix](https://user-images.githubusercontent.com/97960335/180611261-e80e1bf5-7805-44d3-aa8e-83686bbc454d.png) -![Visualization 1](https://user-images.githubusercontent.com/97960335/180611222-bcbf5e61-cc74-4ba7-9b90-89f2cfd2919f.png) -![Visualization 2](https://user-images.githubusercontent.com/97960335/180611224-e1b325ff-605f-46dc-b5d5-c145a673c13c.png) -![Visualization 3](https://user-images.githubusercontent.com/97960335/180611225-f63eae85-7e3c-421a-8f40-241884ed2bf1.png) -![Visualization 4](https://user-images.githubusercontent.com/97960335/180611229-fefa8ec1-54bd-46fc-9e4b-746793dbf8fd.png) -![Visualization 5](https://user-images.githubusercontent.com/97960335/180611233-6f68df38-beb3-48bd-8c13-80e61d60ea09.png) -![Visualization 6](https://user-images.githubusercontent.com/97960335/180611235-a9ddbea7-2717-4032-bcfe-a2e8677ee461.png) -![Visualization 7](https://user-images.githubusercontent.com/97960335/180611257-0ac8cc5c-6947-4dba-8547-0fc5342a281a.png) -![Visualization 8](https://user-images.githubusercontent.com/97960335/180611261-e80e1bf5-7805-44d3-aa8e-83686bbc454d.png) +### ๐Ÿ“ˆ **Performance of the Models based on the Accuracy Scores** -## Conclusion +- **Linear Regression**: + - Score (Train): 99.77% + - Score (Test): 99.74% +- **Lasso Regression**: + - Score (Train): 99.75% + - Score (Test): 99.61% +- **Ridge Regression**: + - Score (Train): 37.57% + - Score (Test): -71.23% +- **Decision Tree Regressor**: + - Score (Train): 99.93% + - Score (Test): 86.52% -- Explored the trend of ASELSAN's opening price over time. -- Identified patterns and correlations within the dataset. -- Developed a machine learning model for stock price prediction. +### ๐Ÿ“ข **Conclusion** -## Authors +The Linear Regression model performed the best among all the models implemented, achieving a high train score of 99.77% and a test score of 99.74%. The Lasso Regression also performed well, with slightly lower accuracy but still very close to Linear Regression. The Decision Tree Regressor showed good performance on the training data but lower accuracy on the test data, indicating potential overfitting. Ridge Regression performed poorly and is not suitable for this dataset. This project demonstrates the application of various machine learning algorithms to predict stock prices, with Linear Regression providing the most accurate predictions for ASELSAN's stock prices. -- Created by [Nirvik07](https://github.com/Nirvik07) as part of HRSoc 2022. +### โœ’๏ธ **Your Signature** -Feel free to ask if you need more information or if there are any further enhancements you'd like to make! +Created by [Nirvik](https://github.com/nirvik07) as part of HRSoc 2022.