oracle / tribuo

Tribuo - A Java machine learning library
https://tribuo.org
Apache License 2.0
1.24k stars 172 forks source link

Fixes for protobuf creation in a few classes #323

Closed Craigacp closed 1 year ago

Craigacp commented 1 year ago

Description

DirectoryFileSource, SimpleStringDataSource and SimpleTextDataSource all failed to call super.getInstanceValues() and so missed some values when converted into marshalled provenances. This PR relaxes the check for existing protobufs (as the missing value is a constant) and fixes getInstanceValues for these classes so it is correctly marshalled in the future. It also properly serializes ClusterExemplars from v4.2 which may contain null values.

Motivation

Protobuf serialization will be the only supported form in v5.