Spaces:
Runtime error
Runtime error
# -*- coding: utf-8 -*- | |
""" | |
Created on Sat Apr 23 20:23:23 2022 | |
@author: kbpat | |
""" | |
import pandas as pd | |
import streamlit as st | |
df1= pd.read_excel("INDIA INFLATION RATE.xlsx",names=('Year','IR','AC'),parse_dates=[0]) | |
from statsmodels.tsa.stattools import adfuller | |
def adf_test(dataset): | |
dftest = adfuller(dataset, autolag = 'AIC') | |
print("1. ADF : ",dftest[0]) | |
print("2. P-Value : ", dftest[1]) | |
print("3. Num Of Lags : ", dftest[2]) | |
print("4. Num Of Observations Used For ADF Regression and Critical Values Calculation :", dftest[3]) | |
print("5. Critical Values :") | |
for key, val in dftest[4].items(): | |
print("\t",key, ": ", val) | |
adf_test(df1['IR']) | |
from pmdarima import auto_arima | |
import warnings | |
warnings.filterwarnings("ignore") | |
stepwise_fit = auto_arima(df1['IR'], trace=True, | |
suppress_warnings=True) | |
stepwise_fit.summary() | |
prediction=stepwise_fit.predict() | |
print(prediction) | |
def main(): | |
st.title("Model Deployment:Inflation Rate") | |
html_temp = """ | |
<div style="background-color:tomato;padding:10px"> | |
<h2 style="color:white;text-align:center;"> INFLATION RATE </h2> | |
</div> | |
""" | |
st.markdown(html_temp,unsafe_allow_html=True) | |
Inflation = st.text_input("Inflation","Type Here") | |
Year = st.text_input("Year","Type Here") | |
result="" | |
if st.button("Predict"): | |
result=prediction | |
st.success('The output is {}'.format(result)) | |
if st.button("About"): | |
st.text("https://www.macrotrends.net/countries/IND/india/inflation-rate-cpi") | |
st.text("Built with Streamlit") | |
if __name__=='__main__': | |
main() | |