Update app.py
Browse files
app.py
CHANGED
|
@@ -67,10 +67,13 @@ def normalize(X, columns=['open','high','low','close']):
|
|
| 67 |
Y = Rm.transform(X_copy, columns)
|
| 68 |
return Y, Rm
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
# Advanced features
|
| 76 |
def calculate_rsi(d, window=14):
|
|
|
|
| 67 |
Y = Rm.transform(X_copy, columns)
|
| 68 |
return Y, Rm
|
| 69 |
|
| 70 |
+
def remove_outliers(df, epsilon):
|
| 71 |
+
# compute z-scores as a NumPy array…
|
| 72 |
+
z = stats.zscore(df['low'])
|
| 73 |
+
# …then build a boolean mask via np.abs
|
| 74 |
+
mask = np.abs(z) < epsilon
|
| 75 |
+
# apply it back against the original DataFrame’s index
|
| 76 |
+
return df.loc[mask].reset_index(drop=True)
|
| 77 |
|
| 78 |
# Advanced features
|
| 79 |
def calculate_rsi(d, window=14):
|