atsuga commited on
Commit
e7e5cc5
·
verified ·
1 Parent(s): 96ba1cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -19,21 +19,21 @@ with open('scaler.pkl', 'rb') as scaler_file:
19
  def predict_7_days(sell_features, buy_features, linear_model, scaler):
20
  # Data dari frontend
21
  # Ambil nilai input (pastikan semuanya adalah angka)
22
- sell_1 = float(sell_features[7])
23
- sell_2 = float(sell_features[6])
24
- sell_3 = float(sell_features[5])
25
- sell_4 = float(sell_features[4])
26
- sell_5 = float(sell_features[3])
27
- sell_6 = float(sell_features[2])
28
- sell_7 = float(sell_features[1])
29
-
30
- buy_1 = float(buy_features[7])
31
- buy_2 = float(buy_features[6])
32
- buy_3 = float(buy_features[5])
33
- buy_4 = float(buy_features[4])
34
- buy_5 = float(buy_features[3])
35
- buy_6 = float(buy_features[2])
36
- buy_7 = float(buy_features[1])
37
 
38
  # Menyusun data jual dan beli sebagai pasangan (sell, buy)
39
  data = np.array([
@@ -80,7 +80,7 @@ def predict_7_days(sell_features, buy_features, linear_model, scaler):
80
 
81
 
82
  # Harga terakhir
83
- last_price = [sell_features[0], buy_features[0]]
84
 
85
  # Hitung persentase perubahan harian
86
  predictions_df['sell_change'] = predictions_df['sell'].pct_change().fillna(0) * 100
 
19
  def predict_7_days(sell_features, buy_features, linear_model, scaler):
20
  # Data dari frontend
21
  # Ambil nilai input (pastikan semuanya adalah angka)
22
+ sell_1 = float(sell_features[6])
23
+ sell_2 = float(sell_features[5])
24
+ sell_3 = float(sell_features[4])
25
+ sell_4 = float(sell_features[3])
26
+ sell_5 = float(sell_features[2])
27
+ sell_6 = float(sell_features[1])
28
+ sell_7 = float(sell_features[0])
29
+
30
+ buy_1 = float(buy_features[6])
31
+ buy_2 = float(buy_features[5])
32
+ buy_3 = float(buy_features[4])
33
+ buy_4 = float(buy_features[3])
34
+ buy_5 = float(buy_features[2])
35
+ buy_6 = float(buy_features[1])
36
+ buy_7 = float(buy_features[0])
37
 
38
  # Menyusun data jual dan beli sebagai pasangan (sell, buy)
39
  data = np.array([
 
80
 
81
 
82
  # Harga terakhir
83
+ last_price = [sell_features[7], buy_features[7]]
84
 
85
  # Hitung persentase perubahan harian
86
  predictions_df['sell_change'] = predictions_df['sell'].pct_change().fillna(0) * 100