public interface SparkTrainingStats
extends java.io.Serializable
TrainingMaster
implementations.
The idea is that for debugging purposes, we want to collect a number of statistics related to the training. However, these statistics will vary, depending on which the type of training we are doing. Specifically, both the keys (number/names of stats) and their actual values (types/classes) can vary.
The interface here operates essentially as a Map<String,Object>. Note however that SparkTrainingStats instances
may be nested: for example a ParameterAveragingTrainingMasterStats may have a
CommonSparkTrainingStats instance which may in turn have a ParameterAveragingTrainingWorkerStats
instance.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_PRINT_FORMAT
Default formatter used for
statsAsString() |
static int |
PRINT_INDENT
Default indentation for
statsAsString() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOtherTrainingStats(SparkTrainingStats other)
Combine the two training stats instances.
|
boolean |
defaultIncludeInPlots(java.lang.String key)
When plotting statistics, we don't necessarily want to plot everything.
|
void |
exportStatFiles(java.lang.String outputPath,
org.apache.spark.SparkContext sc)
Export the stats as a collection of files.
|
java.util.Set<java.lang.String> |
getKeySet() |
SparkTrainingStats |
getNestedTrainingStats()
Return the nested training stats - if any.
|
java.lang.String |
getShortNameForKey(java.lang.String key)
Return a short (display) name for the given key.
|
java.util.List<EventStats> |
getValue(java.lang.String key)
Get the statistic value for this key
|
java.lang.String |
statsAsString()
Get a String representation of the stats.
|
static final int PRINT_INDENT
statsAsString()static final java.lang.String DEFAULT_PRINT_FORMAT
statsAsString()java.util.Set<java.lang.String> getKeySet()
getValue(String)java.util.List<EventStats> getValue(java.lang.String key)
key - Key to get the value forjava.lang.String getShortNameForKey(java.lang.String key)
key - Keyboolean defaultIncludeInPlots(java.lang.String key)
key - Key to check for default plotting behaviourvoid addOtherTrainingStats(SparkTrainingStats other)
other - Other training stats to returnSparkTrainingStats getNestedTrainingStats()
java.lang.String statsAsString()
getValue(String) or export full data via exportStatFiles(String, SparkContext)void exportStatFiles(java.lang.String outputPath,
org.apache.spark.SparkContext sc)
throws java.io.IOException
outputPath - Base directory to write files tojava.io.IOException