CSE --- 6363 --- Machine Learning ---
Fall’23 --- SEC007
Prof. Alex Dilhoff
Stock Price Prediction using ML
Group :
Jainam Gandhi,
Akshu Patel,
Abhishek Doshi,
Yash Patel,
Karuna Dobariya
Description
▪ Machine learning, a branch of artificial intelligence, transforms financial analysis by
leveraging its ability to analyze historical data, predict patterns in stock price
movements, assist traders in making informed decisions based on data, adapt
strategies dynamically as market conditions change, and enhance predictive
accuracy through continuous refinement. The collaboration between machine
learning and financial analysis equips traders with a powerful set of tools to navigate
the complex terrain of stock markets and seize emerging opportunities.
Construction of the code :
1).Data Pre Processing
▪ We've used pandas to load and preprocess the training data.
▪ Specifically, We're only using the "Open" column of the stock price.
▪ To standardize the features, we selected the MinMaxScaler from scikit-learn, a
technique that transforms features to a scale between 0 and 1.
Fig 1. Using pandas to initialize the data
Fig 2. MinMax Scaler to scale the data
2).Building the Recursive Neural Network
▪ We've used Keras to define a simple RNN model.
▪ The architecture consists of a single LSTM layer with 4 units followed by a dense
layer.
▪ For optimization, we compiled the model using the Adam optimizer and selected
mean squared error loss, a fitting choice for regression problems.
▪ This represents a fundamental yet effective approach to implementing machine
learning in data analysis.
Fig 3.Developing the RNN
Fig 4.Importing the features from Keras
3.Building the Hyperparameter Tuner
▪ Hyperparameter tuning is an essential step in machine learning and deep learning,
aiming to find the optimal hyperparameters for a given model to improve its
performance.
▪ The code uses the Keras Tuner library to automate the process of hyperparameter
tuning for the model.
Fig 6. Hyperparamater Tuner
Fig 5. Keras Tuner
4). Training The Models
▪ We've fit the model on your training data for 200 epochs with a batch size of
32.
Fig 7. Training the Hyperparamater Tuner
5). Prediction & Visualization
▪ Using the trained model, we've made predictions on both the test data for 2017 and
the training data from 2012-2016.
▪ Following that, we depicted a visual representation of actual versus predicted prices
using the matplotlib library.
Fig 8. Prediction of both the Models Hyperparamater Tuner
6). Evaluation
▪ Ultimately, we computed the Root Mean Squared Error (RMSE) by comparing actual
and predicted prices on the test set.
Thank You
Any Questions ?

ml project ppt.pptx

  • 2.
    CSE --- 6363--- Machine Learning --- Fall’23 --- SEC007 Prof. Alex Dilhoff
  • 3.
    Stock Price Predictionusing ML Group : Jainam Gandhi, Akshu Patel, Abhishek Doshi, Yash Patel, Karuna Dobariya
  • 4.
    Description ▪ Machine learning,a branch of artificial intelligence, transforms financial analysis by leveraging its ability to analyze historical data, predict patterns in stock price movements, assist traders in making informed decisions based on data, adapt strategies dynamically as market conditions change, and enhance predictive accuracy through continuous refinement. The collaboration between machine learning and financial analysis equips traders with a powerful set of tools to navigate the complex terrain of stock markets and seize emerging opportunities.
  • 5.
  • 6.
    1).Data Pre Processing ▪We've used pandas to load and preprocess the training data. ▪ Specifically, We're only using the "Open" column of the stock price. ▪ To standardize the features, we selected the MinMaxScaler from scikit-learn, a technique that transforms features to a scale between 0 and 1. Fig 1. Using pandas to initialize the data Fig 2. MinMax Scaler to scale the data
  • 7.
    2).Building the RecursiveNeural Network ▪ We've used Keras to define a simple RNN model. ▪ The architecture consists of a single LSTM layer with 4 units followed by a dense layer. ▪ For optimization, we compiled the model using the Adam optimizer and selected mean squared error loss, a fitting choice for regression problems. ▪ This represents a fundamental yet effective approach to implementing machine learning in data analysis. Fig 3.Developing the RNN Fig 4.Importing the features from Keras
  • 8.
    3.Building the HyperparameterTuner ▪ Hyperparameter tuning is an essential step in machine learning and deep learning, aiming to find the optimal hyperparameters for a given model to improve its performance. ▪ The code uses the Keras Tuner library to automate the process of hyperparameter tuning for the model. Fig 6. Hyperparamater Tuner Fig 5. Keras Tuner
  • 9.
    4). Training TheModels ▪ We've fit the model on your training data for 200 epochs with a batch size of 32. Fig 7. Training the Hyperparamater Tuner
  • 10.
    5). Prediction &Visualization ▪ Using the trained model, we've made predictions on both the test data for 2017 and the training data from 2012-2016. ▪ Following that, we depicted a visual representation of actual versus predicted prices using the matplotlib library. Fig 8. Prediction of both the Models Hyperparamater Tuner
  • 11.
    6). Evaluation ▪ Ultimately,we computed the Root Mean Squared Error (RMSE) by comparing actual and predicted prices on the test set.
  • 12.