diff --git a/Stock_Price_Prediction(Updated).ipynb b/Stock_Price_Prediction(Updated).ipynb index 540eace..93a2869 100644 --- a/Stock_Price_Prediction(Updated).ipynb +++ b/Stock_Price_Prediction(Updated).ipynb @@ -1,4844 +1,4844 @@ { - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "id": "8tzEK_mSvRoh" - }, - "outputs": [], - "source": [ - "import pandas as pd\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "from sklearn.model_selection import train_test_split\n", - "from sklearn.impute import SimpleImputer\n", - "from sklearn.preprocessing import MinMaxScaler\n", - "from sklearn.linear_model import LinearRegression\n", - "from sklearn.svm import SVR\n", - "from sklearn.tree import DecisionTreeRegressor\n", - "from sklearn.ensemble import RandomForestRegressor, AdaBoostRegressor, GradientBoostingRegressor\n", - "from sklearn.metrics import mean_squared_error, mean_absolute_error, mean_absolute_percentage_error\n", - "from sklearn.neighbors import KNeighborsRegressor\n", - "from tensorflow.keras.models import Sequential\n", - "from tensorflow.keras.layers import Dense,LSTM" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 206 - }, - "id": "NbBSc2jLvZWx", - "outputId": "457e0a63-90a0-4e1c-b846-95e4e50c31dc" - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - " | Date | \n", - "Open | \n", - "High | \n", - "Low | \n", - "Close | \n", - "Adj Close | \n", - "Volume | \n", - "
---|---|---|---|---|---|---|---|
0 | \n", - "01-01-1996 | \n", - "18.691147 | \n", - "18.978922 | \n", - "18.540184 | \n", - "18.823240 | \n", - "12.409931 | \n", - "43733533.0 | \n", - "
1 | \n", - "02-01-1996 | \n", - "18.894005 | \n", - "18.964767 | \n", - "17.738192 | \n", - "18.224106 | \n", - "12.014931 | \n", - "56167280.0 | \n", - "
2 | \n", - "03-01-1996 | \n", - "18.327892 | \n", - "18.568489 | \n", - "17.643839 | \n", - "17.738192 | \n", - "11.694577 | \n", - "68296318.0 | \n", - "
3 | \n", - "04-01-1996 | \n", - "17.502312 | \n", - "17.832542 | \n", - "17.223972 | \n", - "17.676863 | \n", - "11.654142 | \n", - "86073880.0 | \n", - "
4 | \n", - "05-01-1996 | \n", - "17.738192 | \n", - "17.785366 | \n", - "17.459852 | \n", - "17.577793 | \n", - "11.588827 | \n", - "76613039.0 | \n", - "
\n", - " | Open | \n", - "High | \n", - "Low | \n", - "Close | \n", - "Volume | \n", - "
---|---|---|---|---|---|
0 | \n", - "18.691147 | \n", - "18.978922 | \n", - "18.540184 | \n", - "18.823240 | \n", - "43733533.0 | \n", - "
1 | \n", - "18.894005 | \n", - "18.964767 | \n", - "17.738192 | \n", - "18.224106 | \n", - "56167280.0 | \n", - "
2 | \n", - "18.327892 | \n", - "18.568489 | \n", - "17.643839 | \n", - "17.738192 | \n", - "68296318.0 | \n", - "
3 | \n", - "17.502312 | \n", - "17.832542 | \n", - "17.223972 | \n", - "17.676863 | \n", - "86073880.0 | \n", - "
4 | \n", - "17.738192 | \n", - "17.785366 | \n", - "17.459852 | \n", - "17.577793 | \n", - "76613039.0 | \n", - "
LinearRegression()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
LinearRegression()
SVR()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
SVR()
\n", + " | Date | \n", + "Open | \n", + "High | \n", + "Low | \n", + "Close | \n", + "Adj Close | \n", + "Volume | \n", + "
---|---|---|---|---|---|---|---|
0 | \n", + "01-01-1996 | \n", + "18.691147 | \n", + "18.978922 | \n", + "18.540184 | \n", + "18.823240 | \n", + "12.409931 | \n", + "43733533.0 | \n", + "
1 | \n", + "02-01-1996 | \n", + "18.894005 | \n", + "18.964767 | \n", + "17.738192 | \n", + "18.224106 | \n", + "12.014931 | \n", + "56167280.0 | \n", + "
2 | \n", + "03-01-1996 | \n", + "18.327892 | \n", + "18.568489 | \n", + "17.643839 | \n", + "17.738192 | \n", + "11.694577 | \n", + "68296318.0 | \n", + "
3 | \n", + "04-01-1996 | \n", + "17.502312 | \n", + "17.832542 | \n", + "17.223972 | \n", + "17.676863 | \n", + "11.654142 | \n", + "86073880.0 | \n", + "
4 | \n", + "05-01-1996 | \n", + "17.738192 | \n", + "17.785366 | \n", + "17.459852 | \n", + "17.577793 | \n", + "11.588827 | \n", + "76613039.0 | \n", + "
\n", + " | Open | \n", + "High | \n", + "Low | \n", + "Close | \n", + "Volume | \n", + "
---|---|---|---|---|---|
0 | \n", + "18.691147 | \n", + "18.978922 | \n", + "18.540184 | \n", + "18.823240 | \n", + "43733533.0 | \n", + "
1 | \n", + "18.894005 | \n", + "18.964767 | \n", + "17.738192 | \n", + "18.224106 | \n", + "56167280.0 | \n", + "
2 | \n", + "18.327892 | \n", + "18.568489 | \n", + "17.643839 | \n", + "17.738192 | \n", + "68296318.0 | \n", + "
3 | \n", + "17.502312 | \n", + "17.832542 | \n", + "17.223972 | \n", + "17.676863 | \n", + "86073880.0 | \n", + "
4 | \n", + "17.738192 | \n", + "17.785366 | \n", + "17.459852 | \n", + "17.577793 | \n", + "76613039.0 | \n", + "
RandomForestRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
RandomForestRegressor()
LinearRegression()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
LinearRegression()
GradientBoostingRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
GradientBoostingRegressor()
SVR()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
SVR()
XGBRegressor(base_score=None, booster=None, callbacks=None,\n", - " colsample_bylevel=None, colsample_bynode=None,\n", - " colsample_bytree=None, device=None, early_stopping_rounds=None,\n", - " enable_categorical=False, eval_metric=None, feature_types=None,\n", - " gamma=None, grow_policy=None, importance_type=None,\n", - " interaction_constraints=None, learning_rate=None, max_bin=None,\n", - " max_cat_threshold=None, max_cat_to_onehot=None,\n", - " max_delta_step=None, max_depth=None, max_leaves=None,\n", - " min_child_weight=None, missing=nan, monotone_constraints=None,\n", - " multi_strategy=None, n_estimators=None, n_jobs=None,\n", - " num_parallel_tree=None, random_state=None, ...)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
XGBRegressor(base_score=None, booster=None, callbacks=None,\n", - " colsample_bylevel=None, colsample_bynode=None,\n", - " colsample_bytree=None, device=None, early_stopping_rounds=None,\n", - " enable_categorical=False, eval_metric=None, feature_types=None,\n", - " gamma=None, grow_policy=None, importance_type=None,\n", - " interaction_constraints=None, learning_rate=None, max_bin=None,\n", - " max_cat_threshold=None, max_cat_to_onehot=None,\n", - " max_delta_step=None, max_depth=None, max_leaves=None,\n", - " min_child_weight=None, missing=nan, monotone_constraints=None,\n", - " multi_strategy=None, n_estimators=None, n_jobs=None,\n", - " num_parallel_tree=None, random_state=None, ...)
RandomForestRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
RandomForestRegressor()
AdaBoostRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
AdaBoostRegressor()
GradientBoostingRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
GradientBoostingRegressor()
DecisionTreeRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
DecisionTreeRegressor()
XGBRegressor(base_score=None, booster=None, callbacks=None,\n", + " colsample_bylevel=None, colsample_bynode=None,\n", + " colsample_bytree=None, device=None, early_stopping_rounds=None,\n", + " enable_categorical=False, eval_metric=None, feature_types=None,\n", + " gamma=None, grow_policy=None, importance_type=None,\n", + " interaction_constraints=None, learning_rate=None, max_bin=None,\n", + " max_cat_threshold=None, max_cat_to_onehot=None,\n", + " max_delta_step=None, max_depth=None, max_leaves=None,\n", + " min_child_weight=None, missing=nan, monotone_constraints=None,\n", + " multi_strategy=None, n_estimators=None, n_jobs=None,\n", + " num_parallel_tree=None, random_state=None, ...)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
XGBRegressor(base_score=None, booster=None, callbacks=None,\n", + " colsample_bylevel=None, colsample_bynode=None,\n", + " colsample_bytree=None, device=None, early_stopping_rounds=None,\n", + " enable_categorical=False, eval_metric=None, feature_types=None,\n", + " gamma=None, grow_policy=None, importance_type=None,\n", + " interaction_constraints=None, learning_rate=None, max_bin=None,\n", + " max_cat_threshold=None, max_cat_to_onehot=None,\n", + " max_delta_step=None, max_depth=None, max_leaves=None,\n", + " min_child_weight=None, missing=nan, monotone_constraints=None,\n", + " multi_strategy=None, n_estimators=None, n_jobs=None,\n", + " num_parallel_tree=None, random_state=None, ...)
KNeighborsRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
KNeighborsRegressor()
AdaBoostRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
AdaBoostRegressor()
DecisionTreeRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
DecisionTreeRegressor()
KNeighborsRegressor()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
KNeighborsRegressor()