Commit
·
c7896b1
1
Parent(s):
32e75fb
Update app.py
Browse files
app.py
CHANGED
|
@@ -175,14 +175,22 @@ if task == "Clustering":
|
|
| 175 |
|
| 176 |
@st.cache(allow_output_mutation=True)
|
| 177 |
def fit_text_clf(X, y):
|
| 178 |
-
text_clf.fit(X, y)
|
| 179 |
return text_clf
|
| 180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
if task == "Classification":
|
| 182 |
#text_clf.fit(df[column_name], df[labels_column_name])
|
| 183 |
text_clf = fit_text_clf(df[column_name], df[labels_column_name])
|
| 184 |
else:
|
| 185 |
-
kmeans = cluster_clf.fit(df[column_name])
|
|
|
|
|
|
|
| 186 |
labels = list(cluster_clf['cluster'].labels_)
|
| 187 |
#text_clf.fit(df[column_name], labels)
|
| 188 |
text_clf = fit_text_clf(df[column_name], labels)
|
|
|
|
| 175 |
|
| 176 |
@st.cache(allow_output_mutation=True)
|
| 177 |
def fit_text_clf(X, y):
|
| 178 |
+
text_clf = text_clf.fit(X, y)
|
| 179 |
return text_clf
|
| 180 |
|
| 181 |
+
@st.cache(allow_output_mutation=True)
|
| 182 |
+
def fit_cluster_clf(X):
|
| 183 |
+
cluster_clf = cluster_clf.fit(X)
|
| 184 |
+
return cluster_clf
|
| 185 |
+
|
| 186 |
+
|
| 187 |
if task == "Classification":
|
| 188 |
#text_clf.fit(df[column_name], df[labels_column_name])
|
| 189 |
text_clf = fit_text_clf(df[column_name], df[labels_column_name])
|
| 190 |
else:
|
| 191 |
+
#kmeans = cluster_clf.fit(df[column_name])
|
| 192 |
+
cluster_clf = fit_cluster_clf(df[column_name])
|
| 193 |
+
kmeans = cluster_clf
|
| 194 |
labels = list(cluster_clf['cluster'].labels_)
|
| 195 |
#text_clf.fit(df[column_name], labels)
|
| 196 |
text_clf = fit_text_clf(df[column_name], labels)
|