ErenKontas commited on
Commit
55d41e1
·
verified ·
1 Parent(s): 9cd0b8c

Upload 4 files

Browse files
Files changed (4) hide show
  1. BTC-Hourly.csv +0 -0
  2. ML.pkl +3 -0
  3. app.py +59 -0
  4. requirements.txt +4 -0
BTC-Hourly.csv ADDED
The diff for this file is too large to render. See raw diff
 
ML.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c4de9ae0d635f9a1fcb4a74fcd88387e43b577608319b1b77ec593c4475bdbb
3
+ size 92817
app.py ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import streamlit as st
3
+
4
+ from sklearn.preprocessing import StandardScaler
5
+ from sklearn.compose import ColumnTransformer
6
+
7
+ import joblib
8
+
9
+
10
+ # Load data and update column names
11
+ df = pd.read_csv('BTC-Hourly.csv')
12
+ df.columns = df.columns.str.replace(r'[\s\.]', '_', regex=True)
13
+
14
+ # Select dependent and independent variables
15
+ x = df[["open", "high", "low", "close", "Volume_BTC", "Volume_USD"]]
16
+
17
+ # Preprocessing (StandardScaler)
18
+ preprocessor = ColumnTransformer(
19
+ transformers=[
20
+ ('num', StandardScaler(), ["open", "high", "low", "close", "Volume_BTC", "Volume_USD"])
21
+ ]
22
+ )
23
+
24
+ # Streamlit application
25
+ def fiyat_pred(open, high, low, close, Volume_BTC, Volume_USD):
26
+ input_data = pd.DataFrame({
27
+ 'open': [open],
28
+ 'high': [high],
29
+ 'low': [low],
30
+ 'close': [close],
31
+ 'Volume_BTC': [Volume_BTC],
32
+ 'Volume_USD': [Volume_USD]
33
+ })
34
+ input_data_transformed = preprocessor.fit_transform(input_data)
35
+
36
+ model = joblib.load('ML.pkl')
37
+
38
+ prediction = model.predict(input_data_transformed)
39
+ return float(prediction[0])
40
+
41
+ # Streamlit interface
42
+ def main():
43
+ st.title("Prediction Model")
44
+ st.write("Enter Input Data")
45
+
46
+ open = st.slider('Open', float(df['open'].min()), float(df['open'].max()))
47
+ high = st.slider('High', float(df['high'].min()), float(df['high'].max()))
48
+ low = st.slider('Low', float(df['low'].min()), float(df['low'].max()))
49
+ close = st.slider('Close', float(df['close'].min()), float(df['close'].max()))
50
+ Volume_BTC = st.slider('Volume BTC', float(df['Volume_BTC'].min()), float(df['Volume_BTC'].max()))
51
+ Volume_USD = st.slider('Volume USD', float(df['Volume_USD'].min()), float(df['Volume_USD'].max()))
52
+
53
+ if st.button('Predict'):
54
+ fiyat = fiyat_pred(open, high, low, close, Volume_BTC, Volume_USD)
55
+ st.write(f'The predicted price is: {fiyat:.2f}')
56
+
57
+ if __name__ == '__main__':
58
+ main()
59
+
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ streamlit
2
+ scikit-learn
3
+ pandas
4
+ tensorflow