public class PhaseDiagramExclusionValidator extends java.lang.Object implements Options, Commandable, Savable, Printable
Provided a number of elements, iterates through all possible combinations of that number elements (i.e., all unique phase diagrams) and evaluates the predictive accuracy of a model by excluding all elements that contain all of those elements from the dataset, training a model on the remaining entries, and validates the performance of the model on the remaining data.
Uses the PhaseDiagramExclusionFilter to create training and test sets.
Implemented Commands
results = evaluate $<model> $>test data> - Evaluate
the performance of a model by iteratively using entries from different
phase diagrams as the test test.
Implemented Save Commands
human - Print out results for each phase diagram from last
evaluation in a human-readable format.
Implemented Print Commands
last [<command>] - Print out statistics generated during last model evaluation
nsystems - Print number of systems evaluated in last test Usage: <# elements>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<org.apache.commons.lang3.tuple.Pair<int[],BaseStatistics>> |
LastResults
Results from previous test.
|
protected BaseStatistics |
LastStatistics
Statistics from last test
|
protected int |
NElements
Number of elements to use.
|
| Constructor and Description |
|---|
PhaseDiagramExclusionValidator() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
about()
Prints a simple status message about this object
|
CompositionDataset |
evaluateModel(BaseModel model,
CompositionDataset data)
Evaluate predictive accuracy of model by iteratively excluding elements
from a certain phase diagram.
|
protected static java.lang.String[] |
getElementNames(int[] names)
Provided with a list of elements IDs, print out element names.
|
static java.util.List<java.lang.Integer> |
getElements(CompositionDataset data)
Provided a CompositionDataset, get list of all included elements.
|
java.lang.String |
printCommand(java.util.List<java.lang.String> Command)
Handles more complicated printing commands.
|
java.lang.String |
printDescription(boolean htmlFormat)
Print full name of object, and a simple description of the options.
|
java.lang.String |
printLastResults()
Print last results as formatted text.
|
java.lang.String |
printUsage()
Print out required format for options.
|
java.lang.Object |
runCommand(java.util.List<java.lang.Object> Command)
Process some command described by a list of Objects.
|
static Dataset |
runExclusionTest(int[] elemsToExclude,
BaseModel modelToTest,
CompositionDataset data)
Evaluate model by using excluding certain combinations of
elements from a dataset, and using the excluded data as a test set.
|
java.lang.String |
saveCommand(java.lang.String Basename,
java.lang.String Format)
Handles complicated saving commands.
|
void |
setNElements(int nElements)
Set the number of elements in phase diagrams being iterated through
|
void |
setOptions(java.util.List<java.lang.Object> Options)
Set any options for this object.
|
protected int NElements
protected final java.util.List<org.apache.commons.lang3.tuple.Pair<int[],BaseStatistics>> LastResults
protected BaseStatistics LastStatistics
public void setOptions(java.util.List<java.lang.Object> Options)
throws java.lang.Exception
OptionssetOptions in interface OptionsOptions - Array of options as Objects - can be nulljava.lang.Exception - if problem with inputspublic java.lang.String printUsage()
OptionsprintUsage in interface Optionspublic java.lang.Object runCommand(java.util.List<java.lang.Object> Command)
throws java.lang.Exception
CommandablerunCommand in interface CommandableCommand - Command as a list of objectsjava.lang.Exception - If something goes wrongpublic void setNElements(int nElements)
nElements - Desired size of phase diagrampublic CompositionDataset evaluateModel(BaseModel model, CompositionDataset data)
model - Model to be validateddata - Data to use for validationpublic java.lang.String printLastResults()
public java.lang.String saveCommand(java.lang.String Basename,
java.lang.String Format)
throws java.lang.Exception
SavableDev Note: Make sure to add save format to Javadoc. See Dataset as an example. Required format:
<save><p><b>format<b> - Description
<br>Optional room to talk more about format </save>
saveCommand in interface SavableBasename - Name of file without extensionFormat - Command specifying format in which to printjava.lang.Exception - If command not understoodpublic java.lang.String about()
Printablepublic java.lang.String printCommand(java.util.List<java.lang.String> Command)
throws java.lang.Exception
PrintableprintCommand in interface PrintableCommand - Command specifying what to printjava.lang.Exception - If command not understoodpublic java.lang.String printDescription(boolean htmlFormat)
PrintableExample: For a model training a separate WekaRegression for intermetallics
magpie.models.regression.SplitRegression
printDescription in interface PrintablehtmlFormat - Whether format for output to an HTML page
(e.g., <div> to create indentation) or for printing to screen.#printModel()protected static java.lang.String[] getElementNames(int[] names)
names - Element IDspublic static Dataset runExclusionTest(int[] elemsToExclude, BaseModel modelToTest, CompositionDataset data)
elemsToExclude - List of elements (by ID = Z - 1) definingmodelToTest - Model to be besteddata - Data to use as test datapublic static java.util.List<java.lang.Integer> getElements(CompositionDataset data)
data - Dataset to be analyzed