Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cloudexplain/cloudexplain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudexplain

This is the open source cloudexplain package (or what it is going to be). This just uploads your current data to the azure account you are currently logged in via az.

Azure

To install this for azure run:

pip install cloudexplain[azure]

In order to run it on azure you must have write rights on the cloudexplainmodels storage account on the resource group cloudexplain on your subscription and must be logged in via

az login

Example Usage

Training mode

In training mode you need to specify the y argument.

import shap
import sklearn
import cloudexplain

X, y = shap.datasets.adult(n_points=100)
X["adult_id"] = list(range(len(X)))
dtc = sklearn.tree.DecisionTreeClassifier()
dtc.fit(X, y)


with cloudexplain.azure.explain(model=dtc,
                                X=X,
                                y=y,
                                model_version="0.0.1",
                                model_description="This is a new model.",
                                resource_group_name="mycomp-cloudexplain-tf",
                                explanation_name="dummy_name",
                                explanation_env="dev",
                                data_source="shap_adult_dataset",
                                observation_id_column="adult_id") as run:
    print("This is the run uuid", run.run_uuid)
    pred = dtc.predict(X)
Inference mode

To run in inference mode, just don't specify y.

with cloudexplain.azure.explain(model=dtc,
                                X=X,
                                model_version="0.0.1",
                                model_description="This is a new model.",
                                resource_group_name="mycomp-cloudexplain-tf",
                                explanation_name="dummy_name",
                                explanation_env="dev",
                                data_source="shap_adult_dataset",
                                observation_id_column="adult_id") as run:
    print("This is the run uuid", run.run_uuid)
    pred = dtc.predict(X)

Troubleshooting

When logged in with multiple accounts it can be the case that the permissions are not handled correctly. Signing out of all users except for the one who has the correct rights helps.

az logout

If AuthorizationPermissionMismatch is raised for a newly spun up cloudexplain resource, try logging out and in again. This refreshes azure privileges and should resolve the issue.

About

An open-source library to interact with cloudexplain's services.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages