jaleesahmed commited on
Commit
8a3702d
·
1 Parent(s): bee3f66
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -14,15 +14,14 @@ def data_description(action_type):
14
  label_encoding = LabelEncoder()
15
  for col in categorical_column:
16
  data_encoded[col] = label_encoding.fit_transform(data_encoded[col])
 
 
17
 
18
  if action_type == "Input Data":
19
- input_data = data_encoded.drop(['Attrition'], axis=1)
20
  return input_data.head()
21
  if action_type == "Target Data":
22
- target_data = data_encoded[['Attrition']]
23
  return target_data.head()
24
  if action_type == "Feature Selection By Mutual Information":
25
- input_data = data_encoded.drop(['Attrition'], axis=1)
26
  col_values = list(input_data.columns.values)
27
  feature_scores = mutual_info_classif(input_data, target_data)
28
  data = [["Feature", "Mutual Information (0: independent, 1: dependent)"]]
@@ -30,7 +29,6 @@ def data_description(action_type):
30
  data.append([fname, score])
31
  return data
32
  if action_type == "Feature Selection By Chi Square":
33
- input_data = data_encoded.drop(['Attrition'], axis=1)
34
  col_values = list(input_data.columns.values)
35
  feature_scores = chi2(input_data, target_data)[0]
36
  data = [["Feature", "Mutual Information (0: independent, 1: dependent)"]]
 
14
  label_encoding = LabelEncoder()
15
  for col in categorical_column:
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)"]]
 
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)"]]