metadata icon indicating copy to clipboard operation
metadata copied to clipboard

[Question] How to use URI in Metrics?

Open gabrielwen opened this issue 6 years ago • 5 comments

It's not clear how to use URI in Metrics but it seems to be an important field (required, actually). If we use values to pass metrics like score or median error, do we still need an URI pointing to some data?

gabrielwen avatar Oct 07 '19 17:10 gabrielwen

URI is required for all types of artifacts and metrics is one of them.

URI points to the storage location of the a metrics while values can provide a summary or complete metrics values. For example, you can have a metrics with URI pointing to a CSV file with values being the overall score.

If the whole metrics are captured by values, the URI seems useless. I guess you can put some placeholder into URI.

zhenghuiwang avatar Oct 07 '19 22:10 zhenghuiwang

As far as I can see, the values field isn't even used. The ml-metadata Artifact signature kubeflow.org/alpha/metrics that is relevant here doesn't have a values property.

Also the under the Artifact of class kubeflow.metadata.Metrics the function def serialization(...) is used to prepare the class properties for upload into the metastore. values is currently completely ignored here.

karlschriek avatar Nov 14 '19 15:11 karlschriek

Also the under the Artifact of class kubeflow.metadata.Metrics the function def serialization(...) is used to prepare the class properties for upload into the metastore. values is currently completely ignored here.

values is not ignored: it is handled in this statement of serialization:

            _ALL_META_PROPERTY_NAME:
                mlpb.Value(string_value=json.dumps(self.__dict__)),

values is a dictionary but MLMD property type can only be string, int, and double type. The workaround here is to save all metrics properties to a special MLMD property.

zhenghuiwang avatar Nov 14 '19 18:11 zhenghuiwang

Ok, now I see! The entire self.__dict__ gets converted to string. Thanks for the explanation

karlschriek avatar Nov 20 '19 08:11 karlschriek

/kind question /area engprod /priority p2

jtfogarty avatar Jan 14 '20 21:01 jtfogarty