Skip to content

Commit

Permalink
Update 0.1.7
Browse files Browse the repository at this point in the history
- ANAI Open Source  Build 7

- Fixed Explainer issues
- ANAI will create a Local Dask Cluster while intializing for all the data streams

Signed-off-by: Arsh <[email protected]>
  • Loading branch information
d4rk-lucif3r committed Oct 12, 2022
1 parent 8119d93 commit e7a681a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
9 changes: 7 additions & 2 deletions anai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
import os
import shutil
import warnings

from distributed import Client, LocalCluster
try:
clust = LocalCluster(name='ANAI-Cluster', n_workers=2, threads_per_worker=2, processes=True,
host='0.0.0.0', protocol='tcp://', scheduler_port=0, dashboard_address=0)
client = Client(clust)
except Exception as e:
pass
import modin.pandas as pd
from colorama import Fore
from optuna.samplers._tpe.sampler import TPESampler
Expand All @@ -16,7 +22,6 @@
from anai.utils.connectors import load_data_from_config
from anai.utils.connectors.data_handler import __df_loader_single, df_loader

os.environ["MODIN_ENGINE"] = "dask"


if os.path.exists(os.getcwd() + "/dask-worker-space"):
Expand Down
2 changes: 1 addition & 1 deletion anai/supervised/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@ def explain(self, method, show_graph=True):
self.y_val,
self.cv_folds,
self.fit_params,
self.show_graph,
show_graph,
)
if self.pred_mode == "all":
regressor = copy.deepcopy(self.best_regressor.model)
Expand Down
7 changes: 4 additions & 3 deletions anai/utils/explainable_anai/explain_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,16 @@ def permutation(self, model):

def shap(self, model):
try:
res = shap_feature_importance(self.features.columns, self.X_train, model, self.isReg, self.show_graph)
res = shap_feature_importance(self.features.columns, self.X_train, model, self.show_graph)
return res
except Exception as e:
print(Fore.YELLOW + "Automatically switching to Surrogate mode\n")
try:
res = shap_feature_importance(
self.features.columns,
self.features.columns,
self.X_train,
surrogate_decision_tree(model, self.X_train, isReg=self.isReg, show_graph=self.show_graph),
surrogate_decision_tree(model, self.X_train),
show_graph=self.show_graph
)
return res
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
include=["anai.*", "anai"],
),
version="0.1.6",
version="0.1.7",
license="Apache License 2.0",
description="Automated ML",
url="https://github.com/Revca-ANAI/ANAI",
Expand Down

0 comments on commit e7a681a

Please sign in to comment.