Spaces:
Runtime error
Runtime error
jaleesahmed
commited on
Commit
·
174521f
1
Parent(s):
8a3702d
model
Browse files
app.py
CHANGED
@@ -16,20 +16,19 @@ def data_description(action_type):
|
|
16 |
data_encoded[col] = label_encoding.fit_transform(data_encoded[col])
|
17 |
input_data = data_encoded.drop(['Attrition'], axis=1)
|
18 |
target_data = data_encoded[['Attrition']]
|
|
|
19 |
|
20 |
if action_type == "Input Data":
|
21 |
return input_data.head()
|
22 |
if action_type == "Target Data":
|
23 |
return target_data.head()
|
24 |
if action_type == "Feature Selection By Mutual Information":
|
25 |
-
col_values = list(input_data.columns.values)
|
26 |
feature_scores = mutual_info_classif(input_data, target_data)
|
27 |
data = [["Feature", "Mutual Information (0: independent, 1: dependent)"]]
|
28 |
for score, fname in sorted(zip(feature_scores, col_values), reverse=True)[:10]:
|
29 |
data.append([fname, score])
|
30 |
return data
|
31 |
if action_type == "Feature Selection By Chi Square":
|
32 |
-
col_values = list(input_data.columns.values)
|
33 |
feature_scores = chi2(input_data, target_data)[0]
|
34 |
data = [["Feature", "Mutual Information (0: independent, 1: dependent)"]]
|
35 |
for score, fname in sorted(zip(feature_scores, col_values), reverse=True)[:10]:
|
|
|
16 |
data_encoded[col] = label_encoding.fit_transform(data_encoded[col])
|
17 |
input_data = data_encoded.drop(['Attrition'], axis=1)
|
18 |
target_data = data_encoded[['Attrition']]
|
19 |
+
col_values = list(input_data.columns.values)
|
20 |
|
21 |
if action_type == "Input Data":
|
22 |
return input_data.head()
|
23 |
if action_type == "Target Data":
|
24 |
return target_data.head()
|
25 |
if action_type == "Feature Selection By Mutual Information":
|
|
|
26 |
feature_scores = mutual_info_classif(input_data, target_data)
|
27 |
data = [["Feature", "Mutual Information (0: independent, 1: dependent)"]]
|
28 |
for score, fname in sorted(zip(feature_scores, col_values), reverse=True)[:10]:
|
29 |
data.append([fname, score])
|
30 |
return data
|
31 |
if action_type == "Feature Selection By Chi Square":
|
|
|
32 |
feature_scores = chi2(input_data, target_data)[0]
|
33 |
data = [["Feature", "Mutual Information (0: independent, 1: dependent)"]]
|
34 |
for score, fname in sorted(zip(feature_scores, col_values), reverse=True)[:10]:
|