Merge pull request #992 from Azure/release_update/Release-54
update samples from Release-54 as a part of SDK release
This commit is contained in:
@@ -4,15 +4,14 @@ import os
|
||||
|
||||
from azureml.core.run import Run
|
||||
from azureml.core.experiment import Experiment
|
||||
from sklearn.externals import joblib
|
||||
from azureml.core.dataset import Dataset
|
||||
from azureml.train.automl.runtime.automl_explain_utilities import AutoMLExplainerSetupClass, \
|
||||
automl_setup_model_explanations, automl_check_model_if_explainable
|
||||
from azureml.explain.model.mimic.models.lightgbm_model import LGBMExplainableModel
|
||||
from azureml.explain.model.mimic_wrapper import MimicWrapper
|
||||
from azureml.automl.core.shared.constants import MODEL_PATH
|
||||
from azureml.explain.model.scoring.scoring_explainer import TreeScoringExplainer, save
|
||||
|
||||
from azureml.explain.model.scoring.scoring_explainer import TreeScoringExplainer
|
||||
import joblib
|
||||
|
||||
OUTPUT_DIR = './outputs/'
|
||||
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
||||
@@ -74,7 +73,8 @@ print("Engineered and raw explanations computed successfully")
|
||||
scoring_explainer = TreeScoringExplainer(explainer.explainer, feature_maps=[automl_explainer_setup_obj.feature_map])
|
||||
|
||||
# Pickle scoring explainer locally
|
||||
save(scoring_explainer, exist_ok=True)
|
||||
with open('scoring_explainer.pkl', 'wb') as stream:
|
||||
joblib.dump(scoring_explainer, stream)
|
||||
|
||||
# Upload the scoring explainer to the automl run
|
||||
automl_run.upload_file('outputs/scoring_explainer.pkl', 'scoring_explainer.pkl')
|
||||
|
||||
Reference in New Issue
Block a user