-
Notifications
You must be signed in to change notification settings - Fork 193
Add automl regression and classification with model evaluation #911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add automl regression and classification with model evaluation #911
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regression model evaluation componenet -> regression model evaluation pipeline component
Reply via ReviewNB
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace : with . in first sentence
regression evluation component -> model evaluation pipeline component
you say 'pre-trained', but you train the model in the notebook
Add to services, Big Query
Reply via ReviewNB
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was for testing. Removed.
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,1273 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
…neh/vertex-ai-samples into soheilaz-model-eval
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
…ex-ai-samples into soheilaz-model-eval
…ge textual descriptions, add UUID
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_regression_model_evaluation.ipynb
Show resolved
Hide resolved
@@ -0,0 +1,1473 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives me the following error:
AttributeError: 'NoneType' object has no attribute 'artifacts'
Wondering if you could debug?
Apparently task.outputs.get('feature_attributions')
returns None
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cross checked again, working fine for me.
PFA Screenshot link
https://drive.google.com/file/d/1Ufrd6JsB8GbCk1ffz7WSqdnWUVfldgHY/view?usp=sharing
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
notebooks/community/model_evaluation/automl_tabular_classification_model_evaluation.ipynb
Show resolved
Hide resolved
@@ -0,0 +1,1427 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives me the following error:
AttributeError: 'NoneType' object has no attribute 'artifacts'
Can you please run again and see if you get this error too? Is this code tested?
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it again. It worked fine for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I ran it again and didn't work. Maybe we'll need to debug that. I am running it on workbench. Are these notebook tested on local env only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested them on both Workbench and Colab. The above snapshot is from a Colab run.
Yes, it was tested in local env on workbench. Also, before testing, the env was installed with the requirements from .cloud-build/requirements.txt file.
@@ -0,0 +1,1433 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also use "Vertex AI Model Registry"
And an additional step
"Import the Classification Metrics to the AutoML model resource"
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
@@ -0,0 +1,1433 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capitalized.
@@ -0,0 +1,1433 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #1. @kfp.dsl.pipeline(name="vertex-evaluation-automl-tabular-feature-attribution-pipeline")
Prefer to switch the name to "vertex-evaluation-automl-tabular-classification-feature-attribution", removing "pipeline"
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
@@ -0,0 +1,1433 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #13. batch_predict_starting_replica_count: int = 5,
I think we can remove this for simplicity
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
@@ -0,0 +1,1433 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
@@ -0,0 +1,1433 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #80. problem_type=prediction_type,
Problem type is not required since classification_metrics is provided.
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
@@ -0,0 +1,1433 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
batch_predict_instances_format
: Format of the input instances for batch prediction. Can be "jsonl" or "bigquery".
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for AutoML tabular, csv is supported as well
@@ -0,0 +1,1488 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #13. batch_predict_starting_replica_count: int = 5,
Ditto comments from other notebook
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -0,0 +1,1488 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line #89. problem_type=prediction_type,
Can remove from here, and remove from pipeline inputs
Reply via ReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -0,0 +1,1488 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
…neh/vertex-ai-samples into soheilaz-model-eval
"source": [ | ||
"## Overview\n", | ||
"\n", | ||
"This notebook demonstrates how to use Vertex AI classification model evaluation component to evaluate an AutoML classification model. Model evaluation helps you determine your model performance based on the evaluation metrics and improve the model if necessary. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how to use the Vertex AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
"into the filter box, and select\n", | ||
" **Vertex AI Administrator**. Type \"Storage Object Admin\" into the filter box, and select **Storage Object Admin**.\n", | ||
"\n", | ||
"5. Click *Create*. A JSON file that contains your key downloads to your\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create should be bolded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
"id": "XoEqT2Y4DJmf" | ||
}, | ||
"source": [ | ||
"### Import libraries" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brief description for this step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
"\n", | ||
"- `display_name`: The human readable name for the Vertex AI TrainingJob resource.\n", | ||
"- `optimization_prediction_type`: The type of prediction the Model is to produce. Ex: regression, classification.\n", | ||
"- `column_specs`(Optional): Transformations to apply to the input columns(including data-type corrections).\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space needed after "columns"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
"- `dataset`: The TabularDataset within the same Project from which data needs to be used to train the Model.\n", | ||
"- `target_column`: The name of the column values of which the Model is to predict.\n", | ||
"- `model_display_name`: The display name of the Vertex AI Model that is produced as an output. \n", | ||
"- `budget_milli_node_hours`(Optional): The train budget of creating this Model, expressed in milli node hours i.e. 1,000 value in this field means 1 node hour. The training cost of the model does not exceed this budget.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
training
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
"source": [ | ||
"## Create Pipeline for evaluations\n", | ||
"\n", | ||
"Now, you run a Vertex AI BatchPrediction job and generate evaluations and feature-attributions on its results. \n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No hyphen between feature attributions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
"\n", | ||
"Now, you run a Vertex AI BatchPrediction job and generate evaluations and feature-attributions on its results. \n", | ||
"\n", | ||
"To do so, you create a Vertex AI pipeline using the components available from the [`google-cloud-pipeline-components`](https://google-cloud-pipeline-components.readthedocs.io/en/google-cloud-pipeline-components-1.0.17/index.html) python package.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capitalize Python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
"source": [ | ||
"In the results from last step, click on the generated link to see your run in the Cloud Console.\n", | ||
"\n", | ||
"In the UI, many of the pipeline DAG nodes expand or collapse when you click on them. Here is a partially-expanded view of the DAG (click image to see larger version).\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you spell out this acronym? i.e. "directed acyclic graph (DAG)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
This is the first draft for AutoML tabular regression model with the focus of model evolution.
Community Notebooks
under the notebooks/community folder:Community Notebooks
section, pointing to the author or the author's team.Community Content
under the community-content folder:Content Directory Name
is descriptive, informative, and includes some of the key products and attributes of your content, so that it is differentiable from other contentCommunity Content
section, pointing to the author or the author's team.