public class ModelPackage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
Author
Author of this model
|
protected Dataset |
Dataset
Dataset used to generate attributes
|
java.lang.String |
Description
Short description of this model
|
protected java.lang.Integer |
MaxNumEntries
Maximum mumber of entries to run, overrules ServerLauncher.MaxNumEntries
|
protected BaseModel |
Model
Model to be evaluated
|
java.lang.String |
ModelCitation
Citation for this model
|
java.lang.String |
Notes
Long form description of model
|
protected java.util.concurrent.atomic.AtomicLong |
NumberEvaluated
Number of entries evaluated
|
protected java.util.concurrent.atomic.AtomicLong |
NumberRuns
How many times this model has been run
|
java.lang.String |
Property
Name of property being modeled.
|
protected java.util.concurrent.atomic.AtomicLong |
RunTime
How long this model has been run for, in milliseconds
|
java.lang.String |
TrainingSet
Training set description
|
protected java.lang.String |
Units
Units for property
|
Constructor and Description |
---|
ModelPackage(Dataset data,
BaseModel model)
Initialize model package
|
Modifier and Type | Method and Description |
---|---|
boolean |
datasetMatches(Dataset toCheckAgainst)
Check whether the dataset type is the same as a provided type.
|
Dataset |
getDatasetCopy()
Get a copy of the dataset
|
int |
getMaxNumEntries()
Get the maximum number of entries this model is allowed to run.
|
long |
getNumberEntriesEvaluated() |
long |
getNumberRuns() |
java.lang.String[] |
getPossibleClasses()
Get the names of classes for a classification model
|
long |
getRunTime() |
java.lang.String |
getUnits()
Get the units for the model (regression), or the possible classes (classification)
|
boolean |
isClassifer()
Get whether model is a classification model
|
boolean |
modelSupports(Dataset toCheckAgainst)
Check whether dataset is a superclass of a certain class.
|
void |
runModel(Dataset data)
Run the model stored in this package.
|
void |
setUnits(java.lang.String units) |
org.json.JSONObject |
toJSON()
Render the model information as a JSON file
|
void |
writeDataset(java.io.OutputStream output)
Write the dataset out via serialization
|
void |
writeModel(java.io.OutputStream output)
Write the model out via serialization
|
protected final Dataset Dataset
protected final BaseModel Model
public java.lang.String Property
public java.lang.String TrainingSet
public java.lang.String Author
public java.lang.String ModelCitation
public java.lang.String Description
public java.lang.String Notes
protected java.lang.String Units
protected java.util.concurrent.atomic.AtomicLong NumberRuns
protected java.util.concurrent.atomic.AtomicLong NumberEvaluated
protected java.util.concurrent.atomic.AtomicLong RunTime
protected java.lang.Integer MaxNumEntries
public long getNumberRuns()
public long getNumberEntriesEvaluated()
public long getRunTime()
public boolean isClassifer()
public java.lang.String getUnits()
public void setUnits(java.lang.String units)
public java.lang.String[] getPossibleClasses()
public int getMaxNumEntries()
public void runModel(Dataset data) throws java.lang.Exception
Synchronized because some ML algorithms (e.g., ANNs in Weka) do not handle concurrent execution
data
- Dataset to be run, attributes will also be computedjava.lang.Exception
public Dataset getDatasetCopy()
public void writeDataset(java.io.OutputStream output) throws java.io.IOException
output
- Output streamjava.io.IOException
public void writeModel(java.io.OutputStream output) throws java.io.IOException
output
- Output streamjava.io.IOException
public boolean modelSupports(Dataset toCheckAgainst)
You can use this to check whether the model supports data of a certain type. For example, a CrystalStructureDataset is a subclass of CompositionDataset so entries supported the CrystalStructureDataset are also valid entires for a CompositionDataset
toCheckAgainst
- Dataset type to check againstpublic boolean datasetMatches(Dataset toCheckAgainst)
toCheckAgainst
- Dataset type to check againstpublic org.json.JSONObject toJSON()