Class ModelProvenance

java.lang.Object
org.tribuo.provenance.ModelProvenance
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.provenance.ObjectProvenance, com.oracle.labs.mlrg.olcut.provenance.Provenance, Serializable, Iterable<com.oracle.labs.mlrg.olcut.util.Pair<String,com.oracle.labs.mlrg.olcut.provenance.Provenance>>
Direct Known Subclasses:
EnsembleModelProvenance

public class ModelProvenance extends Object implements com.oracle.labs.mlrg.olcut.provenance.ObjectProvenance
Contains provenance information for an instance of a Model.

Made up of the class name of the model object, the date and time it was trained, the provenance of the training data, and the provenance of the trainer.

In addition by default it collects the Java version, OS name and system architecture, along with the running Tribuo version.

See Also:
  • Field Details

  • Constructor Details

    • ModelProvenance

      public ModelProvenance(String className, OffsetDateTime time, DatasetProvenance datasetProvenance, TrainerProvenance trainerProvenance)
      Creates a model provenance tracking the class name, creation time, dataset provenance and trainer provenance.

      Also tracks system details like the os name, os architecture, java version, and Tribuo version.

      Parameters:
      className - The model class name.
      time - The model creation time.
      datasetProvenance - The dataset provenance.
      trainerProvenance - The trainer provenance.
    • ModelProvenance

      public ModelProvenance(String className, OffsetDateTime time, DatasetProvenance datasetProvenance, TrainerProvenance trainerProvenance, Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance)
      Creates a model provenance tracking the class name, creation time, dataset provenance, trainer provenance and any instance specific provenance.

      Also tracks system details like the os name, os architecture, java version, and Tribuo version.

      Parameters:
      className - The model class name.
      time - The model creation time.
      datasetProvenance - The dataset provenance.
      trainerProvenance - The trainer provenance.
      instanceProvenance - Provenance for this specific model training run.
    • ModelProvenance

      public ModelProvenance(String className, OffsetDateTime time, DatasetProvenance datasetProvenance, TrainerProvenance trainerProvenance, Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance, boolean trackSystem)
      Creates a model provenance tracking the class name, creation time, dataset provenance, trainer provenance and any instance specific provenance.

      Also optionally tracks system details like the os name, os architecture, java version, and Tribuo version.

      Parameters:
      className - The model class name.
      time - The model creation time.
      datasetProvenance - The dataset provenance.
      trainerProvenance - The trainer provenance.
      instanceProvenance - Provenance for this specific model training run.
      trackSystem - If true then store the java version, os name and os arch in the provenance.
    • ModelProvenance

      public ModelProvenance(Map<String,com.oracle.labs.mlrg.olcut.provenance.Provenance> map)
      Used by the provenance unmarshalling system.

      Throws ProvenanceException if there are missing fields.

      Parameters:
      map - The provenance map.
  • Method Details

    • getTrainingTime

      public OffsetDateTime getTrainingTime()
      The training timestamp.
      Returns:
      The timestamp.
    • getDatasetProvenance

      public DatasetProvenance getDatasetProvenance()
      The training dataset provenance.
      Returns:
      The training dataset provenance.
    • getTrainerProvenance

      public TrainerProvenance getTrainerProvenance()
      The trainer provenance.
      Returns:
      The trainer provenance.
    • getInstanceProvenance

      public com.oracle.labs.mlrg.olcut.provenance.MapProvenance<? extends com.oracle.labs.mlrg.olcut.provenance.Provenance> getInstanceProvenance()
      Provenance for the specific training run which created this model.
      Returns:
      The instance provenance.
    • getTribuoVersion

      public String getTribuoVersion()
      The Tribuo version used to create this dataset.
      Returns:
      The Tribuo version.
    • getJavaVersion

      public String getJavaVersion()
      The Java version used to create this model.
      Returns:
      The Java version.
    • getOS

      public String getOS()
      The name of the OS used to create this model.
      Returns:
      The OS name.
    • getArch

      public String getArch()
      The CPU architecture used to create this model.
      Returns:
      The CPU architecture.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getClassName

      public String getClassName()
      Specified by:
      getClassName in interface com.oracle.labs.mlrg.olcut.provenance.ObjectProvenance
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • internalProvenances

      protected List<com.oracle.labs.mlrg.olcut.util.Pair<String,com.oracle.labs.mlrg.olcut.provenance.Provenance>> internalProvenances()
      Returns a list of all the provenances in this model provenance so subclasses can append to the list.
      Returns:
      A list of all the provenances in this class.
    • iterator

      public Iterator<com.oracle.labs.mlrg.olcut.util.Pair<String,com.oracle.labs.mlrg.olcut.provenance.Provenance>> iterator()
      Calls internalProvenances() and returns the iterator from that list.
      Specified by:
      iterator in interface Iterable<com.oracle.labs.mlrg.olcut.util.Pair<String,com.oracle.labs.mlrg.olcut.provenance.Provenance>>
      Returns:
      An iterator over all the provenances.