Skip to content

This project demonstrates how machine learning models πŸ€– can be used to predict stock prices πŸ’Ή based on historical data πŸ“Š, helping investors make informed decisions πŸ’‘.

License

Notifications You must be signed in to change notification settings

yuvrajtiwary-bitmesraece/Stock-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Stock-Prediction

Stock Price Prediction

Yuvraj Tiwary

This project demonstrates how machine learning models can be used to predict stock prices based on historical data, helping investors make informed decisions.

Simple Linear Regression: A basic regression technique that models the relationship between the independent variable (time) and the dependent variable (stock price) using a linear equation.

Support Vector Regression (SVR): A regression algorithm that constructs a hyperplane or set of hyperplanes in a high-dimensional space to optimize the margin between the data points and the hyperplane(s).

Decision Tree Regression: A non-linear regression technique that uses a decision tree model to predict the stock price by recursively partitioning the data into subsets based on the feature values.

Random Forest Regression: An ensemble learning method that constructs multiple decision trees during training and outputs the average prediction of the individual trees for improved accuracy and robustness.

By implementing and comparing these regression algorithms, this project aims to provide insights into the effectiveness of different approaches in predicting stock prices. Stakeholders can utilize the predictions generated by these models to make informed decisions regarding investment strategies, whether to invest in the stock or divest from the company.

Data Import and Cleaning

The script imports a dataset containing stock prices, and then cleans the data by removing unnecessary columns.


Data Visualization

It visualizes the data using scatter plots and histograms to understand the distribution and relationships between variables.


Model Building

It builds four different regression models: Simple Linear Regression, Support Vector Regression, Decision Tree Regression, and Random Forest Regression.


Model Evaluation

Each model is evaluated using the R-squared score to measure its accuracy in predicting stock prices.


Results Visualization

The script visualizes the accuracies of the four models using a bar chart, making it easy to compare their performance.


Predicting Future Stock Price

Finally, the script predicts the closing price of a stock for a specific date using the model with the highest accuracy.

Data Import and Cleaning:

The script imports a dataset containing stock prices, and then cleans the data by removing unnecessary columns.

Import Libraries and Dataset

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score
import warnings
warnings.filterwarnings('ignore')
sns.set_style('darkgrid')
dataset = pd.read_csv('ICICI_BANK.csv')

Information about the dataset

dataset.shape
(5306, 15)
from IPython.display import display, HTML

# Generate HTML code for the table
table_html = """
<div style="background-color: #f9f9f9; padding: 10px; border-radius: 5px;">
    <h3>Dataset Columns</h3>
    <table>
        <tr>
            <th>Column Name</th>
        </tr>
"""

for column in dataset.columns:
    table_html += f"""
        <tr>
            <td>{column}</td>
        </tr>
    """

table_html += """
    </table>
</div>
"""

# Display the HTML table
display(HTML(table_html))

Dataset Columns

    <tr>
        <td>Date</td>
    </tr>

    <tr>
        <td>Symbol</td>
    </tr>

    <tr>
        <td>Series</td>
    </tr>

    <tr>
        <td>Prev Close</td>
    </tr>

    <tr>
        <td>Open</td>
    </tr>

    <tr>
        <td>High</td>
    </tr>

    <tr>
        <td>Low</td>
    </tr>

    <tr>
        <td>Last</td>
    </tr>

    <tr>
        <td>Close</td>
    </tr>

    <tr>
        <td>VWAP</td>
    </tr>

    <tr>
        <td>Volume</td>
    </tr>

    <tr>
        <td>Turnover</td>
    </tr>

    <tr>
        <td>Trades</td>
    </tr>

    <tr>
        <td>Deliverable Volume</td>
    </tr>

    <tr>
        <td>%Deliverble</td>
    </tr>

</table>
from IPython.display import display, HTML

# Generate HTML code for the table
table_html = """
<div style="background-color: #f9f9f9; padding: 10px; border-radius: 5px;">
    <h3>Dataset Info</h3>
    <table>
        <tr>
            <th>Column Name</th>
            <th>Non-Null Count</th>
            <th>Dtype</th>
        </tr>
"""

for column in dataset.columns:
    non_null_count = dataset[column].count()
    dtype = dataset[column].dtype
    table_html += f"""
        <tr>
            <td>{column}</td>
            <td>{non_null_count}</td>
            <td>{dtype}</td>
        </tr>
    """

table_html += """
    </table>
</div>
"""

# Display the HTML table
display(HTML(table_html))

Dataset Info

Column Name
    <tr>
        <td>Date</td>
        <td>5306</td>
        <td>object</td>
    </tr>

    <tr>
        <td>Symbol</td>
        <td>5306</td>
        <td>object</td>
    </tr>

    <tr>
        <td>Series</td>
        <td>5306</td>
        <td>object</td>
    </tr>

    <tr>
        <td>Prev Close</td>
        <td>5306</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>Open</td>
        <td>5306</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>High</td>
        <td>5306</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>Low</td>
        <td>5306</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>Last</td>
        <td>5306</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>Close</td>
        <td>5306</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>VWAP</td>
        <td>5306</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>Volume</td>
        <td>5306</td>
        <td>int64</td>
    </tr>

    <tr>
        <td>Turnover</td>
        <td>5306</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>Trades</td>
        <td>2456</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>Deliverable Volume</td>
        <td>4789</td>
        <td>float64</td>
    </tr>

    <tr>
        <td>%Deliverble</td>
        <td>4789</td>
        <td>float64</td>
    </tr>

</table>
from IPython.display import display, HTML

# Get the describe() output
desc = dataset.describe()

# Convert the describe() output to an HTML table
table_html = "<table>"
table_html += "<tr><th></th>"
for column in desc.columns:
    table_html += f"<th>{column}</th>"
table_html += "</tr>"

for index, row in desc.iterrows():
    table_html += "<tr>"
    table_html += f"<td>{index}</td>"
    for value in row:
        table_html += f"<td>{value:.2f}</td>"
    table_html += "</tr>"

table_html += "</table>"

# Display the HTML table
display(HTML(table_html))
Column Name Non-Null Count Dtype
Prev CloseOpenHighLowLastCloseVWAPVolumeTurnoverTradesDeliverable Volume%Deliverble
count5306.005306.005306.005306.005306.005306.005306.005306.005306.002456.004789.004789.00
mean550.90551.56560.56541.53551.05551.00551.138224630.71375929920576296.62138367.634183406.040.47
std368.78368.89374.08363.39368.71368.73368.7512185349.04475813345498016.6999008.736365381.730.13
min67.4067.0070.4566.0067.0067.4068.527409.0096172830000.002595.0015015.000.10
25%267.56267.40271.91263.62267.40267.61267.58961205.5034594425000000.0079312.25699502.000.38
50%398.08399.00406.52392.45398.70398.18398.243486647.50292301000000000.00110101.001963117.000.48
75%873.56877.00888.77859.80874.60873.56873.5111572021.25499352750000000.00162953.505948817.000.56
max1794.101767.051798.151760.151793.001794.101783.46286857658.0014600000000000000.00949891.00232530747.000.98

Data Cleaning

# we can visualize, Before cleaning 
# display(dataset.head().style.hide_index())
# Delete unnecessary columns

# dataset.drop(["Symbol", "Series", "Prev Close", "High", "Low", "Last", "VWAP", "Volume", "Turnover", "Trades", "Deliverable Volume", "%Deliverble"], 
# axis = 1, inplace = True)
dataset.drop(columns=dataset.columns.difference(['Date', 'Open', 'Close']), inplace=True)
# we can visualize, Before cleaning 
# display(dataset.head().style.hide_index())

Data Visualization:

It visualizes the data using scatter plots and histograms to understand the distribution and relationships between variables.

import plotly.express as px

fig = px.scatter(dataset.head(100), x="Open", y="Close", title="Open v/s Close", color_discrete_sequence=['orange'])
fig.show()
<script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("7b47bdb2-678f-4dc3-9cff-d37975f52f22")) { Plotly.newPlot( "7b47bdb2-678f-4dc3-9cff-d37975f52f22", [{"hovertemplate":"Open=%{x}\u003cbr\u003eClose=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"","marker":{"color":"orange","symbol":"circle"},"mode":"markers","name":"","orientation":"v","showlegend":false,"x":[74.35,73.05,70.0,71.0,69.0,67.0,69.15,69.0,80.0,78.0,81.8,88.1,88.7,98.9,103.75,101.0,112.0,125.2,130.0,145.0,157.8,170.4,180.9,160.0,153.5,160.0,163.0,160.0,178.85,161.7,171.9,173.7,179.95,179.0,177.0,171.0,163.0,163.0,154.0,167.0,186.2,170.0,199.8,215.8,233.1,245.0,249.5,213.0,199.9,216.0,200.0,203.1,215.0,202.0,197.0,207.0,228.0,238.0,242.0,239.75,258.95,239.75,272.75,245.75,227.65,212.0,215.95,224.0,220.0,259.0,232.0,206.55,219.9,235.0,220.0,218.9,197.0,216.0,224.0,225.0,235.0,218.0,228.0,219.0,214.0,209.0,219.0,213.1,207.25,201.1,212.95,211.0,209.05,208.05,209.1,205.0,203.0,208.9,205.35,209.0],"xaxis":"x","y":[74.75,73.05,69.5,70.05,67.4,69.9,69.35,74.9,79.35,79.0,85.35,84.8,91.6,96.35,99.35,107.3,115.9,125.2,135.25,146.1,157.8,170.45,156.85,144.4,155.6,151.55,156.55,169.1,160.3,171.7,164.2,177.05,179.75,174.35,170.2,158.9,156.9,148.8,160.3,173.15,171.3,185.0,199.8,215.8,233.1,238.15,219.35,201.8,211.65,201.1,201.2,210.35,203.95,191.75,200.35,216.4,233.75,237.65,221.95,239.75,258.95,267.05,247.45,229.25,210.95,202.85,219.1,236.65,242.8,236.95,224.5,209.25,219.9,217.55,215.45,206.15,202.7,218.95,229.2,235.5,220.25,223.0,211.45,215.8,210.1,219.0,215.25,204.25,208.25,209.25,207.95,209.7,210.05,210.1,205.6,208.95,206.65,207.7,207.65,209.75],"yaxis":"y","type":"scatter"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"Open"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"Close"}},"legend":{"tracegroupgap":0},"title":{"text":"Open v\u002fs Close"}}, {"responsive": true} ).then(function(){

var gd = document.getElementById('7b47bdb2-678f-4dc3-9cff-d37975f52f22'); var x = new MutationObserver(function (mutations, observer) {{ var display = window.getComputedStyle(gd).display; if (!display || display === 'none') {{ console.log([gd, 'removed!']); Plotly.purge(gd); observer.disconnect(); }} }});

// Listen for the removal of the full notebook cells var notebookContainer = gd.closest('#notebook-container'); if (notebookContainer) {{ x.observe(notebookContainer, {childList: true}); }}

// Listen for the clearing of the current output cell var outputEl = gd.closest('.output'); if (outputEl) {{ x.observe(outputEl, {childList: true}); }}

                    })                };                });            </script>        </div>
import plotly.graph_objects as go

# Create scatter plot
fig1 = px.scatter(dataset.head(100), x="Open", y="Close", title="Open v/s Close", color_discrete_sequence=['orange'])

# Create histogram
fig2 = px.histogram(dataset, x="Close", nbins=50, title="Histogram of Close Prices", color_discrete_sequence=['orange'])

# Create subplots
fig = go.Figure()
fig.add_trace(fig1['data'][0])
fig.add_trace(fig2['data'][0])

# Update layout
fig.update_layout(title="Scatter Plot and Histogram", showlegend=False)

# Show the figure
fig.show()
<script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("3246e3c5-14a3-43b8-b0ad-2d85be631e7a")) { Plotly.newPlot( "3246e3c5-14a3-43b8-b0ad-2d85be631e7a", [{"hovertemplate":"Open=%{x}\u003cbr\u003eClose=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"","marker":{"color":"orange","symbol":"circle"},"mode":"markers","name":"","orientation":"v","showlegend":false,"x":[74.35,73.05,70.0,71.0,69.0,67.0,69.15,69.0,80.0,78.0,81.8,88.1,88.7,98.9,103.75,101.0,112.0,125.2,130.0,145.0,157.8,170.4,180.9,160.0,153.5,160.0,163.0,160.0,178.85,161.7,171.9,173.7,179.95,179.0,177.0,171.0,163.0,163.0,154.0,167.0,186.2,170.0,199.8,215.8,233.1,245.0,249.5,213.0,199.9,216.0,200.0,203.1,215.0,202.0,197.0,207.0,228.0,238.0,242.0,239.75,258.95,239.75,272.75,245.75,227.65,212.0,215.95,224.0,220.0,259.0,232.0,206.55,219.9,235.0,220.0,218.9,197.0,216.0,224.0,225.0,235.0,218.0,228.0,219.0,214.0,209.0,219.0,213.1,207.25,201.1,212.95,211.0,209.05,208.05,209.1,205.0,203.0,208.9,205.35,209.0],"xaxis":"x","y":[74.75,73.05,69.5,70.05,67.4,69.9,69.35,74.9,79.35,79.0,85.35,84.8,91.6,96.35,99.35,107.3,115.9,125.2,135.25,146.1,157.8,170.45,156.85,144.4,155.6,151.55,156.55,169.1,160.3,171.7,164.2,177.05,179.75,174.35,170.2,158.9,156.9,148.8,160.3,173.15,171.3,185.0,199.8,215.8,233.1,238.15,219.35,201.8,211.65,201.1,201.2,210.35,203.95,191.75,200.35,216.4,233.75,237.65,221.95,239.75,258.95,267.05,247.45,229.25,210.95,202.85,219.1,236.65,242.8,236.95,224.5,209.25,219.9,217.55,215.45,206.15,202.7,218.95,229.2,235.5,220.25,223.0,211.45,215.8,210.1,219.0,215.25,204.25,208.25,209.25,207.95,209.7,210.05,210.1,205.6,208.95,206.65,207.7,207.65,209.75],"yaxis":"y","type":"scatter"},{"alignmentgroup":"True","bingroup":"x","hovertemplate":"Close=%{x}\u003cbr\u003ecount=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"","marker":{"color":"orange","pattern":{"shape":""}},"name":"","nbinsx":50,"offsetgroup":"","orientation":"v","showlegend":false,"x":[74.75,73.05,69.5,70.05,67.4,69.9,69.35,74.9,79.35,79.0,85.35,84.8,91.6,96.35,99.35,107.3,115.9,125.2,135.25,146.1,157.8,170.45,156.85,144.4,155.6,151.55,156.55,169.1,160.3,171.7,164.2,177.05,179.75,174.35,170.2,158.9,156.9,148.8,160.3,173.15,171.3,185.0,199.8,215.8,233.1,238.15,219.35,201.8,211.65,201.1,201.2,210.35,203.95,191.75,200.35,216.4,233.75,237.65,221.95,239.75,258.95,267.05,247.45,229.25,210.95,202.85,219.1,236.65,242.8,236.95,224.5,209.25,219.9,217.55,215.45,206.15,202.7,218.95,229.2,235.5,220.25,223.0,211.45,215.8,210.1,219.0,215.25,204.25,208.25,209.25,207.95,209.7,210.05,210.1,205.6,208.95,206.65,207.7,207.65,209.75,210.45,211.4,208.5,207.0,231.65,230.1,217.0,212.95,214.15,210.6,210.2,209.45,209.3,209.55,207.55,213.85,212.9,215.0,214.7,210.6,211.85,211.1,212.8,211.5,222.6,225.75,225.2,224.3,214.65,211.3,206.9,208.6,207.25,207.45,208.0,209.5,206.65,197.8,201.95,200.2,200.15,200.15,200.65,201.05,199.45,199.85,199.35,206.25,205.9,206.75,210.25,208.7,206.45,203.1,202.25,209.3,207.6,207.2,200.25,199.9,200.0,197.7,194.85,199.1,193.8,197.25,194.9,196.5,203.25,198.7,196.8,194.8,193.05,187.7,175.8,170.35,157.2,143.45,166.25,164.05,162.1,157.4,162.8,168.25,162.4,158.5,152.7,146.45,140.35,122.7,111.5,119.75,109.5,115.0,121.85,125.65,128.05,128.85,128.75,137.0,126.3,110.95,109.2,117.3,118.55,115.0,111.85,109.35,113.95,121.7,125.8,122.75,123.45,125.35,125.6,123.5,121.45,122.65,142.3,151.15,147.2,141.25,142.35,145.65,141.65,143.15,150.35,156.1,152.15,147.95,142.0,144.75,144.45,150.1,152.95,168.95,165.3,160.05,159.1,157.6,157.2,157.05,158.0,157.05,153.75,155.25,143.35,141.1,150.3,150.5,148.75,153.85,148.5,157.65,165.65,158.9,159.05,154.2,149.3,148.9,147.65,157.05,153.75,152.35,153.25,164.85,169.05,162.45,159.15,151.55,154.8,151.9,152.2,154.9,157.7,166.15,171.3,175.75,191.2,193.5,189.9,187.05,183.1,159.1,160.85,165.65,163.8,159.15,158.2,155.15,153.85,176.15,204.3,186.7,198.7,185.2,191.2,188.75,174.7,149.55,166.65,186.8,166.6,166.6,166.3,158.1,162.95,165.05,177.4,179.55,177.45,177.95,165.5,170.05,175.1,170.1,169.0,170.6,166.9,170.85,175.25,176.8,188.35,180.9,182.0,184.2,177.1,178.7,172.3,169.5,164.15,158.75,158.05,149.7,142.5,150.45,150.05,148.05,150.35,149.55,150.1,147.9,148.3,148.15,145.1,142.2,140.45,143.05,145.9,144.15,144.4,147.55,145.15,145.35,144.95,142.4,138.6,138.1,141.95,145.1,147.95,147.9,147.1,146.7,142.85,139.3,142.3,144.8,139.65,134.15,130.85,131.0,131.75,130.85,127.75,129.8,124.9,120.6,121.65,119.95,116.8,110.05,115.45,128.1,125.2,120.4,128.45,131.15,138.45,132.6,130.35,125.1,120.25,120.8,125.0,130.5,125.95,122.85,125.9,125.1,123.7,119.95,112.9,112.1,112.55,116.2,117.2,119.7,119.05,118.3,118.0,113.7,113.95,115.8,109.4,109.5,105.75,106.05,108.8,108.0,108.0,108.1,105.85,104.95,103.3,100.2,100.05,89.6,75.15,83.55,83.4,79.95,74.85,75.65,70.85,71.65,67.95,71.7,72.2,73.35,75.55,76.1,74.85,76.3,77.5,78.2,81.7,82.1,81.15,84.1,82.8,84.0,88.65,94.95,97.75,104.8,106.45,100.2,101.6,102.55,104.55,106.55,109.0,107.05,103.9,103.35,103.8,103.55,102.15,101.5,102.9,100.9,101.25,103.2,103.2,104.85,102.7,102.0,101.1,99.35,96.45,97.0,95.5,94.45,97.05,97.05,96.85,94.4,93.15,93.05,93.0,91.9,89.85,84.65,84.55,80.3,83.0,88.7,88.5,88.4,92.0,91.1,90.15,90.5,91.65,92.0,90.15,89.65,92.2,94.65,94.9,93.45,91.2,91.55,92.9,93.1,94.2,93.7,88.95,89.3,90.4,91.1,89.8,89.95,91.3,91.1,92.15,99.35,97.7,104.4,114.85,126.35,129.05,125.25,124.05,128.3,141.15,140.5,134.9,131.75,125.0,135.6,134.0,132.55,135.0,132.5,131.75,129.6,126.5,125.2,124.9,128.35,124.65,126.1,124.1,123.3,124.95,122.45,120.35,123.9,127.0,127.6,127.8,125.9,124.25,123.6,123.4,123.9,125.1,124.05,123.25,122.9,122.45,119.5,115.8,116.4,114.0,115.4,112.2,114.1,111.7,112.65,112.0,114.85,115.55,124.15,130.2,134.05,136.9,139.3,144.0,143.95,140.85,140.5,139.15,139.05,132.9,129.95,133.15,130.85,129.25,128.85,130.5,138.25,137.6,134.5,142.4,151.5,151.1,153.8,161.75,159.25,151.4,144.3,147.5,147.55,143.25,145.6,139.65,141.0,139.55,137.8,133.9,137.7,138.2,147.1,154.5,150.65,152.2,149.85,149.0,148.45,147.35,147.35,145.05,143.8,144.8,144.95,145.55,144.5,145.2,141.6,139.75,137.3,141.8,137.95,140.6,144.75,140.65,137.1,136.35,136.8,135.75,135.65,134.35,134.3,132.3,134.2,135.9,135.0,135.3,134.4,139.35,139.35,139.75,139.25,138.9,143.6,142.25,140.4,139.4,140.15,142.9,141.35,144.0,144.0,143.3,142.75,143.75,144.35,146.15,140.85,138.0,138.8,137.0,135.35,138.0,140.3,144.85,142.1,143.35,143.2,138.5,136.7,135.1,137.9,138.6,137.7,136.7,129.55,131.0,127.05,130.0,123.55,126.5,131.55,135.0,132.4,134.9,131.45,131.5,130.15,124.5,120.95,121.0,117.1,110.55,118.45,120.05,122.8,120.4,120.7,129.35,137.7,136.5,134.85,133.3,133.15,133.8,131.1,131.9,134.9,134.7,135.95,133.7,137.1,141.75,149.5,147.25,143.2,142.55,140.75,139.9,142.35,142.25,140.4,143.4,143.05,140.5,140.4,138.95,136.75,133.2,132.65,133.1,134.0,138.85,141.55,140.55,142.1,144.25,144.55,143.7,149.7,149.95,143.7,147.85,146.45,148.75,149.35,149.95,149.9,147.55,147.8,144.35,147.15,143.65,141.55,143.65,145.75,147.6,146.95,147.85,149.95,149.4,149.75,149.65,148.85,149.0,149.95,149.3,149.75,149.85,146.4,143.3,141.05,141.85,142.3,141.2,138.25,135.0,137.6,139.3,139.6,140.85,136.9,135.75,135.15,132.9,134.3,133.75,134.45,133.4,134.85,136.35,138.9,136.95,132.35,134.45,131.05,133.95,134.6,133.4,132.65,132.4,130.45,130.2,132.05,130.1,130.0,121.15,121.7,120.8,120.8,121.15,125.05,124.85,127.3,126.15,127.35,131.0,135.4,138.05,136.35,138.8,131.5,131.5,137.8,136.1,137.45,136.7,137.95,137.7,137.4,141.55,141.35,141.75,140.45,136.75,137.45,137.9,142.75,141.45,143.95,142.9,143.65,142.35,140.65,140.35,141.45,141.55,147.25,150.15,148.3,145.1,145.75,148.7,150.1,148.05,150.5,150.1,154.5,160.1,159.8,163.2,159.95,158.15,153.8,150.15,150.0,154.75,159.65,159.05,159.35,162.0,159.15,162.6,155.0,151.75,147.15,149.7,153.55,154.05,159.0,158.8,155.65,157.5,157.4,156.65,178.35,179.9,174.05,181.95,183.3,183.7,179.7,184.35,187.6,183.65,181.6,182.9,182.05,181.3,182.95,185.25,184.15,183.1,183.25,187.4,184.15,186.75,186.45,192.3,196.0,190.9,204.15,202.9,204.5,204.4,210.0,212.85,226.65,223.0,227.25,223.5,228.05,227.1,224.4,225.25,220.95,217.55,212.0,216.85,218.45,224.15,226.4,230.8,227.65,227.15,229.6,247.0,259.65,258.0,244.8,240.45,243.0,240.5,248.25,249.05,248.75,245.6,243.1,243.2,236.4,227.7,227.35,232.0,236.4,241.25,251.45,250.1,255.5,264.4,287.7,269.2,260.2,260.85,267.4,273.55,284.45,280.55,275.65,282.65,282.7,279.85,279.65,281.6,281.25,283.75,286.2,302.2,298.8,295.45,302.75,306.55,313.2,312.4,304.05,302.4,304.1,305.05,309.4,308.05,299.75,283.3,300.1,296.0,294.8,289.9,293.7,305.5,293.65,287.65,295.05,295.3,302.4,306.55,321.3,332.0,348.25,318.1,318.85,311.4,309.55,315.8,317.35,310.75,296.7,282.0,274.8,274.45,267.75,270.95,281.7,277.25,288.9,292.2,304.3,302.2,289.25,280.1,282.0,278.25,282.95,287.75,281.95,277.65,276.5,273.15,276.5,269.55,285.05,299.85,297.5,296.3,300.95,298.85,295.85,291.4,289.45,292.4,291.65,291.65,289.05,287.65,291.95,299.75,307.25,297.45,299.0,319.35,312.3,317.6,318.75,315.0,314.8,306.9,301.9,303.85,302.8,298.85,283.0,284.6,284.75,264.7,236.75,256.35,264.2,262.8,267.15,267.3,258.55,262.5,264.95,246.05,230.4,236.75,261.55,265.3,268.35,268.35,270.2,272.3,267.55,259.65,251.35,252.6,257.3,262.8,258.65,256.05,252.35,253.55,254.15,250.6,252.9,248.8,244.5,247.8,244.85,235.35,241.55,245.75,238.45,244.35,241.3,236.85,234.4,238.45,245.2,253.0,261.6,262.7,262.5,261.35,257.35,258.7,258.5,264.6,267.5,275.9,273.5,271.0,279.1,272.55,277.1,275.2,277.4,277.0,275.15,275.4,277.1,272.65,273.8,267.85,267.4,265.0,266.8,273.95,268.75,271.8,269.8,270.9,262.45,262.95,264.5,263.0,265.4,267.25,268.95,265.25,267.8,264.8,266.05,275.2,279.0,288.95,295.35,288.7,292.25,295.3,291.6,288.9,286.25,289.3,291.45,298.0,295.85,294.65,296.35,292.45,286.2,289.3,289.3,287.45,294.3,296.7,290.2,290.6,285.35,286.9,290.1,294.95,299.05,296.3,296.75,307.75,309.1,318.9,316.35,317.45,317.05,315.75,315.0,319.65,334.75,330.7,325.75,322.85,325.25,326.6,318.2,336.1,339.75,339.75,344.25,353.95,357.25,364.9,358.1,364.1,359.75,360.55,363.2,364.85,366.0,359.95,363.9,366.0,360.95,364.4,371.3,374.0,373.3,370.8,363.25,371.35,371.35,373.9,361.75,353.4,358.7,348.9,350.75,345.1,354.05,351.15,352.1,351.0,351.6,346.2,338.55,343.55,337.5,348.05,360.9,361.8,366.05,369.65,365.7,361.1,362.8,366.45,374.7,374.9,380.8,383.15,375.6,376.1,381.75,376.45,374.65,373.75,369.4,367.65,380.9,372.25,389.5,397.0,397.7,399.3,398.95,390.5,392.05,390.5,384.2,382.6,400.95,401.4,413.05,408.45,395.25,390.25,390.35,397.85,389.85,383.0,392.8,406.05,418.35,425.45,425.25,408.7,403.95,394.55,408.4,412.0,403.1,386.8,383.8,378.3,383.45,396.45,408.1,404.7,383.9,379.15,359.95,360.35,362.45,367.3,376.7,377.7,382.3,392.05,393.2,391.7,392.2,398.1,396.5,390.65,393.7,397.45,402.55,399.3,397.4,400.0,399.05,389.7,392.05,399.4,392.15,393.0,397.25,393.7,405.35,419.6,413.65,408.6,423.75,433.95,433.45,417.05,416.0,405.15,418.2,420.7,418.4,418.35,417.75,417.85,416.95,425.75,421.25,429.25,432.05,431.95,422.0,424.25,452.35,468.05,463.8,446.0,441.3,443.65,440.7,440.6,438.8,454.8,493.4,509.25,528.2,534.45,538.4,520.4,522.65,513.3,500.15,478.1,482.6,494.05,506.95,512.75,504.75,503.9,507.6,498.2,491.55,480.45,488.25,484.5,481.6,467.95,477.1,481.8,483.85,481.5,484.5,488.0,505.25,513.55,516.45,518.5,527.25,533.15,546.15,555.4,582.3,576.5,573.15,574.55,575.85,590.35,599.4,598.95,601.7,593.4,590.35,562.1,534.5,529.95,531.4,538.55,525.65,506.25,500.35,496.65,497.6,496.9,506.55,497.6,503.95,510.8,479.9,485.5,498.6,498.65,499.45,499.55,504.7,505.5,503.65,515.1,526.9,533.1,545.4,538.65,522.4,519.95,527.9,538.85,544.7,540.65,539.0,536.9,538.05,540.55,544.2,532.75,529.9,542.45,540.2,549.3,561.65,562.4,571.6,562.45,586.55,584.85,575.05,575.1,573.55,581.05,559.55,578.2,576.45,573.85,585.05,597.0,606.5,613.7,604.55,600.15,591.2,585.25,577.8,584.0,573.3,564.4,559.15,569.55,579.5,570.7,573.1,597.05,619.55,614.65,609.25,590.2,579.95,570.95,608.25,628.75,619.1,603.8,609.5,596.5,598.3,597.8,586.9,591.75,593.35,594.3,588.4,593.8,596.6,615.25,616.55,620.4,611.8,613.35,600.9,591.55,601.75,614.35,605.2,606.9,610.8,606.15,606.25,598.2,592.75,592.5,598.65,598.95,592.6,598.5,588.7,589.05,604.0,613.75,621.9,599.7,597.45,582.55,563.35,580.7,586.5,588.05,588.65,591.6,569.05,559.8,567.5,566.15,576.8,591.75,621.95,649.1,659.9,638.2,634.55,639.15,660.75,662.55,636.05,619.3,618.6,626.05,593.75,555.45,553.15,577.35,568.9,558.95,563.75,569.3,569.9,537.5,534.3,551.95,538.1,542.7,533.25,498.85,500.35,474.2,459.65,451.2,482.55,506.7,501.0,490.45,494.4,512.25,508.05,507.2,490.75,498.6,488.9,479.05,487.9,489.1,490.35,499.9,485.55,498.95,493.0,487.95,488.3,495.75,485.9,477.25,472.6,467.75,492.05,484.75,514.85,542.4,540.5,543.6,542.55,553.85,549.65,548.0,557.6,547.0,567.85,595.55,590.3,599.25,584.5,576.75,590.7,591.5,588.35,594.65,595.15,590.6,589.15,588.95,587.75,595.3,593.9,597.45,609.6,622.75,613.15,610.45,607.1,606.4,596.75,604.75,631.75,650.35,646.6,643.65,646.75,651.2,663.4,654.9,658.65,678.25,688.25,708.8,699.6,697.75,695.05,705.85,702.45,698.6,695.5,687.0,690.4,694.9,720.3,726.3,744.55,741.75,741.5,739.3,720.55,759.35,758.55,787.9,777.15,778.15,779.6,772.75,767.65,770.75,785.05,800.35,830.95,841.0,856.9,880.5,887.35,876.55,859.2,872.35,880.05,876.0,872.85,883.05,861.3,858.65,872.45,878.15,870.7,863.55,868.45,879.15,880.35,820.85,803.95,830.9,870.35,870.8,887.15,868.2,854.4,854.25,857.0,873.0,894.25,903.2,891.5,897.45,894.55,890.5,910.1,906.3,912.35,883.85,892.35,972.3,957.85,960.05,986.85,971.25,985.4,977.2,964.3,974.55,991.45,955.95,941.1,952.55,944.9,946.8,957.9,983.15,999.7,996.15,966.15,955.9,914.4,949.6,980.2,969.45,969.3,946.2,907.0,904.0,875.8,829.5,855.35,842.9,821.55,847.9,828.65,863.0,858.6,868.7,877.6,829.4,823.9,810.0,822.55,824.0,870.55,899.6,891.6,875.7,857.85,855.3,853.35,803.95,807.9,820.95,838.65,858.25,857.75,859.5,849.25,873.45,888.25,894.0,898.95,905.15,916.7,917.55,950.1,962.9,961.45,935.15,865.85,869.9,855.85,843.75,839.8,849.35,842.95,848.45,870.4,886.85,918.6,938.05,951.15,943.0,928.55,917.85,911.3,912.7,922.8,920.6,913.65,919.15,930.45,933.35,939.05,911.2,909.1,903.45,901.95,919.35,913.95,905.85,908.7,918.75,945.15,948.15,949.95,954.55,952.6,945.9,938.05,942.85,955.45,950.2,966.7,985.95,1003.65,981.5,970.7,963.95,953.55,967.65,972.5,970.9,973.7,983.35,989.6,985.85,970.1,969.65,958.4,944.55,914.4,923.0,927.45,891.0,901.4,915.5,886.9,869.9,884.0,889.7,864.1,873.85,878.65,832.15,824.7,872.35,829.05,846.1,824.95,833.8,883.55,862.9,857.1,873.05,888.4,907.9,908.6,915.4,920.9,920.05,910.9,901.55,885.35,884.05,906.3,895.15,924.55,973.55,967.1,966.05,996.3,993.05,1020.0,1028.25,1062.4,1057.8,1086.55,1068.0,1036.4,1021.2,1045.65,1070.55,1091.25,1055.0,1097.45,1159.65,1117.1,1036.5,1022.8,1061.35,1102.0,1099.9,1144.65,1187.5,1240.65,1240.2,1254.05,1298.3,1333.4,1269.85,1241.8,1200.8,1169.05,1144.45,1145.35,1173.7,1278.55,1241.65,1220.05,1187.7,1160.45,1106.45,1145.35,1139.4,1156.8,1132.3,1122.9,1161.75,1178.4,1162.0,1139.7,1164.05,1200.7,1247.6,1271.45,1314.3,1289.9,1242.85,1206.95,1166.25,1137.7,1163.4,1157.5,1205.95,1218.9,1247.25,1226.7,1238.7,1228.75,1267.25,1228.95,1286.3,1362.55,1339.95,1307.95,1356.15,1435.0,1410.0,1352.2,1368.3,1322.1,1248.85,1173.2,1124.95,1151.45,1131.85,1261.3,1273.95,1220.45,1187.4,1147.0,1198.15,1212.25,1191.3,1152.05,1106.1,1073.9,1033.85,1067.25,1101.8,1161.85,1190.9,1209.8,1220.2,1168.3,1141.3,1099.8,1107.1,1117.85,1116.95,1105.85,1088.5,1024.6,971.1,960.15,893.4,871.85,856.65,880.3,837.55,876.95,759.95,768.2,768.2,802.2,878.85,843.95,834.55,835.5,769.4,757.75,784.55,786.75,764.55,811.3,814.0,836.6,800.95,788.05,807.75,816.15,836.75,864.25,882.3,864.75,878.8,915.65,895.85,902.5,879.6,937.15,933.85,928.8,919.0,892.85,873.85,880.55,888.6,896.45,928.35,942.85,927.2,911.55,880.55,862.05,820.3,810.35,820.45,796.25,788.6,765.05,760.55,757.55,778.2,769.4,750.3,730.95,741.2,743.25,765.3,797.45,820.65,786.95,753.6,732.95,720.7,703.15,698.2,697.55,652.15,630.2,589.1,621.05,571.9,603.6,605.15,594.35,621.7,616.9,591.6,578.9,529.15,519.75,551.85,617.45,642.95,661.7,738.7,730.2,656.75,663.4,607.7,636.1,637.3,642.4,640.45,694.1,706.65,707.95,731.6,771.15,740.65,710.7,673.45,665.0,677.7,678.8,643.7,644.55,657.15,666.55,649.95,632.55,671.9,665.0,714.05,716.65,686.75,720.45,712.1,701.0,686.6,652.8,627.5,591.65,560.05,577.15,627.5,635.75,599.15,600.1,596.2,560.4,493.3,535.55,550.9,504.35,490.05,485.05,453.75,363.65,425.15,449.55,414.15,416.15,391.25,411.35,431.05,396.7,365.8,308.5,316.1,335.5,345.35,398.75,430.7,457.8,450.85,433.4,432.3,471.85,434.35,397.3,395.9,386.45,360.2,348.25,319.5,334.05,322.55,321.1,350.85,351.65,325.55,323.4,334.8,364.0,358.4,370.0,400.05,406.1,411.0,418.7,421.0,431.8,472.0,472.8,445.7,426.85,440.95,417.35,445.0,458.6,448.1,464.15,471.25,499.9,523.45,467.85,456.6,438.0,425.45,441.1,408.65,423.75,412.6,396.3,369.35,378.05,363.85,381.1,408.05,410.1,416.25,385.1,392.0,389.7,390.55,407.1,428.35,428.7,435.2,421.4,434.4,409.0,385.7,369.5,361.5,335.85,335.95,340.6,324.85,327.55,304.4,295.6,284.9,270.05,269.15,262.95,284.15,308.65,322.8,323.4,334.65,337.9,323.05,346.8,355.45,365.55,375.05,385.2,338.1,332.8,349.35,360.7,374.8,376.4,397.8,416.6,442.9,427.55,440.85,426.65,398.75,400.05,424.4,434.1,467.55,439.2,479.2,529.9,569.1,539.6,549.3,520.75,523.35,558.1,551.15,536.25,574.7,707.1,756.15,708.9,673.05,702.65,704.65,666.0,710.25,730.3,740.15,722.55,732.3,719.45,733.5,754.75,724.65,737.85,747.7,750.3,742.45,734.75,734.4,722.45,703.25,714.05,731.0,697.2,689.4,700.0,756.15,748.7,722.2,729.85,733.5,754.95,679.7,694.85,653.1,635.4,628.85,632.95,679.5,696.4,693.85,742.85,784.75,772.7,759.55,775.75,767.55,757.9,740.35,732.75,757.2,758.5,773.75,763.55,773.4,766.15,738.1,718.7,717.1,710.15,757.2,744.85,704.95,720.05,716.55,719.55,745.4,767.95,759.2,761.9,750.55,763.6,751.15,744.8,736.1,735.95,743.9,788.85,789.95,792.9,816.6,835.15,824.6,844.4,864.5,872.3,841.2,852.5,845.2,860.45,839.0,866.35,907.6,926.6,912.4,938.2,918.4,922.95,901.8,920.2,921.0,935.95,959.1,948.15,944.45,929.1,891.4,903.7,890.85,834.45,809.45,771.75,790.8,786.3,827.75,844.65,848.55,888.5,896.55,924.5,892.6,908.95,919.3,920.55,905.5,886.45,897.0,917.25,909.35,901.85,865.5,850.9,867.85,887.2,893.55,884.25,871.45,860.7,872.45,855.3,875.95,864.5,850.7,825.65,822.6,825.8,809.35,810.9,825.7,862.6,864.9,880.2,879.8,877.0,879.7,888.05,894.85,886.4,873.95,869.4,842.75,840.65,835.3,842.45,863.35,865.5,877.95,852.7,840.7,830.8,787.3,788.05,830.35,835.8,819.0,839.45,828.8,798.15,801.3,805.35,812.4,799.8,826.05,817.35,832.45,840.95,840.05,833.55,831.6,847.75,841.15,851.6,872.15,897.15,908.35,898.4,901.75,923.75,925.15,917.8,930.85,936.65,923.75,930.5,948.55,963.65,956.55,935.25,925.5,933.85,947.5,952.6,959.8,952.5,952.65,985.35,997.8,987.35,961.1,978.3,964.65,942.2,918.0,922.45,919.8,933.0,951.9,943.85,977.7,960.15,946.95,919.45,947.05,951.95,936.9,915.2,903.65,902.85,876.6,922.1,916.6,914.75,927.0,911.05,901.1,889.2,824.45,831.65,834.8,832.1,809.35,847.75,856.8,864.75,868.3,837.95,842.3,854.1,865.85,841.95,817.5,824.55,829.05,846.0,853.65,860.1,876.75,883.85,869.3,899.8,891.6,900.4,885.7,856.55,870.15,848.3,861.7,841.45,840.05,840.6,858.8,846.2,862.3,875.9,893.45,899.45,891.25,881.85,902.4,900.05,886.85,902.6,908.7,912.85,916.7,924.2,908.85,928.7,904.9,939.55,962.0,969.25,955.4,949.8,980.1,988.9,971.85,963.3,976.4,957.1,958.9,967.9,1013.0,994.0,1011.5,1001.7,984.3,983.55,957.45,967.9,977.7,995.0,1003.9,1001.0,1039.45,1038.6,1027.6,1050.2,1098.0,1100.15,1103.9,1103.55,1114.2,1127.75,1127.15,1126.1,1100.25,1114.1,1115.1,1110.7,1101.95,1112.95,1135.2,1156.15,1147.7,1149.15,1137.6,1126.2,1132.6,1138.7,1158.7,1139.7,1124.65,1116.15,1119.55,1113.9,1129.6,1131.85,1142.1,1131.15,1106.75,1089.05,1163.0,1232.0,1231.35,1238.65,1266.05,1273.35,1255.3,1269.15,1255.2,1237.1,1200.45,1223.2,1202.3,1164.4,1148.7,1180.05,1156.95,1125.1,1116.25,1124.15,1154.3,1142.1,1167.45,1191.15,1181.45,1151.2,1110.5,1104.4,1058.3,1117.1,1120.4,1119.5,1078.7,1105.75,1100.05,1138.35,1131.75,1129.65,1118.15,1125.55,1111.85,1129.45,1136.85,1145.1,1144.85,1104.05,1069.35,1053.45,1049.2,1014.0,1022.95,1069.45,1026.0,1009.2,1001.15,1011.45,1023.25,1050.55,1065.55,1083.9,1037.9,1014.35,1018.45,1021.6,994.8,1011.4,1027.0,996.0,978.75,951.55,957.05,959.85,1000.55,1034.25,1054.2,1050.6,1057.0,1026.2,1037.65,1027.1,1006.1,951.35,986.25,970.85,1026.2,1019.55,1016.35,1010.15,1020.6,1035.25,1014.55,1006.9,1019.1,996.6,1027.45,1011.85,1002.55,1003.6,1004.15,1040.9,1053.1,1091.1,1100.8,1099.5,1109.1,1116.2,1102.9,1119.2,1111.25,1100.5,1104.0,1098.3,1100.6,1126.85,1101.7,1084.1,1090.05,1112.35,1118.5,1112.65,1121.45,1106.85,1117.5,1114.45,1098.3,1067.8,1057.65,1030.0,1083.8,1083.0,1076.2,1076.7,1052.15,1073.05,1057.75,1039.75,1032.25,1030.1,1043.2,1006.9,1018.8,1008.75,1026.25,1068.15,1077.7,1086.1,1084.7,1048.9,1047.4,1058.05,1056.15,1049.05,1048.0,1035.9,1039.6,1055.55,1031.15,1028.5,1032.2,1024.85,1014.0,1018.9,1030.2,1064.1,1079.4,1083.3,1087.25,1094.65,1094.85,1099.75,1097.3,1075.45,1089.85,1060.2,1054.0,1046.65,1054.0,1069.05,1060.65,1047.6,1061.8,1045.35,1041.0,1068.05,1074.85,1039.55,1024.9,1017.45,1036.75,1045.35,1021.7,1001.95,993.15,966.5,950.9,940.15,963.7,942.55,939.95,935.6,909.8,863.8,832.15,851.0,852.15,842.2,833.85,820.25,858.05,873.25,887.15,883.2,889.25,897.35,918.95,896.8,862.35,852.4,864.05,876.2,883.9,859.5,882.35,901.2,862.35,843.75,858.05,886.05,868.75,890.7,875.4,839.1,800.95,779.25,824.45,842.65,832.5,859.7,879.85,890.4,898.85,876.5,904.15,878.05,870.55,868.45,878.4,871.7,933.35,931.15,895.0,885.0,878.05,884.3,881.3,862.15,821.0,821.0,789.85,788.85,778.2,770.1,731.6,745.45,726.7,730.1,718.2,749.85,733.95,712.45,762.15,787.7,779.55,767.85,744.3,731.15,707.1,706.45,704.4,698.6,676.0,657.2,653.4,702.35,728.15,721.75,729.6,726.1,697.35,685.95,684.65,696.55,725.8,743.1,748.1,751.7,745.2,747.8,774.5,780.15,781.4,789.45,791.6,785.55,769.65,797.2,842.45,856.75,888.05,880.05,887.95,852.2,902.15,889.9,902.35,916.3,928.05,937.75,920.45,939.8,930.45,934.65,943.7,981.15,968.8,981.6,991.3,957.7,943.95,931.65,887.45,910.8,906.3,883.5,902.7,904.9,870.35,853.25,860.15,914.2,928.95,929.85,953.9,930.2,917.7,907.9,908.6,934.05,899.65,910.55,872.5,877.9,859.35,855.75,890.2,890.45,908.2,890.25,867.05,863.8,864.7,879.35,865.0,873.6,885.45,881.25,877.85,861.05,843.9,847.8,838.4,841.45,860.85,868.75,882.35,882.05,857.55,833.35,848.25,830.15,821.95,814.15,813.2,800.7,816.85,794.4,787.45,805.2,811.1,800.8,793.3,820.6,814.6,834.4,838.7,817.25,783.25,781.7,788.85,792.05,808.4,830.05,829.15,826.75,839.05,849.35,818.85,845.7,816.55,826.8,833.0,849.65,851.7,846.9,844.1,852.5,856.95,899.5,894.4,901.6,902.8,920.85,935.1,930.0,942.9,936.55,927.85,926.05,920.1,922.9,939.2,950.85,935.15,913.0,916.35,917.95,906.75,928.25,964.5,961.4,959.6,958.9,939.95,954.0,974.3,958.25,952.65,954.75,948.95,969.8,956.4,962.15,975.2,973.85,973.85,954.35,935.25,922.35,916.4,919.95,902.15,902.8,912.65,879.65,896.45,937.85,941.0,934.3,945.8,949.1,959.45,1008.0,1060.65,1049.05,1022.55,1065.5,1070.95,1066.9,1065.5,1055.35,1058.8,1050.65,1053.0,1083.4,1066.7,1052.2,1064.15,1054.2,1057.95,1044.75,1053.4,1043.25,1049.55,1064.95,1057.3,1075.6,1079.45,1087.15,1078.35,1068.45,1045.15,1050.2,1057.35,1079.65,1077.65,1080.7,1092.95,1076.0,1059.2,1058.4,1059.75,1054.65,1027.3,1021.15,1024.1,1044.45,1032.6,1025.1,1018.3,1034.1,1081.75,1099.85,1102.3,1119.35,1119.8,1135.7,1131.7,1121.45,1122.65,1113.2,1121.25,1136.05,1144.1,1148.95,1138.75,1139.65,1123.9,1121.5,1148.65,1136.45,1141.55,1138.25,1158.45,1174.0,1172.05,1182.4,1182.15,1179.55,1180.45,1179.5,1163.55,1185.15,1204.35,1179.85,1162.5,1176.2,1177.55,1170.15,1181.0,1164.5,1172.95,1190.25,1201.2,1212.7,1191.15,1171.15,1181.75,1166.05,1155.25,1144.85,1130.15,1122.7,1128.85,1142.6,1126.2,1121.85,1122.0,1131.4,1121.55,1079.6,1092.55,1093.9,1064.0,1083.15,1040.4,1056.35,1058.65,1093.6,1108.35,1117.15,1139.3,1131.95,1123.1,1085.7,1110.65,1067.5,1051.4,1032.6,1001.55,1035.35,1028.35,1012.6,1020.9,1045.2,1051.55,1046.9,1031.4,1008.8,998.15,989.1,990.05,1004.3,1040.2,1045.35,1047.1,1078.9,1097.65,1122.65,1148.45,1161.3,1177.35,1144.5,1153.2,1163.65,1171.7,1129.95,1142.65,1163.95,1157.95,1152.65,1165.35,1167.95,1148.8,1147.45,1191.25,1207.5,1230.45,1209.8,1211.0,1210.1,1172.3,1204.15,1219.4,1231.95,1214.9,1182.8,1154.45,1145.15,1138.2,1134.4,1154.6,1141.7,1117.8,1076.5,1081.25,1068.85,1102.15,1101.45,1090.95,1086.7,1046.15,1044.85,1049.15,1032.85,1026.15,1030.55,1070.75,1067.9,1079.1,1064.0,1063.7,1051.55,1027.95,1034.35,1038.55,1057.95,1060.4,1061.05,1003.45,980.25,984.45,959.3,974.45,989.65,951.8,934.85,931.55,928.6,926.05,909.05,914.2,887.1,902.45,866.35,868.25,875.05,867.05,892.55,905.95,858.6,815.35,830.4,829.55,831.1,853.05,830.45,802.6,796.35,807.2,803.75,826.6,783.55,817.75,893.7,958.4,969.6,969.75,951.2,941.95,969.95,962.45,973.1,1036.25,987.25,943.3,944.85,935.2,946.1,923.3,883.65,910.75,937.85,930.6,916.2,937.1,950.4,948.05,997.05,997.15,974.55,964.9,1008.85,1010.25,1010.15,1025.75,1020.9,1022.2,1015.0,1074.65,1099.0,1120.95,1133.45,1131.4,1096.0,1080.4,1051.45,1049.9,1037.2,1012.75,1014.9,1052.1,1073.65,1085.0,1049.15,1030.25,1020.55,1074.6,1043.75,1042.65,1038.1,1068.65,1088.3,1085.4,1066.25,1135.85,1143.9,1201.7,1158.35,1158.35,1132.6,1085.0,1097.55,1098.3,1095.8,1063.5,1087.7,1098.05,1098.85,1099.65,1110.25,1096.7,1098.75,1097.7,1075.6,1066.8,1040.8,1050.0,1054.3,1050.85,1024.5,1054.9,1036.45,1058.35,1058.9,1034.55,1044.0,1078.05,1087.95,1079.45,1058.2,1009.8,1018.65,1001.4,974.55,987.7,963.5,968.65,966.25,958.05,960.45,960.55,968.85,999.2,983.6,988.45,1009.15,1037.8,1030.9,1007.85,1025.3,1036.2,1031.1,1036.45,1043.85,1029.8,1069.1,1099.4,1133.95,1201.9,1193.6,1198.15,1211.65,1220.0,1215.0,1204.5,1209.95,1200.75,1199.55,1198.1,1242.2,1252.55,1256.5,1259.0,1259.2,1245.05,1223.95,1243.05,1233.75,1230.45,1209.15,1259.8,1247.35,1236.05,1219.45,1222.55,1262.85,1282.0,1289.9,1299.55,1270.5,1275.5,1262.8,1243.4,1252.4,1252.45,1275.6,1270.65,1289.0,1378.6,1398.7,1400.8,1409.4,1395.1,1465.3,1468.4,1449.9,1440.55,1451.5,1460.8,1454.55,1447.1,1456.2,1436.95,1418.05,1464.2,1458.35,1469.4,1463.15,1486.3,1492.2,1481.25,1469.9,1459.4,1428.35,1413.95,1449.5,1421.5,1411.75,1396.85,1414.2,1439.3,1420.5,1402.65,1384.65,1418.15,1438.05,1452.0,1454.05,1462.85,1451.35,1411.2,1403.05,1389.0,1356.6,1344.25,1394.6,1460.85,1450.6,1480.45,1482.6,1483.25,1506.0,1506.4,1475.65,1451.0,1488.45,1471.25,1475.65,1491.4,1486.55,1447.1,1444.85,1437.15,1440.9,1463.3,1452.2,1479.65,1530.7,1542.9,1542.75,1544.95,1539.55,1514.3,1508.05,1540.3,1556.8,1598.3,1591.1,1580.8,1571.65,1547.05,1567.8,1545.75,1570.1,1565.85,1564.4,1553.35,1525.75,1529.75,1565.0,1572.2,1578.85,1538.5,1516.4,1465.3,1477.95,1458.5,1433.55,1428.85,1429.65,1448.55,1488.4,1458.95,1477.9,1478.05,1460.55,1505.2,1536.9,1582.1,1571.0,1575.35,1573.05,1601.25,1605.85,1614.05,1626.65,1645.7,1671.35,1684.7,1667.0,1685.55,1707.95,1692.5,1692.3,1673.85,1681.2,1682.9,1687.95,1730.7,1773.3,1737.25,1710.4,1723.2,1754.4,1758.15,1770.5,1794.1,362.2,359.8,353.8,350.4,352.05,347.95,346.3,345.25,330.7,332.35,345.75,356.0,359.2,353.0,353.1,350.95,349.15,350.25,353.1,352.3,362.3,363.05,347.65,338.25,347.45,341.85,346.55,340.9,336.9,352.85,353.85,360.8,367.75,368.45,369.8,370.7,383.5,384.05,380.3,360.7,351.85,346.6,344.65,335.6,329.35,320.05,331.05,334.7,339.15,343.85,338.05,342.4,338.55,330.95,329.0,326.05,322.5,321.3,335.25,346.15,349.05,348.65,349.35,347.75,332.8,333.65,332.65,338.2,330.2,331.45,334.85,334.8,330.2,318.6,313.8,311.9,316.9,307.95,314.55,318.7,315.5,323.15,321.25,317.4,315.1,320.6,318.3,316.9,315.0,312.5,310.1,311.15,310.85,312.95,311.85,308.25,302.3,326.85,330.15,331.15,329.3,328.45,312.15,304.6,317.0,323.5,308.2,317.65,314.95,312.35,316.25,315.35,318.75,313.55,313.6,312.15,309.7,313.15,314.5,317.25,316.45,304.5,295.75,290.1,284.1,283.15,287.1,292.5,288.5,295.95,299.2,302.05,301.35,303.35,304.55,315.05,313.5,317.75,314.8,311.7,311.2,308.0,312.2,313.0,314.55,315.15,312.6,307.55,309.5,313.15,316.4,313.45,314.65,317.1,317.45,315.8,311.45,316.8,312.9,300.6,291.1,285.0,289.25,291.0,302.4,312.9,314.05,311.35,311.05,310.15,309.6,302.25,291.65,291.9,302.6,302.9,301.1,304.5,298.25,296.5,269.95,283.5,278.05,282.45,283.7,277.9,270.95,264.85,266.85,257.75,249.1,260.8,264.55,267.4,267.55,272.4,268.9,272.85,277.85,279.3,270.55,273.35,268.3,268.1,269.0,270.35,267.1,280.95,282.75,283.0,278.45,286.1,287.6,287.45,282.9,286.35,290.05,287.2,286.2,282.7,286.25,285.35,283.7,271.2,271.45,277.0,279.55,279.45,273.35,270.05,267.1,263.15,262.8,263.75,261.75,267.25,267.85,260.45,266.4,264.95,265.95,263.35,264.0,270.05,274.75,273.9,270.4,265.8,261.45,263.05,261.45,259.45,258.95,249.3,249.0,246.4,252.05,253.15,250.1,258.2,259.55,261.85,257.95,264.05,264.75,262.35,261.35,263.0,255.55,256.7,250.1,246.75,245.05,239.45,236.75,239.5,235.75,224.45,223.1,228.75,224.4,226.3,232.75,236.05,237.3,233.2,230.15,217.2,210.4,204.05,203.95,209.4,208.55,209.4,207.25,199.25,193.55,203.5,196.6,190.75,196.15,198.8,198.45,192.0,187.0,183.0,184.8,190.05,204.95,220.0,218.0,220.5,216.85,216.35,215.5,213.85,221.65,221.35,226.4,227.75,230.2,234.85,233.6,234.2,225.45,223.4,237.5,236.65,238.3,238.75,225.6,222.55,220.3,221.25,224.7,228.75,240.65,237.15,238.05,253.05,252.0,252.95,254.05,244.6,240.1,236.95,226.75,221.1,214.45,214.65,218.6,225.3,225.5,223.95,231.8,226.5,223.75,225.95,226.45,225.55,220.1,221.1,224.55,235.0,241.15,243.15,244.5,244.65,240.05,241.35,243.75,243.5,254.1,257.65,254.55,252.6,243.75,244.95,247.95,239.05,238.45,238.1,237.85,239.0,240.9,230.95,232.7,233.15,236.65,240.55,240.35,248.15,245.1,244.85,241.95,249.85,261.7,261.15,268.6,265.75,263.4,269.15,267.5,261.9,263.45,268.65,261.65,270.6,272.0,262.9,249.5,245.3,242.1,240.35,245.95,245.25,245.35,239.35,242.7,245.95,248.55,247.6,252.9,253.9,252.25,250.2,248.45,246.95,245.3,250.5,256.25,258.0,260.95,261.3,272.7,278.15,276.35,274.1,268.2,271.45,270.6,267.35,271.6,272.1,269.9,275.5,271.25,262.55,260.0,260.75,250.35,252.15,256.15,258.2,255.45,251.25,250.6,250.1,241.15,241.75,258.75,270.35,265.05,277.6,277.4,284.55,289.25,278.4,284.3,276.85,277.05,275.35,271.9,269.75,269.8,278.7,283.2,281.45,292.6,276.4,269.75,266.2,267.65,264.6,261.2,262.7,264.95,259.3,260.1,255.3,255.45,265.55,259.15,259.5,260.85,261.0,258.7,262.75,268.45,264.85,264.4,260.55,260.3,255.6,257.1,251.6,253.25,252.95,251.85,248.15,253.55,251.75,251.1,255.3,251.95,254.4,251.1,257.25,258.15,258.7,260.2,264.7,268.35,268.05,269.3,268.4,268.45,269.7,263.45,257.55,257.15,259.95,272.0,270.8,268.95,281.0,285.8,281.55,290.3,288.1,285.8,285.0,281.6,281.65,284.65,280.75,278.8,283.0,282.35,284.8,286.15,284.5,278.85,276.35,279.1,278.65,275.95,276.75,276.0,274.4,273.5,270.55,287.25,285.15,284.5,280.6,275.05,272.05,265.0,266.95,274.75,273.15,277.0,282.2,281.35,276.85,286.7,284.85,280.85,277.35,277.65,283.65,280.8,282.8,282.4,283.4,280.55,272.75,269.15,268.65,272.5,276.9,274.15,278.5,275.6,272.75,297.8,298.55,302.95,300.6,298.65,300.2,296.55,301.8,302.65,309.75,307.95,307.05,303.85,306.05,306.7,317.7,321.55,314.9,321.4,326.45,320.1,318.15,319.75,318.95,324.7,320.2,322.15,315.75,314.85,319.05,316.75,316.5,320.6,292.45,291.1,289.6,291.85,287.9,290.35,293.25,290.15,290.05,289.5,292.85,293.75,289.7,291.45,289.65,292.35,297.9,298.25,303.5,303.9,302.25,300.6,302.05,303.05,304.15,310.35,307.2,296.15,302.6,302.6,301.85,295.7,296.25,300.15,295.5,290.6,288.75,286.95,291.8,294.95,293.15,293.15,293.5,293.95,298.6,297.7,300.9,299.5,300.3,298.05,298.3,297.1,297.6,295.35,292.65,292.0,290.8,291.2,292.0,293.7,291.6,293.0,294.65,290.55,284.95,277.1,279.5,282.75,276.4,275.95,276.6,278.4,276.1,271.8,271.95,271.75,269.8,267.6,267.55,271.3,274.25,273.9,263.15,257.85,262.55,266.55,305.7,299.25,301.15,300.55,300.1,313.4,316.65,315.9,316.1,312.45,305.5,311.3,318.5,314.25,314.1,315.5,318.95,325.1,318.55,319.9,318.9,319.45,317.2,317.0,313.2,314.85,307.55,305.25,304.25,305.25,299.5,305.8,310.75,311.45,307.6,302.95,304.35,303.15,308.9,313.7,315.8,315.45,316.6,318.15,312.8,315.3,314.0,310.3,309.7,315.0,314.7,312.9,314.15,312.6,312.0,309.5,317.7,329.3,334.1,343.25,346.15,353.6,351.5,362.3,352.75,360.8,357.65,353.25,352.95,346.2,335.1,329.7,330.7,332.55,333.85,326.75,326.25,318.95,328.65,321.05,319.75,317.25,319.2,318.35,322.75,327.05,322.15,313.25,304.95,303.35,295.05,286.7,296.95,292.7,300.65,304.35,306.05,301.45,298.1,294.55,292.0,289.2,283.25,275.55,281.65,283.9,278.35,261.85,270.05,268.65,278.65,280.65,280.85,288.8,284.55,286.75,288.25,287.6,291.75,290.05,289.6,282.15,279.4,284.1,278.9,278.85,287.9,284.2,276.9,281.9,282.85,289.8,309.3,306.8,306.85,310.95,310.1,308.25,297.25,296.0,286.1,289.3,290.3,292.05,297.7,295.65,299.25,289.9,284.9,285.8,289.3,286.75,284.1,283.9,290.9,288.25,286.4,287.4,290.75,284.75,282.5,293.0,292.8,293.2,297.95,300.65,289.7,288.1,279.05,271.4,275.4,277.4,272.9,273.25,271.55,270.05,271.2,273.4,268.75,272.3,267.75,259.25,266.45,262.7,261.2,265.8,275.55,274.35,274.65,285.65,293.2,307.35,304.25,299.3,298.55,305.0,315.1,313.15,318.7,333.0,328.6,324.9,332.45,334.3,340.0,338.45,338.85,337.2,330.15,339.9,338.9,340.65,344.35,342.6,334.15,328.5,329.65,328.65,335.1,332.9,326.55,322.9,328.35,325.7,318.85,320.95,317.1,308.75,311.1,313.1,306.65,305.55,314.0,303.7,316.5,307.3,310.85,306.25,319.85,311.7,319.4,313.35,320.65,314.8,315.45,327.1,322.85,322.0,319.95,315.65,349.4,345.7,355.0,353.7,354.45,349.65,353.1,355.9,356.85,352.35,360.9,366.6,370.0,367.55,362.4,357.9,356.75,352.05,356.35,354.65,359.0,362.2,355.15,355.5,357.95,351.4,347.65,352.2,346.35,342.8,349.95,349.55,351.9,358.45,362.25,366.5,362.15,354.2,352.75,355.85,355.65,360.75,360.15,363.75,364.6,363.25,365.2,367.7,380.15,382.25,379.5,378.55,373.35,372.75,375.3,374.6,372.0,371.7,369.05,367.4,364.8,357.2,343.55,346.85,365.9,364.45,354.65,354.55,352.65,359.3,358.65,355.1,350.05,344.3,339.75,343.95,342.15,338.75,343.25,345.2,351.3,352.05,355.6,348.2,345.55,350.15,354.25,363.25,371.95,370.8,370.6,375.85,388.2,391.9,387.9,395.3,398.05,398.4,392.9,391.8,383.5,394.1,393.2,400.55,400.5,398.25,397.15,392.1,388.75,390.55,387.1,397.15,394.2,390.05,394.6,392.75,407.0,404.4,394.5,396.5,401.1,395.4,407.2,407.5,395.55,401.8,401.3,386.5,382.2,381.4,385.1,376.3,380.4,377.05,382.5,389.7,407.7,400.15,405.35,410.85,431.75,435.5,434.3,423.3,426.2,423.7,422.9,419.1,411.55,416.6,416.1,421.35,418.0,419.6,417.75,414.2,422.15,419.8,433.4,430.8,429.45,433.65,438.65,440.95,437.1,439.0,436.75,435.95,436.2,436.35,425.9,428.5,430.9,426.55,427.05,422.3,424.6,424.7,418.65,410.3,411.5,411.95,408.5,409.0,415.75,429.35,425.35,424.6,417.05,410.6,402.65,410.25,408.4,414.4,420.15,410.25,417.3,418.95,423.4,416.9,412.05,399.1,395.4,411.65,418.6,412.95,404.4,409.65,392.15,397.5,389.0,391.35,395.45,394.6,402.7,413.4,412.15,400.65,399.35,386.6,417.5,446.3,440.9,434.2,451.95,449.2,433.7,424.6,427.3,413.9,416.1,436.7,423.7,428.55,428.85,431.85,435.3,440.6,437.8,451.15,455.1,454.75,469.1,469.55,477.4,471.15,463.05,462.25,470.5,468.35,480.7,478.55,489.45,496.8,485.75,498.65,499.85,498.35,493.5,495.0,498.25,496.8,497.8,510.7,505.5,519.15,512.6,510.9,509.35,529.25,528.1,524.8,526.5,528.7,533.55,535.35,537.05,539.25,541.15,541.4,540.2,546.1,541.3,541.1,538.75,549.4,543.95,538.9,536.75,540.6,538.85,525.7,522.9,525.95,546.3,540.25,538.6,537.6,535.6,537.15,532.05,534.85,531.05,522.85,527.7,533.85,537.25,528.2,526.6,532.2,525.65,504.6,515.55,530.8,539.1,541.6,536.45,533.95,539.75,549.3,541.0,545.8,541.6,541.2,544.8,547.0,529.85,530.95,523.7,515.35,497.25,506.1,514.75,508.35,504.5,486.35,457.75,465.65,425.65,447.2,402.9,367.25,355.05,338.55,345.7,284.0,296.5,316.9,330.25,339.85,313.4,323.75,311.15,286.65,326.1,318.95,342.7,330.65,327.35,342.0,375.55,361.3,331.85,335.95,352.95,334.85,347.9,359.85,370.45,380.15,338.05,330.85,341.4,336.75,337.7,320.15,321.2,338.05,327.4,322.7,298.5,300.3,305.65,304.4,291.05,292.7,318.85,326.85,331.95,339.25,348.4,356.85,347.85,357.2,359.8,348.55,353.0,341.25,344.2,331.1,342.95,341.95,352.0,363.8,367.55,376.15,348.1,351.0,349.1,343.1,351.45,364.05,362.85,361.0,361.85,376.05,368.95,370.35,360.35,353.6,345.55,345.8,344.65,353.8,363.0,378.8,381.1,392.25,381.8,358.5,352.1,351.05,344.95,346.8,343.25,351.0,352.2,358.75,357.95,363.55,367.35,366.85,368.05,361.4,360.2,369.55,374.45,367.75,371.15,380.35,386.35,389.35,392.2,409.7,394.6,390.95,392.4,382.75,372.55,373.4,375.7,367.6,370.7,370.5,363.7,371.55,374.7,369.0,369.55,350.7,354.4,351.85,335.7,348.65,363.0,357.05,354.75,369.2,373.1,380.6,382.65,387.5,401.5,404.05,396.25,406.8,391.0,396.1,417.1,414.6,420.3,412.9,416.95,404.45,409.95,396.05,399.9,392.6,417.45,443.85,437.05,438.5,442.8,462.7,483.85,486.55,476.7,485.55,486.9,486.4,497.65,478.75,480.2,468.25,478.2,472.7,475.3,473.35,485.1,480.45,481.85,502.05,510.45,508.4,511.5,506.95,515.45,525.8,518.05,512.45,510.4,517.15,494.5,500.3,503.6,513.55,520.1,528.8,528.75,535.05,527.5,531.7,537.25,546.7,541.1,542.05,544.7,548.0,556.5,553.3,543.0,533.15,546.45,551.0,552.7,533.8,538.05,522.35,528.25,537.0,603.8,617.35,622.35,628.3,614.15,629.6,633.35,632.15,630.65,647.6,673.95,658.35,657.35,644.65,624.05,609.85,616.3,641.1,628.0,597.75,608.35,610.5,632.1,620.75,609.45,608.05,625.1,625.6,612.85,603.5,594.95,589.5,578.6,586.65,573.45,586.4,567.5,571.55,578.55,591.45,582.1,594.4,571.25,565.9,577.65,576.7,566.2,538.55,560.6,575.2,566.95,559.75,559.1,579.2,569.95,591.1,598.75,621.35,621.45,600.5],"xaxis":"x","yaxis":"y","type":"histogram"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"title":{"text":"Scatter Plot and Histogram"},"showlegend":false}, {"responsive": true} ).then(function(){

var gd = document.getElementById('3246e3c5-14a3-43b8-b0ad-2d85be631e7a'); var x = new MutationObserver(function (mutations, observer) {{ var display = window.getComputedStyle(gd).display; if (!display || display === 'none') {{ console.log([gd, 'removed!']); Plotly.purge(gd); observer.disconnect(); }} }});

// Listen for the removal of the full notebook cells var notebookContainer = gd.closest('#notebook-container'); if (notebookContainer) {{ x.observe(notebookContainer, {childList: true}); }}

// Listen for the clearing of the current output cell var outputEl = gd.closest('.output'); if (outputEl) {{ x.observe(outputEl, {childList: true}); }}

                    })                };                });            </script>        </div>

Import Models

from sklearn.linear_model import LinearRegression
from sklearn.svm import SVR
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import RandomForestRegressor

Model Building:

It builds four different regression models: Simple Linear Regression, Support Vector Regression, Decision Tree Regression, and Random Forest Regression.

Simple Linear Regression

X = dataset['Open'].values
y = dataset['Close'].values
X_train, X_test, y_train, y_test = train_test_split(X, y, train_size=0.7, test_size=0.3)
model1 = LinearRegression()
build1 = model1.fit(X_train.reshape(-1, 1), y_train)
predict1 = model1.predict(X_test.reshape(-1, 1))
print("Co-efficient: ", model1.coef_)
print("\nIntercept: ", model1.intercept_)
Co-efficient:  [0.99860402]

Intercept:  0.24768269983928803
from IPython.display import HTML

html_table = df1.head(10).to_html(index=False, justify='center', classes='table table-striped table-hover table-bordered')
styled_table = f'<div style="text-align: center;"><style>table {{border-collapse: collapse; width: 50%;}} th, td {{border: 1px solid #dddddd; text-align: left; padding: 8px;}} th {{background-color: #f2f2f2;}}</style>{html_table}</div>'
display(HTML(styled_table))
<style>table {border-collapse: collapse; width: 50%;} th, td {border: 1px solid #dddddd; text-align: left; padding: 8px;} th {background-color: #f2f2f2;}</style>
Actual Values Predicted Values
136.80 137.635962
330.20 339.076123
879.15 872.417691
262.50 263.598544
580.70 569.507672
1040.20 1024.272582
360.70 359.570035
852.15 856.422442
829.05 869.418582
187.60 184.622005
import plotly.express as px
import plotly.io as pio

# Create the bar plot
fig = px.bar(df1.head(50), title='Simple Linear Regression', barmode='group', color_discrete_sequence=px.colors.qualitative.Plotly)

# Customize the layout
fig.update_layout(
    xaxis_title='Index',
    yaxis_title='Values',
    legend_title='Data',
    width=1200,
    height=600,
    xaxis_tickangle=-45,  # Rotate x-axis labels for better readability
    showlegend=True,      # Show legend
    font=dict(size=12),   # Set font size
    plot_bgcolor='rgba(0,0,0,0)',  # Set plot background color
    paper_bgcolor='rgba(0,0,0,0)', # Set paper background color
    bargap=0.1,           # Set gap between bars
    xaxis=dict(showgrid=True, gridcolor='rgba(0,0,0,0.1)'), # Show x-axis gridlines
    yaxis=dict(showgrid=True, gridcolor='rgba(0,0,0,0.1)')  # Show y-axis gridlines
)

# Add data labels to the bars
fig.update_traces(texttemplate='%{y}', textposition='outside')

# Display the plot
fig.show()

# Save the plot as a PNG file
# pio.write_image(fig, 'bar_plot.png')
<script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("c996f2a7-e6be-4a58-946c-347ae44676ae")) { Plotly.newPlot( "c996f2a7-e6be-4a58-946c-347ae44676ae", [{"alignmentgroup":"True","hovertemplate":"variable=Actual Values\u003cbr\u003eindex=%{x}\u003cbr\u003evalue=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"Actual Values","marker":{"color":"#636EFA","pattern":{"shape":""}},"name":"Actual Values","offsetgroup":"Actual Values","orientation":"v","showlegend":true,"textposition":"outside","x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"xaxis":"x","y":[136.8,330.2,879.15,262.5,580.7,1040.2,360.7,852.15,829.05,187.6,242.1,267.6,523.45,407.5,499.85,1058.4,881.25,261.0,364.6,278.35,529.9,257.65,369.4,1079.6,386.6,1045.65,720.7,338.55,952.65,141.25,605.2,311.1,1032.2,267.1,323.4,315.65,200.65,559.1,987.7,1601.25,260.0,236.75,538.55,235.5,74.9,322.85,302.95,1179.55,434.2,291.6],"yaxis":"y","type":"bar","texttemplate":"%{y}"},{"alignmentgroup":"True","hovertemplate":"variable=Predicted Values\u003cbr\u003eindex=%{x}\u003cbr\u003evalue=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"Predicted Values","marker":{"color":"#EF553B","pattern":{"shape":""}},"name":"Predicted Values","offsetgroup":"Predicted Values","orientation":"v","showlegend":true,"textposition":"outside","x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"xaxis":"x","y":[137.63596209422496,339.076123136048,872.4176909564578,263.59854418489346,569.5076721193741,1024.2725815879862,359.5700353015933,856.4224424370079,869.418581859061,184.62200462010927,244.30427565830692,270.6964357153994,479.534399197468,407.30585510182675,497.37909832697943,1060.861712576228,892.4617367573935,261.84906387807865,361.0695898502917,282.5929018017403,489.63139982537086,254.80115749919597,373.565877756112,1111.5966414738582,395.259433560616,1001.4793524477698,734.1587615664622,335.6771328256649,956.3927456835702,149.13254696757963,614.4943085803271,306.58577458091526,1039.2681270749704,273.0457378416936,324.0805776490637,319.38197339647525,197.7181143454089,564.7090975635391,983.8845790763748,1579.2077349096535,263.1486778202839,259.599732055031,550.9131957155134,224.61012591873418,68.65645285409698,321.5813200678996,307.5854776133809,1178.4767743458083,438.64654516962406,291.79016970042403],"yaxis":"y","type":"bar","texttemplate":"%{y}"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"Index"},"tickangle":-45,"showgrid":true,"gridcolor":"rgba(0,0,0,0.1)"},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"Values"},"showgrid":true,"gridcolor":"rgba(0,0,0,0.1)"},"legend":{"title":{"text":"Data"},"tracegroupgap":0},"title":{"text":"Simple Linear Regression"},"barmode":"group","font":{"size":12},"width":1200,"height":600,"showlegend":true,"plot_bgcolor":"rgba(0,0,0,0)","paper_bgcolor":"rgba(0,0,0,0)","bargap":0.1}, {"responsive": true} ).then(function(){

var gd = document.getElementById('c996f2a7-e6be-4a58-946c-347ae44676ae'); var x = new MutationObserver(function (mutations, observer) {{ var display = window.getComputedStyle(gd).display; if (!display || display === 'none') {{ console.log([gd, 'removed!']); Plotly.purge(gd); observer.disconnect(); }} }});

// Listen for the removal of the full notebook cells var notebookContainer = gd.closest('#notebook-container'); if (notebookContainer) {{ x.observe(notebookContainer, {childList: true}); }}

// Listen for the clearing of the current output cell var outputEl = gd.closest('.output'); if (outputEl) {{ x.observe(outputEl, {childList: true}); }}

                    })                };                });            </script>        </div>
accuracy1 = r2_score(y_test, predict1)
print("Accuracy of Simple Linear Regression:", accuracy1)
Accuracy of Simple Linear Regression: 0.99849322863788

Support Vector Regression

model2 = SVR(kernel="rbf", gamma = 0.01, C=100)
build2 = model2.fit(X_train.reshape(-1, 1), y_train)
predict2 = model2.predict(X_test.reshape(-1, 1))
df2 = pd.DataFrame(list(zip(y_test, predict2)), columns=["Actual Values", "Predicted Values"])
import pandas as pd

# Assuming df2 is your DataFrame
data = {'Actual Values': df2['Actual Values'], 'Predicted Values': df2['Predicted Values']}
df_table = pd.DataFrame(data)

styled_df_table = df_table.head(10).style.set_table_styles([
    {'selector': 'th.row_heading', 'props': 'display: none;'}
]).set_properties(**{'text-align': 'center'})

styled_df_table
<style type="text/css"> #T_b70f3 th.row_heading { display: none; } #T_b70f3_row0_col0, #T_b70f3_row0_col1, #T_b70f3_row1_col0, #T_b70f3_row1_col1, #T_b70f3_row2_col0, #T_b70f3_row2_col1, #T_b70f3_row3_col0, #T_b70f3_row3_col1, #T_b70f3_row4_col0, #T_b70f3_row4_col1, #T_b70f3_row5_col0, #T_b70f3_row5_col1, #T_b70f3_row6_col0, #T_b70f3_row6_col1, #T_b70f3_row7_col0, #T_b70f3_row7_col1, #T_b70f3_row8_col0, #T_b70f3_row8_col1, #T_b70f3_row9_col0, #T_b70f3_row9_col1 { text-align: center; } </style>
Β  Actual Values Predicted Values
0 1023.250000 1016.899042
1 392.050000 392.051720
2 550.900000 533.321320
3 301.100000 302.149611
4 362.300000 352.221443
5 212.900000 214.536149
6 264.000000 263.939771
7 631.750000 608.350294
8 967.900000 966.007576
9 574.700000 545.773854
import plotly.express as px

# Create the bar plot
fig = px.bar(df2.head(50), title='Simple Linear Regression', barmode='group', color_discrete_sequence=px.colors.qualitative.Plotly)

# Customize the layout
fig.update_layout(
    xaxis_title='Index',
    yaxis_title='Values',
    legend_title='Data',
    width=1200,
    height=600,
    xaxis_tickangle=-45,  # Rotate x-axis labels for better readability
    showlegend=True,      # Show legend
    font=dict(size=12),   # Set font size
    plot_bgcolor='rgba(0,0,0,0)',  # Set plot background color
    paper_bgcolor='rgba(0,0,0,0)', # Set paper background color
    bargap=0.1,           # Set gap between bars
    xaxis=dict(showgrid=True, gridcolor='rgba(0,0,0,0.1)'), # Show x-axis gridlines
    yaxis=dict(showgrid=True, gridcolor='rgba(0,0,0,0.1)')  # Show y-axis gridlines
)

# Add data labels to the bars
fig.update_traces(texttemplate='%{y}', textposition='outside')

# Display the plot
fig.show()
<script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("69432e1b-e138-4fd8-8336-3c14ef0a0a8b")) { Plotly.newPlot( "69432e1b-e138-4fd8-8336-3c14ef0a0a8b", [{"alignmentgroup":"True","hovertemplate":"variable=Actual Values\u003cbr\u003eindex=%{x}\u003cbr\u003evalue=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"Actual Values","marker":{"color":"#636EFA","pattern":{"shape":""}},"name":"Actual Values","offsetgroup":"Actual Values","orientation":"v","showlegend":true,"textposition":"outside","x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"xaxis":"x","y":[1023.25,392.05,550.9,301.1,362.3,212.9,264.0,631.75,967.9,574.7,714.05,646.75,287.25,92.0,1003.65,272.3,134.85,339.9,313.25,180.9,1030.9,865.85,497.25,97.7,158.9,589.15,1156.95,983.15,267.85,486.9,324.9,816.15,297.1,1092.95,355.0,860.85,1097.7,396.5,277.4,495.75,229.2,908.35,594.4,321.3,527.7,630.2,307.3,901.8,215.8,130.2],"yaxis":"y","type":"bar","texttemplate":"%{y}"},{"alignmentgroup":"True","hovertemplate":"variable=Predicted Values\u003cbr\u003eindex=%{x}\u003cbr\u003evalue=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"Predicted Values","marker":{"color":"#EF553B","pattern":{"shape":""}},"name":"Predicted Values","offsetgroup":"Predicted Values","orientation":"v","showlegend":true,"textposition":"outside","x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"xaxis":"x","y":[1016.8990424225356,392.05171989321735,533.3213201188755,302.1496111341645,352.2214426052922,214.53614888137815,263.93977143142286,608.3502943789134,966.0075764411533,545.7738543882349,660.2797934214257,644.0264947836008,279.92260226415635,86.6234120158316,987.7999591347307,270.1119759514702,135.48007729369454,331.08753620956975,315.10791082149035,183.93253838682028,1026.0439441355184,845.6344318775188,502.9131126846633,101.9386941117865,163.93858502588807,587.2005235469064,1159.4627723709757,958.8750676472146,273.2216746202479,491.3885134929395,324.99985907955903,824.6379555792638,298.638030371677,1091.8203393781803,345.5799771468368,840.1157068812181,1103.6527188339899,401.30020851752806,274.3989643976148,489.54247212000956,224.14366584724974,903.0701562278597,582.612399120163,309.7598880955743,533.1541108646117,664.1112627679095,314.7669069356206,920.0232053072618,213.51052374569656,123.9116381444253],"yaxis":"y","type":"bar","texttemplate":"%{y}"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"Index"},"tickangle":-45,"showgrid":true,"gridcolor":"rgba(0,0,0,0.1)"},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"Values"},"showgrid":true,"gridcolor":"rgba(0,0,0,0.1)"},"legend":{"title":{"text":"Data"},"tracegroupgap":0},"title":{"text":"Simple Linear Regression"},"barmode":"group","font":{"size":12},"width":1200,"height":600,"showlegend":true,"plot_bgcolor":"rgba(0,0,0,0)","paper_bgcolor":"rgba(0,0,0,0)","bargap":0.1}, {"responsive": true} ).then(function(){

var gd = document.getElementById('69432e1b-e138-4fd8-8336-3c14ef0a0a8b'); var x = new MutationObserver(function (mutations, observer) {{ var display = window.getComputedStyle(gd).display; if (!display || display === 'none') {{ console.log([gd, 'removed!']); Plotly.purge(gd); observer.disconnect(); }} }});

// Listen for the removal of the full notebook cells var notebookContainer = gd.closest('#notebook-container'); if (notebookContainer) {{ x.observe(notebookContainer, {childList: true}); }}

// Listen for the clearing of the current output cell var outputEl = gd.closest('.output'); if (outputEl) {{ x.observe(outputEl, {childList: true}); }}

                    })                };                });            </script>        </div>
accuracy2 = r2_score(y_test, predict2)
print("Accuracy of Support Vector Regression:", accuracy2)
Accuracy of Support Vector Regression: 0.9799364177634605

Decision Tree Regression

model3 = DecisionTreeRegressor()
build3 = model3.fit(X_train.reshape(-1, 1), y_train)
predict3 = model3.predict(X_test.reshape(-1, 1))
df3 = pd.DataFrame(list(zip(y_test, predict3)), columns=["Actual Values", "Predicted Values"])
import pandas as pd

# Assuming df3 is your DataFrame
data = {'Actual Values': df3['Actual Values'], 'Predicted Values': df3['Predicted Values']}
df_table = pd.DataFrame(data)

styled_df_table = df_table.head(10).style.set_table_styles([
    {'selector': 'th.row_heading', 'props': 'display: none;'}
]).set_properties(**{'text-align': 'center'})

styled_df_table
<style type="text/css"> #T_f9271 th.row_heading { display: none; } #T_f9271_row0_col0, #T_f9271_row0_col1, #T_f9271_row1_col0, #T_f9271_row1_col1, #T_f9271_row2_col0, #T_f9271_row2_col1, #T_f9271_row3_col0, #T_f9271_row3_col1, #T_f9271_row4_col0, #T_f9271_row4_col1, #T_f9271_row5_col0, #T_f9271_row5_col1, #T_f9271_row6_col0, #T_f9271_row6_col1, #T_f9271_row7_col0, #T_f9271_row7_col1, #T_f9271_row8_col0, #T_f9271_row8_col1, #T_f9271_row9_col0, #T_f9271_row9_col1 { text-align: center; } </style>
Β  Actual Values Predicted Values
0 1023.250000 1022.950000
1 392.050000 383.900000
2 550.900000 528.700000
3 301.100000 303.883333
4 362.300000 348.425000
5 212.900000 211.000000
6 264.000000 264.450000
7 631.750000 601.550000
8 967.900000 966.050000
9 574.700000 549.300000
import plotly.express as px

# Create the bar plot
fig = px.bar(df3.head(50), title='Simple Linear Regression', barmode='group', color_discrete_sequence=px.colors.qualitative.Plotly)

# Customize the layout
fig.update_layout(
    xaxis_title='Index',
    yaxis_title='Values',
    legend_title='Data',
    width=1200,
    height=600,
    xaxis_tickangle=-45,  # Rotate x-axis labels for better readability
    showlegend=True,      # Show legend
    font=dict(size=12),   # Set font size
    plot_bgcolor='rgba(0,0,0,0)',  # Set plot background color
    paper_bgcolor='rgba(0,0,0,0)', # Set paper background color
    bargap=0.1,           # Set gap between bars
    xaxis=dict(showgrid=True, gridcolor='rgba(0,0,0,0.1)'), # Show x-axis gridlines
    yaxis=dict(showgrid=True, gridcolor='rgba(0,0,0,0.1)')  # Show y-axis gridlines
)

# Add data labels to the bars
fig.update_traces(texttemplate='%{y}', textposition='outside')

# Display the plot
fig.show()
<script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("58264d26-7b71-4aac-b29e-861f820577fd")) { Plotly.newPlot( "58264d26-7b71-4aac-b29e-861f820577fd", [{"alignmentgroup":"True","hovertemplate":"variable=Actual Values\u003cbr\u003eindex=%{x}\u003cbr\u003evalue=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"Actual Values","marker":{"color":"#636EFA","pattern":{"shape":""}},"name":"Actual Values","offsetgroup":"Actual Values","orientation":"v","showlegend":true,"textposition":"outside","x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"xaxis":"x","y":[1023.25,392.05,550.9,301.1,362.3,212.9,264.0,631.75,967.9,574.7,714.05,646.75,287.25,92.0,1003.65,272.3,134.85,339.9,313.25,180.9,1030.9,865.85,497.25,97.7,158.9,589.15,1156.95,983.15,267.85,486.9,324.9,816.15,297.1,1092.95,355.0,860.85,1097.7,396.5,277.4,495.75,229.2,908.35,594.4,321.3,527.7,630.2,307.3,901.8,215.8,130.2],"yaxis":"y","type":"bar","texttemplate":"%{y}"},{"alignmentgroup":"True","hovertemplate":"variable=Predicted Values\u003cbr\u003eindex=%{x}\u003cbr\u003evalue=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"Predicted Values","marker":{"color":"#EF553B","pattern":{"shape":""}},"name":"Predicted Values","offsetgroup":"Predicted Values","orientation":"v","showlegend":true,"textposition":"outside","x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"xaxis":"x","y":[1022.95,383.9,528.7,303.8833333333333,348.425,211.0,264.45000000000005,601.55,966.05,549.3,663.4,639.15,275.65,88.4,1009.15,272.1,166.25,325.75,319.65,187.6,1074.6,841.45,510.7,101.88333333333333,172.775,579.525,1144.5,970.8,281.7,481.5,326.32500000000005,803.95,291.1,1051.45,343.1,872.15,1083.125,400.82,276.79999999999995,501.025,223.1,899.075,597.0,306.2,528.8,663.4,314.225,906.75,219.1,124.56666666666666],"yaxis":"y","type":"bar","texttemplate":"%{y}"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"Index"},"tickangle":-45,"showgrid":true,"gridcolor":"rgba(0,0,0,0.1)"},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"Values"},"showgrid":true,"gridcolor":"rgba(0,0,0,0.1)"},"legend":{"title":{"text":"Data"},"tracegroupgap":0},"title":{"text":"Simple Linear Regression"},"barmode":"group","font":{"size":12},"width":1200,"height":600,"showlegend":true,"plot_bgcolor":"rgba(0,0,0,0)","paper_bgcolor":"rgba(0,0,0,0)","bargap":0.1}, {"responsive": true} ).then(function(){

var gd = document.getElementById('58264d26-7b71-4aac-b29e-861f820577fd'); var x = new MutationObserver(function (mutations, observer) {{ var display = window.getComputedStyle(gd).display; if (!display || display === 'none') {{ console.log([gd, 'removed!']); Plotly.purge(gd); observer.disconnect(); }} }});

// Listen for the removal of the full notebook cells var notebookContainer = gd.closest('#notebook-container'); if (notebookContainer) {{ x.observe(notebookContainer, {childList: true}); }}

// Listen for the clearing of the current output cell var outputEl = gd.closest('.output'); if (outputEl) {{ x.observe(outputEl, {childList: true}); }}

                    })                };                });            </script>        </div>
accuracy3 = r2_score(y_test, predict3)
print("Accuracy of Decision Tree Regression:", accuracy3)
Accuracy of Decision Tree Regression: 0.9973466715973613

Random Forest Regression

model4 = RandomForestRegressor(n_estimators=100)
build4 = model4.fit(X_train.reshape(-1, 1), y_train)
predict4 = model4.predict(X_test.reshape(-1, 1))
df4 = pd.DataFrame(list(zip(y_test, predict4)), columns=["Actual Values", "Predicted Values"])
import pandas as pd

# Assuming df4 is your DataFrame
data = {'Actual Values': df4['Actual Values'], 'Predicted Values': df4['Predicted Values']}
df_table = pd.DataFrame(data)

styled_df_table = df_table.head(10).style.set_table_styles([
    {'selector': 'th.row_heading', 'props': 'display: none;'}
]).set_properties(**{'text-align': 'center'})

styled_df_table
<style type="text/css"> #T_41180 th.row_heading { display: none; } #T_41180_row0_col0, #T_41180_row0_col1, #T_41180_row1_col0, #T_41180_row1_col1, #T_41180_row2_col0, #T_41180_row2_col1, #T_41180_row3_col0, #T_41180_row3_col1, #T_41180_row4_col0, #T_41180_row4_col1, #T_41180_row5_col0, #T_41180_row5_col1, #T_41180_row6_col0, #T_41180_row6_col1, #T_41180_row7_col0, #T_41180_row7_col1, #T_41180_row8_col0, #T_41180_row8_col1, #T_41180_row9_col0, #T_41180_row9_col1 { text-align: center; } </style>
Β  Actual Values Predicted Values
0 1023.250000 1019.395500
1 392.050000 392.366250
2 550.900000 530.443500
3 301.100000 303.901994
4 362.300000 348.924955
5 212.900000 211.364093
6 264.000000 264.753700
7 631.750000 603.482300
8 967.900000 968.403500
9 574.700000 550.432000
import plotly.express as px

# Create the bar plot
fig = px.bar(df4.head(50), title='Simple Linear Regression', barmode='group', color_discrete_sequence=px.colors.qualitative.Plotly)

# Customize the layout
fig.update_layout(
    xaxis_title='Index',
    yaxis_title='Values',
    legend_title='Data',
    width=1200,
    height=600,
    xaxis_tickangle=-45,  # Rotate x-axis labels for better readability
    showlegend=True,      # Show legend
    font=dict(size=12),   # Set font size
    plot_bgcolor='rgba(0,0,0,0)',  # Set plot background color
    paper_bgcolor='rgba(0,0,0,0)', # Set paper background color
    bargap=0.1,           # Set gap between bars
    xaxis=dict(showgrid=True, gridcolor='rgba(0,0,0,0.1)'), # Show x-axis gridlines
    yaxis=dict(showgrid=True, gridcolor='rgba(0,0,0,0.1)')  # Show y-axis gridlines
)

# Add data labels to the bars
fig.update_traces(texttemplate='%{y}', textposition='outside')

# Display the plot
fig.show()
<script type="text/javascript"> require(["plotly"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("048fb2f3-6423-40ca-85f9-7e5c5ed82678")) { Plotly.newPlot( "048fb2f3-6423-40ca-85f9-7e5c5ed82678", [{"alignmentgroup":"True","hovertemplate":"variable=Actual Values\u003cbr\u003eindex=%{x}\u003cbr\u003evalue=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"Actual Values","marker":{"color":"#636EFA","pattern":{"shape":""}},"name":"Actual Values","offsetgroup":"Actual Values","orientation":"v","showlegend":true,"textposition":"outside","x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"xaxis":"x","y":[1023.25,392.05,550.9,301.1,362.3,212.9,264.0,631.75,967.9,574.7,714.05,646.75,287.25,92.0,1003.65,272.3,134.85,339.9,313.25,180.9,1030.9,865.85,497.25,97.7,158.9,589.15,1156.95,983.15,267.85,486.9,324.9,816.15,297.1,1092.95,355.0,860.85,1097.7,396.5,277.4,495.75,229.2,908.35,594.4,321.3,527.7,630.2,307.3,901.8,215.8,130.2],"yaxis":"y","type":"bar","texttemplate":"%{y}"},{"alignmentgroup":"True","hovertemplate":"variable=Predicted Values\u003cbr\u003eindex=%{x}\u003cbr\u003evalue=%{y}\u003cextra\u003e\u003c\u002fextra\u003e","legendgroup":"Predicted Values","marker":{"color":"#EF553B","pattern":{"shape":""}},"name":"Predicted Values","offsetgroup":"Predicted Values","orientation":"v","showlegend":true,"textposition":"outside","x":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"xaxis":"x","y":[1019.3954999999991,392.3662500000007,530.4434999999993,303.90199404761916,348.92495476190453,211.36409285714294,264.7536999999999,603.4823000000004,968.4035000000007,550.4320000000006,666.3460000000009,638.563333333334,276.13500000000005,87.66599999999991,995.9294999999989,271.7806476190476,156.57650000000007,333.718,318.6921750000003,187.03314999999995,1064.0697500000015,852.9247499999989,501.4181999999995,101.76608869047621,173.2898583333332,575.9095000000008,1153.4229999999998,974.3377500000017,278.1885500000003,485.7586333333335,326.8939833333332,807.5198809523797,292.606157251082,1068.1144999999983,342.41678214285673,858.7251178571428,1084.5449583333332,400.5903960317459,276.1703166666667,499.23088333333345,224.14599999999982,899.1394932539683,593.1190000000001,304.6756500000001,526.3097500000007,666.914000000001,313.9448749999997,911.9646666666666,216.39856428571417,124.65410357142859],"yaxis":"y","type":"bar","texttemplate":"%{y}"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"xaxis":{"anchor":"y","domain":[0.0,1.0],"title":{"text":"Index"},"tickangle":-45,"showgrid":true,"gridcolor":"rgba(0,0,0,0.1)"},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"text":"Values"},"showgrid":true,"gridcolor":"rgba(0,0,0,0.1)"},"legend":{"title":{"text":"Data"},"tracegroupgap":0},"title":{"text":"Simple Linear Regression"},"barmode":"group","font":{"size":12},"width":1200,"height":600,"showlegend":true,"plot_bgcolor":"rgba(0,0,0,0)","paper_bgcolor":"rgba(0,0,0,0)","bargap":0.1}, {"responsive": true} ).then(function(){

var gd = document.getElementById('048fb2f3-6423-40ca-85f9-7e5c5ed82678'); var x = new MutationObserver(function (mutations, observer) {{ var display = window.getComputedStyle(gd).display; if (!display || display === 'none') {{ console.log([gd, 'removed!']); Plotly.purge(gd); observer.disconnect(); }} }});

// Listen for the removal of the full notebook cells var notebookContainer = gd.closest('#notebook-container'); if (notebookContainer) {{ x.observe(notebookContainer, {childList: true}); }}

// Listen for the clearing of the current output cell var outputEl = gd.closest('.output'); if (outputEl) {{ x.observe(outputEl, {childList: true}); }}

                    })                };                });            </script>        </div>
accuracy4 = r2_score(y_test, predict4)
print("Accuracy of Random Forest Regression:", accuracy4)
Accuracy of Random Forest Regression: 0.9979437067080489

Results Visualization:

The script visualizes the accuracies of the four models using a bar chart, making it easy to compare their performance.

dict1 = {
    "Model": ["Simple Linear Regression", "Support Vector Regression", "Decision Tree Regression", "Random Forest Regression"],
    "Accuracy": np.array([accuracy1, accuracy2, accuracy3, accuracy4])
}
df = pd.DataFrame(dict1)
styled_df = df.style.set_table_styles([{'selector': 'tr:hover','props': [('background-color', 'yellow')]}])
styled_df
<style type="text/css"> #T_48387 tr:hover { background-color: yellow; } </style>
Β  Model Accuracy
0 Simple Linear Regression 0.998493
1 Support Vector Regression 0.979936
2 Decision Tree Regression 0.997347
3 Random Forest Regression 0.997944
models = ['SLR', 'SVR', 'DTR', 'RFR']
acc = [accuracy1, accuracy2, accuracy3, accuracy4]

plt.figure(figsize=(20, 10))
plt.title('Comparison of Accuracies of models')
plt.yticks(np.linspace(0, 1, 21))
plt.ylabel("Accuracy")
plt.xlabel("Models")

# Create a DataFrame from the models and acc arrays
df_acc = pd.DataFrame({'Model': models, 'Accuracy': acc})

plot = sns.barplot(x='Model', y='Accuracy', data=df_acc, palette='viridis')
for p in plot.patches:
    plot.annotate(format(p.get_height(), '.2f'), 
                   (p.get_x() + p.get_width() / 2., p.get_height()), 
                   ha = 'center', va = 'center', 
                   xytext = (0, 9), 
                   textcoords = 'offset points')

plt.show()

png

Find out the closing price of the company of that day

html_table = future_stock_value.to_html(index=False, justify='center', classes='table table-striped table-hover table-bordered')
styled_table = f'<style>table {{border-collapse: collapse; width: 50%;}} th, td {{border: 1px solid #dddddd; text-align: left; padding: 8px;}} th {{background-color: #f2f2f2;}}</style>{html_table}'
display(HTML(styled_table))
<style>table {border-collapse: collapse; width: 50%;} th, td {border: 1px solid #dddddd; text-align: left; padding: 8px;} th {background-color: #f2f2f2;}</style>
Date Open Predicted
11-May-22 718.0 717.130664

Predicting Future Stock Price:

Finally, the script predicts the closing price of a stock for a specific date using the model with the highest accuracy.

models = np.array(df['Model'])
accuracy = np.array(df['Accuracy'])
highest_accuracy=0.0
best_model=""
for i in range(len(accuracy)) :
    if accuracy[i] >= highest_accuracy :
        highest_accuracy=accuracy[i]
        best_model=models[i]
slr, svr, dtr, rfr = [], [], [], []

if best_model == models[0] :
    future_stock_value['Predicted'] = model1.predict(future_stock_value.Open.values.reshape(-1, 1))
elif best_model == models[1] :
    future_stock_value['Predicted'] = model2.predict(future_stock_value.Open.values.reshape(-1, 1))
elif best_model == models[2] :
    future_stock_value['Predicted'] = model3.predict(future_stock_value.Open.values.reshape(-1, 1))
elif best_model == models[3] :
    future_stock_value['Predicted'] = model4.predict(future_stock_value.Open.values.reshape(-1, 1))
print(future_stock_value.to_string(index=False))
     Date  Open  Predicted
11-May-22 718.0  717.24537
fig, ax = plt.subplots()
ax.axis('off')

props = dict(boxstyle='round', facecolor='lightblue', alpha=0.5)
ax.text(0.5, 0.5, 'THANK YOU', va='center', ha='center', fontsize=30, fontweight='bold', bbox=props)

plt.show()

png

About

This project demonstrates how machine learning models πŸ€– can be used to predict stock prices πŸ’Ή based on historical data πŸ“Š, helping investors make informed decisions πŸ’‘.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published