Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -233,23 +233,23 @@ def main():
|
|
233 |
insurance_claims = pd.read_csv(selected_csv)
|
234 |
|
235 |
num_rows = int(insurance_claims.shape[0]*int(num_lines)/100)
|
236 |
-
|
237 |
st.write("Rows to be processed: " + str(num_rows))
|
238 |
-
|
239 |
-
all_columns = insurance_claims.columns.tolist()
|
240 |
-
selected_columns = st.multiselect("Choose columns", all_columns, default=all_columns)
|
241 |
|
|
|
|
|
|
|
|
|
242 |
if st.button("Prediction"):
|
243 |
-
|
244 |
-
|
245 |
-
s = setup(insurance_claims, session_id = 123, remove_multicollinearity=p_remove_multicollinearity, multicollinearity_threshold=p_multicollinearity_threshold,
|
246 |
# remove_outliers=p_remove_outliers, outliers_method=p_outliers_method,
|
247 |
transformation=p_transformation,
|
248 |
normalize=p_normalize, pca=p_pca, pca_method=p_pca_method)
|
249 |
|
250 |
exp_anomaly = AnomalyExperiment()
|
251 |
# init setup on exp
|
252 |
-
exp_anomaly.setup(
|
253 |
|
254 |
with st.spinner("Analyzing..."):
|
255 |
# train model
|
|
|
233 |
insurance_claims = pd.read_csv(selected_csv)
|
234 |
|
235 |
num_rows = int(insurance_claims.shape[0]*int(num_lines)/100)
|
236 |
+
insurance_claims_reduced = insurance_claims.head(num_rows)
|
237 |
st.write("Rows to be processed: " + str(num_rows))
|
|
|
|
|
|
|
238 |
|
239 |
+
all_columns = insurance_claims_reduced.columns.tolist()
|
240 |
+
selected_columns = st.multiselect("Choose columns", all_columns, default=all_columns)
|
241 |
+
insurance_claims_reduced = insurance_claims_reduced[selected_columns].copy()
|
242 |
+
|
243 |
if st.button("Prediction"):
|
244 |
+
|
245 |
+
s = setup(insurance_claims_reduced, session_id = 123, remove_multicollinearity=p_remove_multicollinearity, multicollinearity_threshold=p_multicollinearity_threshold,
|
|
|
246 |
# remove_outliers=p_remove_outliers, outliers_method=p_outliers_method,
|
247 |
transformation=p_transformation,
|
248 |
normalize=p_normalize, pca=p_pca, pca_method=p_pca_method)
|
249 |
|
250 |
exp_anomaly = AnomalyExperiment()
|
251 |
# init setup on exp
|
252 |
+
exp_anomaly.setup(insurance_claims_reduced, session_id = 123)
|
253 |
|
254 |
with st.spinner("Analyzing..."):
|
255 |
# train model
|