Package org.tribuo.provenance
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 Summary
Modifier and TypeFieldDescriptionprotected static final String
The name of the architecture name field.protected final String
The system CPU architecture string.protected final String
The name of the host class.protected static final String
The name of the dataset provenance field.protected final DatasetProvenance
The dataset provenance.protected static final String
The name of the instance values field.protected final com.oracle.labs.mlrg.olcut.provenance.MapProvenance<? extends com.oracle.labs.mlrg.olcut.provenance.Provenance>
Any instance time information supplied by the users.protected static final String
The name of the Java version field.protected final String
The Java version string.protected static final String
The name of the OS name field.protected final String
The OS string.protected final OffsetDateTime
The time the model was created.protected static final String
The name of the trainer provenance field.protected final TrainerProvenance
Provenance of the trainer which created this model.protected static final String
The name of the training time field.protected static final String
The name of the Tribuo version string field.protected static final String
The value returned for models from Tribuo 4.1 and earlier which don't record the Java, OS or architecture.protected final String
The Tribuo version string.Fields inherited from interface com.oracle.labs.mlrg.olcut.provenance.ObjectProvenance
CLASS_NAME, DEFAULT_HASH_TYPE
-
Constructor Summary
ConstructorDescriptionModelProvenance
(String className, OffsetDateTime time, DatasetProvenance datasetProvenance, TrainerProvenance trainerProvenance) Creates a model provenance tracking the class name, creation time, dataset provenance and trainer provenance.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.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.ModelProvenance
(Map<String, com.oracle.labs.mlrg.olcut.provenance.Provenance> map) Used by the provenance unmarshalling system. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getArch()
The CPU architecture used to create this model.The training dataset provenance.com.oracle.labs.mlrg.olcut.provenance.MapProvenance<? extends com.oracle.labs.mlrg.olcut.provenance.Provenance>
Provenance for the specific training run which created this model.The Java version used to create this model.getOS()
The name of the OS used to create this model.The trainer provenance.The training timestamp.The Tribuo version used to create this model.int
hashCode()
protected List<com.oracle.labs.mlrg.olcut.util.Pair<String,
com.oracle.labs.mlrg.olcut.provenance.Provenance>> Returns a list of all the provenances in this model provenance so subclasses can append to the list.Iterator<com.oracle.labs.mlrg.olcut.util.Pair<String,
com.oracle.labs.mlrg.olcut.provenance.Provenance>> iterator()
CallsinternalProvenances()
and returns the iterator from that list.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.oracle.labs.mlrg.olcut.provenance.ObjectProvenance
generateString
-
Field Details
-
DATASET
The name of the dataset provenance field.- See Also:
-
TRAINER
The name of the trainer provenance field.- See Also:
-
TRAINING_TIME
The name of the training time field.- See Also:
-
INSTANCE_VALUES
The name of the instance values field.- See Also:
-
TRIBUO_VERSION_STRING
The name of the Tribuo version string field.- See Also:
-
JAVA_VERSION_STRING
The name of the Java version field.- See Also:
-
OS_STRING
The name of the OS name field.- See Also:
-
ARCH_STRING
The name of the architecture name field.- See Also:
-
UNKNOWN_VERSION
The value returned for models from Tribuo 4.1 and earlier which don't record the Java, OS or architecture.- See Also:
-
className
The name of the host class. -
time
The time the model was created. -
datasetProvenance
The dataset provenance. -
trainerProvenance
Provenance of the trainer which created this model. -
instanceProvenance
protected final com.oracle.labs.mlrg.olcut.provenance.MapProvenance<? extends com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenanceAny instance time information supplied by the users. -
versionString
The Tribuo version string. -
javaVersionString
The Java version string. -
osString
The OS string. -
archString
The system CPU architecture string.
-
-
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
Used by the provenance unmarshalling system.Throws
ProvenanceException
if there are missing fields.- Parameters:
map
- The provenance map.
-
-
Method Details
-
getTrainingTime
The training timestamp.- Returns:
- The timestamp.
-
getDatasetProvenance
The training dataset provenance.- Returns:
- The training dataset provenance.
-
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
The Tribuo version used to create this model.- Returns:
- The Tribuo version.
-
getJavaVersion
The Java version used to create this model.- Returns:
- The Java version.
-
getOS
The name of the OS used to create this model.- Returns:
- The OS name.
-
getArch
The CPU architecture used to create this model.- Returns:
- The CPU architecture.
-
toString
-
getClassName
- Specified by:
getClassName
in interfacecom.oracle.labs.mlrg.olcut.provenance.ObjectProvenance
-
equals
-
hashCode
public int hashCode() -
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()CallsinternalProvenances()
and returns the iterator from that list.
-