public class Leaderboard extends water.Lockable<Leaderboard> implements hex.ModelContainer<hex.Model>
Note that if a new Leaderboard is made for the same project_name it'll keep using the old model list, which allows us to run AutoML multiple times and keep adding to the leaderboard.
The models are returned sorted by either an appropriate default metric for the model category (auc, mean per class error, or mean residual deviance), or by a metric that's set via #setMetricAndDirection.
TODO: make this robust against removal of models from the DKV.
| Constructor and Description |
|---|
Leaderboard(java.lang.String project_name,
EventLog eventLog,
water.fvec.Frame leaderboardFrame,
java.lang.String sort_metric)
Constructs a new leaderboard (doesn't put it in DKV).
|
| Modifier and Type | Method and Description |
|---|---|
<M extends hex.Model> |
addModel(water.Key<M> key) |
void |
addModels(water.Key<hex.Model>[] modelKeys)
Add the given models to the leaderboard.
|
hex.Model |
getLeader() |
java.lang.String[] |
getMetrics()
The sort metric is always the first element in the list of metrics.
|
int |
getModelCount()
Return the number of models in this Leaderboard.
|
water.Key<hex.Model>[] |
getModelKeys() |
int |
getModelRank(water.Key<hex.Model> modelKey) |
hex.Model[] |
getModels() |
hex.Model[] |
getModelsSortedByMetric(java.lang.String metric) |
static Leaderboard |
getOrMake(java.lang.String project_name,
EventLog eventLog,
water.fvec.Frame leaderboardFrame,
java.lang.String sort_metric)
Retrieves a leaderboard from DKV or creates a fresh one and add it to DKV.
|
java.lang.String |
getProject() |
java.lang.String |
getSortMetric()
If no sort metric is provided when creating the leaderboard,
then a default sort metric will be automatically chosen based on the problem type:
binomial classification: auc
multinomial classification: logloss
regression: mean_residual_deviance
|
double[] |
getSortMetricValues() |
static java.lang.String |
idForProject(java.lang.String project_name) |
static boolean |
isLossFunction(java.lang.String metric) |
water.fvec.Frame |
leaderboardFrame()
Note: If no leaderboard was provided, then the models are sorted according to metrics obtained during training
in the following priority order depending on availability:
cross-validation metrics
validation metrics
training metrics
|
protected water.Futures |
remove_impl(water.Futures fs,
boolean cascade)
Delete object and its dependencies from DKV, including models.
|
<M extends hex.Model> |
removeModel(water.Key<M> key,
boolean cascade) |
void |
removeModels(water.Key<hex.Model>[] modelKeys,
boolean cascade) |
void |
setExtensionsProvider(LeaderboardExtensionsProvider provider)
Assign a
LeaderboardExtensionsProvider to this leaderboard instance. |
java.lang.String |
toLogString() |
java.lang.String |
toString() |
water.util.TwoDimTable |
toTwoDimTable(java.lang.String... extensions)
Creates a
TwoDimTable representation of the leaderboard. |
delete_and_lock, delete_and_lock, delete_and_lock, delete, delete, delete, delete, read_lock, read_lock, read_lock, unlock_all, unlock, unlock, unlock, unlock, update, update, update, write_lock_to_read_lock, write_lock, write_lock, write_lockchecksum_impl, checksum_impl, checksum, checksum, getKey, makeSchema, readAll_impl, readAll, remove_impl, remove_self_key_impl, remove, remove, remove, remove, remove, remove, removeQuietly, writeAll_impl, writeAllpublic Leaderboard(java.lang.String project_name,
EventLog eventLog,
water.fvec.Frame leaderboardFrame,
java.lang.String sort_metric)
project_name - eventLog - leaderboardFrame - sort_metric - public static java.lang.String idForProject(java.lang.String project_name)
project_name - public static boolean isLossFunction(java.lang.String metric)
metric - public static Leaderboard getOrMake(java.lang.String project_name, EventLog eventLog, water.fvec.Frame leaderboardFrame, java.lang.String sort_metric)
project_name - eventLog - leaderboardFrame - sort_metric - public void setExtensionsProvider(LeaderboardExtensionsProvider provider)
LeaderboardExtensionsProvider to this leaderboard instance.provider - the provider used to generate the optional extension columns from the leaderboard.LeaderboardExtensionsProviderpublic java.lang.String getProject()
public java.lang.String getSortMetric()
public java.lang.String[] getMetrics()
public water.fvec.Frame leaderboardFrame()
public water.Key<hex.Model>[] getModelKeys()
getModelKeys in interface hex.ModelContainer<hex.Model>public int getModelCount()
getModelCount in interface hex.ModelContainer<hex.Model>public hex.Model[] getModels()
getModels in interface hex.ModelContainer<hex.Model>public hex.Model[] getModelsSortedByMetric(java.lang.String metric)
public hex.Model getLeader()
getSortMetric()public int getModelRank(water.Key<hex.Model> modelKey)
modelKey - public double[] getSortMetricValues()
getSortMetric(),
isLossFunction(String)public void addModels(water.Key<hex.Model>[] modelKeys)
modelKeys - public void removeModels(water.Key<hex.Model>[] modelKeys,
boolean cascade)
modelKeys - the keys of the models to be removed from this leaderboard.cascade - if true, the model itself and it's dependencies will be completely removed from the backend.public <M extends hex.Model> void addModel(water.Key<M> key)
addModels(Key[])public <M extends hex.Model> void removeModel(water.Key<M> key,
boolean cascade)
key - the key of the model to be removed from the leaderboard.cascade - if true, the model itself and it's dependencies will be completely removed from the backend.protected water.Futures remove_impl(water.Futures fs,
boolean cascade)
remove_impl in class water.Keyed<Leaderboard>public water.util.TwoDimTable toTwoDimTable(java.lang.String... extensions)
TwoDimTable representation of the leaderboard.
If no extensions are provided, then the representation will only contain the model ids and the scoring metrics.
Each extension name will be represented in the table
if and only if it was also made available to the leaderboard by the LeaderboardExtensionsProvider,
otherwise it will just be ignored.extensions - optional columns for the leaderboard representation.TwoDimTable representation of the current leaderboard.LeaderboardExtensionsProvider,
LeaderboardColumnpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toLogString()