Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,13 +99,14 @@ with App:
|
|
| 99 |
input = pd.DataFrame(data, index=[0])
|
| 100 |
st.subheader('User Input')
|
| 101 |
st.write(input)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
if st.button('Cluster'):
|
| 103 |
num_col = [' income_annum', ' loan_amount', ' loan_term', ' cibil_score', ' residential_assets_value', ' commercial_assets_value', ' luxury_assets_value', ' bank_asset_value']
|
| 104 |
-
cluster_data = df.drop(columns=[col for col in df.columns if col not in num_col])
|
| 105 |
-
cluster_df = cluster.fit_transform(cluster_data)
|
| 106 |
-
k_3 = KMeans(n_clusters=3)
|
| 107 |
-
label3 = k_3.fit_transform(cluster_df)
|
| 108 |
-
df['cluster'] = label3
|
| 109 |
def_cluster = input.drop(columns=[col for col in input.columns if col not in num_col])
|
| 110 |
def_cluster = k_3.predict(def_cluster)
|
| 111 |
|
|
|
|
| 99 |
input = pd.DataFrame(data, index=[0])
|
| 100 |
st.subheader('User Input')
|
| 101 |
st.write(input)
|
| 102 |
+
num_col = [' income_annum', ' loan_amount', ' loan_term', ' cibil_score', ' residential_assets_value', ' commercial_assets_value', ' luxury_assets_value', ' bank_asset_value']
|
| 103 |
+
cluster_data = df.drop(columns=[col for col in df.columns if col not in num_col])
|
| 104 |
+
cluster_df = cluster.fit_transform(cluster_data)
|
| 105 |
+
k_3 = KMeans(n_clusters=3)
|
| 106 |
+
label3 = k_3.fit_transform(cluster_df)
|
| 107 |
+
df['cluster'] = label3
|
| 108 |
if st.button('Cluster'):
|
| 109 |
num_col = [' income_annum', ' loan_amount', ' loan_term', ' cibil_score', ' residential_assets_value', ' commercial_assets_value', ' luxury_assets_value', ' bank_asset_value']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
def_cluster = input.drop(columns=[col for col in input.columns if col not in num_col])
|
| 111 |
def_cluster = k_3.predict(def_cluster)
|
| 112 |
|