Package org.tribuo
Class ModelExplorer
java.lang.Object
org.tribuo.ModelExplorer
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.command.CommandGroup
public class ModelExplorer
extends Object
implements com.oracle.labs.mlrg.olcut.command.CommandGroup
A command line interface for loading in models and inspecting their feature and output spaces.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfeatureInfo
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, String featureName) Shows a specific feature's information.org.jline.reader.Completer[]
Completers for files.generatesProbabilities
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Checks if the model generates probabilities.getName()
Loads a model.static void
Entry point.minCount
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, int minCount) Shows the number of features which occurred more than min count times.modelProvenance
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Displays the model provenance.numFeatures
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Displays the number of features.outputInfo
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Displays the output info.void
Start the command shelltopFeatures
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, int numFeatures) Displays the top n features.
-
Constructor Details
-
ModelExplorer
public ModelExplorer()Builds a new model explorer shell.
-
-
Method Details
-
getName
- Specified by:
getName
in interfacecom.oracle.labs.mlrg.olcut.command.CommandGroup
-
getDescription
- Specified by:
getDescription
in interfacecom.oracle.labs.mlrg.olcut.command.CommandGroup
-
fileCompleter
public org.jline.reader.Completer[] fileCompleter()Completers for files.- Returns:
- The completers for file commands.
-
startShell
public void startShell()Start the command shell -
loadModel
@Command(usage="<filename> - Load a model from disk.", completers="fileCompleter") public String loadModel(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, File path) Loads a model.- Parameters:
ci
- The shell instance.path
- The path to load.- Returns:
- A status string.
-
generatesProbabilities
@Command(usage="Does the model generate probabilities") public String generatesProbabilities(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Checks if the model generates probabilities.- Parameters:
ci
- The command shell.- Returns:
- A status string.
-
modelProvenance
@Command(usage="Shows the model provenance") public String modelProvenance(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Displays the model provenance.- Parameters:
ci
- The command shell.- Returns:
- A status string.
-
featureInfo
@Command(usage="Shows the information on a particular feature") public String featureInfo(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, String featureName) Shows a specific feature's information.- Parameters:
ci
- The command shell.featureName
- The feature name.- Returns:
- A status string.
-
outputInfo
@Command(usage="Shows the output information.") public String outputInfo(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Displays the output info.- Parameters:
ci
- The command shell.- Returns:
- A status string.
-
topFeatures
@Command(usage="<int> - Shows the top N features in the model") public String topFeatures(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, int numFeatures) Displays the top n features.- Parameters:
ci
- The command shellnumFeatures
- The number of features to display.- Returns:
- A status string.
-
numFeatures
@Command(usage="Shows the number of features in the model") public String numFeatures(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Displays the number of features.- Parameters:
ci
- The command shell.- Returns:
- A status string.
-
minCount
@Command(usage="<min count> - Shows the number of features that occurred more than min count times.") public String minCount(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, int minCount) Shows the number of features which occurred more than min count times.- Parameters:
ci
- The command shell.minCount
- The minimum occurrence count.- Returns:
- A status string.
-
main
Entry point.- Parameters:
args
- CLI args.
-