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
protected final String
protected final String
protected static final String
protected final DatasetProvenance
protected static final String
protected final com.oracle.labs.mlrg.olcut.provenance.MapProvenance<? extends com.oracle.labs.mlrg.olcut.provenance.Provenance>
protected static final String
protected final String
protected static final String
protected final String
protected final OffsetDateTime
protected static final String
protected final TrainerProvenance
protected static final String
protected static final String
protected static final String
protected final 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 dataset.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
- See Also:
-
TRAINER
- See Also:
-
TRAINING_TIME
- See Also:
-
INSTANCE_VALUES
- See Also:
-
TRIBUO_VERSION_STRING
- See Also:
-
JAVA_VERSION_STRING
- See Also:
-
OS_STRING
- See Also:
-
ARCH_STRING
- See Also:
-
UNKNOWN_VERSION
- See Also:
-
className
-
time
-
datasetProvenance
-
trainerProvenance
-
instanceProvenance
protected final com.oracle.labs.mlrg.olcut.provenance.MapProvenance<? extends com.oracle.labs.mlrg.olcut.provenance.Provenance> instanceProvenance -
versionString
-
javaVersionString
-
osString
-
archString
-
-
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 dataset.- 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.
-