Fixed bug in ROC component definition (#1093)

* Fixed bug in ROC component definition

* Fixed the XGBoost sample

* Fixed the ROC op usage in XGBoost sample
This commit is contained in:
Alexey Volkov 2019-04-05 22:06:27 -07:00 committed by Kubernetes Prow Robot
parent e7fe738e61
commit b36c7bc233
2 changed files with 8 additions and 3 deletions

View File

@ -12,7 +12,7 @@ inputs:
implementation:
container:
image: gcr.io/ml-pipeline/ml-pipeline-local-confusion-matrix:a277f87ea1d4707bf860d080d06639b7caf9a1cf
command: [python2, /ml/confusion_matrix.py]
command: [python2, /ml/roc.py]
args: [
--predictions, {inputValue: Predictions dir},
--trueclass, {inputValue: True class},

View File

@ -20,7 +20,7 @@ import kfp.gcp as gcp
from kfp import components
confusion_matrix_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/master/components/local/confusion_matrix/component.yaml')
roc_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/master/components/local/roc/component.yaml')
roc_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/deb4d0ed41662055031832f4ba03e324dd609143/components/local/roc/component.yaml')
# ================================================================
# The following classes should be provided by components provider.
@ -178,7 +178,12 @@ def xgb_train_pipeline(
confusion_matrix_task = confusion_matrix_op(predict_op.output,
'%s/{{workflow.name}}/confusionmatrix' % output).apply(gcp.use_gcp_secret('user-gcp-sa'))
roc_task = roc_op(predict_op.output, true_label, '%s/{{workflow.name}}/roc' % output).apply(gcp.use_gcp_secret('user-gcp-sa'))
roc_task = roc_op(
predictions_dir=predict_op.output,
true_class=true_label,
true_score_column=true_label,
output_dir='%s/{{workflow.name}}/roc' % output
).apply(gcp.use_gcp_secret('user-gcp-sa'))
if __name__ == '__main__':
import kfp.compiler as compiler