Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,8 +11,6 @@ import pickle
|
|
11 |
import hdbscan
|
12 |
|
13 |
|
14 |
-
class EuclideanDistance64:
|
15 |
-
pass
|
16 |
# # Define the prediction function
|
17 |
def predict_ann(age, workclass, education, occupation, race, gender, capital_gain, capital_loss, hours_per_week, native_country):
|
18 |
# columns = {
|
@@ -83,6 +81,8 @@ def predict_hb(age, workclass, education, occupation, race, gender, capital_ga
|
|
83 |
)
|
84 |
|
85 |
prediction = clusterer.fit_predict(X)
|
|
|
|
|
86 |
|
87 |
return f"Predicted Cluster (HDBSCAN): {prediction[-1]}"
|
88 |
|
|
|
11 |
import hdbscan
|
12 |
|
13 |
|
|
|
|
|
14 |
# # Define the prediction function
|
15 |
def predict_ann(age, workclass, education, occupation, race, gender, capital_gain, capital_loss, hours_per_week, native_country):
|
16 |
# columns = {
|
|
|
81 |
)
|
82 |
|
83 |
prediction = clusterer.fit_predict(X)
|
84 |
+
filename = 'hdbscan_model.pkl'
|
85 |
+
pickle.dump(clusterer, open(filename, 'wb'))
|
86 |
|
87 |
return f"Predicted Cluster (HDBSCAN): {prediction[-1]}"
|
88 |
|