Skip to content

Commit a3cd52c

Browse files
committed
Multi-level EDA. In-app analytics added.
1 parent ff5c9cd commit a3cd52c

File tree

8 files changed

+392
-119
lines changed

8 files changed

+392
-119
lines changed

__pycache__/explain.cpython-37.pyc

469 Bytes
Binary file not shown.

explain.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@
1313
from imports import *
1414
from dashboard import *
1515
from calculate_shap import *
16-
"""
17-
This class calculates feature importance
18-
19-
Input:
20-
21-
22-
"""
23-
2416

2517
class explain():
2618
def __init__(self):
2719
super(explain, self).__init__()
2820
self.param= {}
21+
print("Get you API key here https://www.explainx.ai/.")
22+
self.key=""
23+
self.secret=""
2924

3025
# is classification function?
3126

@@ -56,6 +51,7 @@ def ai(self, df, y, model, model_name="xgboost", mode=None):
5651
prediction_col=[]
5752

5853
if model_name == "xgboost":
54+
import xgboost
5955
prediction_col = model.predict(xgboost.DMatrix(df))
6056

6157
elif model_name == "catboost":
@@ -115,7 +111,11 @@ def ai(self, df, y, model, model_name="xgboost", mode=None):
115111

116112
self.param["is_classification"]= is_classification
117113

118-
d= dashboard()
114+
d= dashboard(self.key, self.secret)
115+
allowed= d.increate_counter(model_name)
116+
if allowed==False:
117+
print("API key and secret are not correct. Please signup to access the API key here https://www.explainx.ai/.")
118+
return False
119119
d.find(self.df_final, y_variable, y_variable_predict, mode, self.param)
120120

121121
return True
@@ -143,6 +143,10 @@ def dataset_heloc(self):
143143
X= dataset.drop("RiskPerformance", axis=1)
144144
return X,y
145145

146+
def init(self, key="", secret=""):
147+
self.key=key
148+
self.secret= secret
149+
146150

147151

148152

2.4 KB
Binary file not shown.
1 Byte
Binary file not shown.
3.96 KB
Binary file not shown.

0 commit comments

Comments
 (0)