File size: 1,631 Bytes
c551e91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
# -*- 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()