Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,8 +12,7 @@ from sklearn.svm import SVC
|
|
| 12 |
from sklearn.neighbors import KNeighborsClassifier
|
| 13 |
from sklearn.tree import DecisionTreeClassifier
|
| 14 |
from sklearn.naive_bayes import GaussianNB
|
| 15 |
-
from sklearn.metrics import
|
| 16 |
-
from tabulate import tabulate
|
| 17 |
from scipy import stats
|
| 18 |
|
| 19 |
# File uploader
|
|
@@ -32,6 +31,7 @@ if uploaded_file is not None:
|
|
| 32 |
df[column] = le.fit_transform(df[column].astype(str))
|
| 33 |
|
| 34 |
# Handle missing values (impute numerical columns with median and categorical columns with mode)
|
|
|
|
| 35 |
# Handle categorical columns
|
| 36 |
categorical_columns = df.select_dtypes(include=['object']).columns
|
| 37 |
if len(categorical_columns) > 0:
|
|
@@ -122,7 +122,7 @@ if uploaded_file is not None:
|
|
| 122 |
# Append results
|
| 123 |
results.append([name, accuracy, classification_report_output])
|
| 124 |
|
| 125 |
-
# Display results in a table
|
| 126 |
st.subheader("Model Performance Results")
|
| 127 |
results_df = pd.DataFrame(results, columns=["Model", "Accuracy", "Classification Report"])
|
| 128 |
|
|
|
|
| 12 |
from sklearn.neighbors import KNeighborsClassifier
|
| 13 |
from sklearn.tree import DecisionTreeClassifier
|
| 14 |
from sklearn.naive_bayes import GaussianNB
|
| 15 |
+
from sklearn.metrics import classification_report, accuracy_score
|
|
|
|
| 16 |
from scipy import stats
|
| 17 |
|
| 18 |
# File uploader
|
|
|
|
| 31 |
df[column] = le.fit_transform(df[column].astype(str))
|
| 32 |
|
| 33 |
# Handle missing values (impute numerical columns with median and categorical columns with mode)
|
| 34 |
+
|
| 35 |
# Handle categorical columns
|
| 36 |
categorical_columns = df.select_dtypes(include=['object']).columns
|
| 37 |
if len(categorical_columns) > 0:
|
|
|
|
| 122 |
# Append results
|
| 123 |
results.append([name, accuracy, classification_report_output])
|
| 124 |
|
| 125 |
+
# Display results in a table
|
| 126 |
st.subheader("Model Performance Results")
|
| 127 |
results_df = pd.DataFrame(results, columns=["Model", "Accuracy", "Classification Report"])
|
| 128 |
|