virgo-modules 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of virgo-modules might be problematic. Click here for more details.
- virgo_modules/src/edge_utils/shap_utils.py +7 -5
- {virgo_modules-0.3.0.dist-info → virgo_modules-0.3.1.dist-info}/METADATA +1 -1
- {virgo_modules-0.3.0.dist-info → virgo_modules-0.3.1.dist-info}/RECORD +6 -6
- {virgo_modules-0.3.0.dist-info → virgo_modules-0.3.1.dist-info}/LICENSE +0 -0
- {virgo_modules-0.3.0.dist-info → virgo_modules-0.3.1.dist-info}/WHEEL +0 -0
- {virgo_modules-0.3.0.dist-info → virgo_modules-0.3.1.dist-info}/top_level.txt +0 -0
|
@@ -44,7 +44,7 @@ def get_explainerclusters(model, data, targets):
|
|
|
44
44
|
clustermodels.append(cluster_model)
|
|
45
45
|
return clustermodels
|
|
46
46
|
|
|
47
|
-
def mean_shap(data, explainers, pipe_transform):
|
|
47
|
+
def mean_shap(data, explainers, pipe_transform, dict_shap_values):
|
|
48
48
|
t_data = pipe_transform.transform(data)
|
|
49
49
|
input_features = t_data.columns
|
|
50
50
|
shap_results = get_shapvalues(explainers,t_data)
|
|
@@ -55,16 +55,18 @@ def mean_shap(data, explainers, pipe_transform):
|
|
|
55
55
|
df_shap = pd.DataFrame(shap_results_mean, columns=input_features, index=data.index)
|
|
56
56
|
df_shap['Close'] = data['Close']
|
|
57
57
|
df_shap['Date'] = data['Date']
|
|
58
|
+
df_shap = df_shap[['Date','Close']+list(dict_shap_values.keys())]
|
|
59
|
+
df_shap = df_shap.rename(columns =dict_shap_values)
|
|
58
60
|
return df_shap
|
|
59
61
|
|
|
60
|
-
def edge_shap_lines(data,
|
|
62
|
+
def edge_shap_lines(data, plot = False, look_back = 750):
|
|
61
63
|
### corect labels ####
|
|
64
|
+
shap_cols = [col for col in data.columns if col not in ['Date','Close']]
|
|
62
65
|
df = data.sort_values('Date').iloc[-look_back:]
|
|
63
66
|
fig = make_subplots(specs=[[{"secondary_y": True}]])
|
|
64
67
|
fig.add_trace(go.Scatter(x=df.Date, y=df.Close,mode='lines+markers',marker = dict(color = 'grey'),line = dict(color = 'grey'),name='Close price'))
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
fig.add_trace(go.Scatter(x=df.Date, y=df[col],mode='lines+markers',name=dict_shap_values.get(col).get('tag')),secondary_y=True)
|
|
68
|
+
for col in shap_cols:
|
|
69
|
+
fig.add_trace(go.Scatter(x=df.Date, y=df[col],mode='lines+markers',name=col),secondary_y=True)
|
|
68
70
|
fig.update_layout(title_text="sirius - feature power",width=1200,height = 500)
|
|
69
71
|
if plot:
|
|
70
72
|
fig.show()
|
|
@@ -10,9 +10,9 @@ virgo_modules/src/transformer_utils.py,sha256=LLwKYZRq5hrPVimnq3taD0Lh-q3Bq21fy1
|
|
|
10
10
|
virgo_modules/src/edge_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
virgo_modules/src/edge_utils/conformal_utils.py,sha256=4gAOh2vxeWGR7iMF3TKnfQcLHlaH9M5B2lcmzo7V8AY,3755
|
|
12
12
|
virgo_modules/src/edge_utils/edge_utils.py,sha256=U3GVyLgz0gEaR7AGjWseFcWt-IOusZvXJjwpBFknxNs,15643
|
|
13
|
-
virgo_modules/src/edge_utils/shap_utils.py,sha256=
|
|
14
|
-
virgo_modules-0.3.
|
|
15
|
-
virgo_modules-0.3.
|
|
16
|
-
virgo_modules-0.3.
|
|
17
|
-
virgo_modules-0.3.
|
|
18
|
-
virgo_modules-0.3.
|
|
13
|
+
virgo_modules/src/edge_utils/shap_utils.py,sha256=OMKVO-4gtOng9GeSuhEgAEQe4FF3AtqXjm-GUBLqYFc,3349
|
|
14
|
+
virgo_modules-0.3.1.dist-info/LICENSE,sha256=pNgFyCYgmimaw0o6V20JupZLROycAnOA_HDDh1tX2V4,1097
|
|
15
|
+
virgo_modules-0.3.1.dist-info/METADATA,sha256=2Eu2wClOdTfVpfg7uqpeaBHOm651tvwStMeXuLeeNss,883
|
|
16
|
+
virgo_modules-0.3.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
17
|
+
virgo_modules-0.3.1.dist-info/top_level.txt,sha256=ZjI-qEkDtT-8mFwGAWnXfqPOKEGlIhWRW1es1VyXc60,14
|
|
18
|
+
virgo_modules-0.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|