peggy30 commited on
Commit
d4ef106
·
1 Parent(s): c55aacc
Files changed (2) hide show
  1. .idea/workspace.xml +58 -0
  2. pages/LIME.py +4 -2
.idea/workspace.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="d4d4c856-4e4e-4d5f-b4ca-4c1c8515b14a" name="Default Changelist" comment="">
5
+ <change beforePath="$PROJECT_DIR$/pages/LIME.py" beforeDir="false" afterPath="$PROJECT_DIR$/pages/LIME.py" afterDir="false" />
6
+ </list>
7
+ <option name="SHOW_DIALOG" value="false" />
8
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
9
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
10
+ <option name="LAST_RESOLUTION" value="IGNORE" />
11
+ </component>
12
+ <component name="FileTemplateManagerImpl">
13
+ <option name="RECENT_TEMPLATES">
14
+ <list>
15
+ <option value="Python Script" />
16
+ </list>
17
+ </option>
18
+ </component>
19
+ <component name="Git.Settings">
20
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
21
+ </component>
22
+ <component name="ProjectId" id="2tXP93HJyXRzZGrYXYfz8Dq3x4q" />
23
+ <component name="ProjectLevelVcsManager">
24
+ <ConfirmationsSetting value="2" id="Add" />
25
+ </component>
26
+ <component name="ProjectViewState">
27
+ <option name="autoscrollToSource" value="true" />
28
+ <option name="hideEmptyMiddlePackages" value="true" />
29
+ <option name="showExcludedFiles" value="true" />
30
+ <option name="showLibraryContents" value="true" />
31
+ </component>
32
+ <component name="PropertiesComponent">
33
+ <property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
34
+ <property name="ASKED_SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
35
+ <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
36
+ <property name="last_opened_file_path" value="$PROJECT_DIR$" />
37
+ <property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
38
+ </component>
39
+ <component name="SvnConfiguration">
40
+ <configuration />
41
+ </component>
42
+ <component name="TaskManager">
43
+ <task active="true" id="Default" summary="Default task">
44
+ <changelist id="d4d4c856-4e4e-4d5f-b4ca-4c1c8515b14a" name="Default Changelist" comment="" />
45
+ <created>1740495290809</created>
46
+ <option name="number" value="Default" />
47
+ <option name="presentableId" value="Default" />
48
+ <updated>1740495290809</updated>
49
+ </task>
50
+ <servers />
51
+ </component>
52
+ <component name="WindowStateProjectService">
53
+ <state x="367" y="-1084" key="SettingsEditor" timestamp="1740495774369">
54
+ <screen x="-422" y="-1440" width="2560" height="1440" />
55
+ </state>
56
+ <state x="367" y="-1084" key="SettingsEditor/0.25.1440.875/[email protected]" timestamp="1740495774369" />
57
+ </component>
58
+ </project>
pages/LIME.py CHANGED
@@ -40,7 +40,7 @@ def train_model():
40
 
41
  def define_features():
42
  """ Define feature names and categorical mappings. """
43
- global feature_names, categorical_features, class_names, categorical_names
44
 
45
  feature_names = ["Age", "Workclass",
46
  "Education-Num", "Marital Status", "Occupation",
@@ -72,6 +72,8 @@ def define_features():
72
  'Guatemala', 'Nicaragua', 'Scotland', 'Thailand', 'Yugoslavia', 'El-Salvador', 'Trinadad&Tobago', 'Peru',
73
  'Hong', 'Holand-Netherlands']
74
  }
 
 
75
 
76
 
77
  def explain_example(kernel_width, example_idx):
@@ -80,7 +82,7 @@ def explain_example(kernel_width, example_idx):
80
 
81
  if global_model is None:
82
  train_model()
83
-
84
  # Initialize LIME Explainer
85
  explainer = lime.lime_tabular.LimeTabularExplainer(
86
  X_train.values,
 
40
 
41
  def define_features():
42
  """ Define feature names and categorical mappings. """
43
+
44
 
45
  feature_names = ["Age", "Workclass",
46
  "Education-Num", "Marital Status", "Occupation",
 
72
  'Guatemala', 'Nicaragua', 'Scotland', 'Thailand', 'Yugoslavia', 'El-Salvador', 'Trinadad&Tobago', 'Peru',
73
  'Hong', 'Holand-Netherlands']
74
  }
75
+
76
+ return feature_names, categorical_features, class_names, categorical_names
77
 
78
 
79
  def explain_example(kernel_width, example_idx):
 
82
 
83
  if global_model is None:
84
  train_model()
85
+ feature_names, categorical_features, class_names, categorical_names = define_features()
86
  # Initialize LIME Explainer
87
  explainer = lime.lime_tabular.LimeTabularExplainer(
88
  X_train.values,