public class ElementDataset extends MultiPropertyDataset
Input files should have element abbreviations as the first column, and measured property values as the next columns. If a property is known for a certain entry, list a string that doesn't parse to a number (e.g., "None"). The header should be a list of property names. If a property has multiple classes, list them inside {}'s (ex: stability{Yes,No}). An example data file could look like:
element sln_energy valency{2+,3+,4+}
Al 0.78 3+
Ni None 2+
Fe 0.39 None
By default, this class uses the properties of an element as attributes.
Implemented Commands:
attributes properties - List which elemental properties are used to generate attributes attributes properties add <names...> - Add elemental properties to use when generating attributes attributes properties add set <name> - Add in all elemental properties from a pre-defined set
attributes properties remove <names...> - Remove properties from list of those used when generating attributes
attributes properties <directory> - Specify directory that contains the elemental property lookup files
Usage: *No options*
Modifier and Type | Field and Description |
---|---|
java.util.List<java.lang.String> |
ElementalProperties
List of elemental properties used when computing attributes
|
java.lang.String |
LookupDirectory
Directory containing elemental property lookup tables
|
java.util.Map<java.lang.String,double[]> |
PropertyData
Lookup table of elemental properties
|
AttributeName, Entries, Expanders, Generators
Constructor and Description |
---|
ElementDataset()
Create a dataset using the default attribute generators:
ElementalPropertyAttributeGenerator
|
ElementDataset(boolean useDefaultGenerators)
Create a blank dataset.
|
Modifier and Type | Method and Description |
---|---|
void |
addElementalProperty(java.lang.String name)
Add an elemental property to the list of those used when computing attributes.
|
void |
addElementalPropertySet(java.lang.String setName)
Add a set of elemental properties to the list of those used when computing attributes.
|
BaseEntry |
addEntry(java.lang.String entry)
A new entry by parsing an input string.
|
protected void |
calculateAttributes()
Compute attributes that are specific to this class.
|
ElementDataset |
createTemplate()
Create a template designed to be saved using serialization
|
ElementDataset |
emptyClone()
Creates a new instance with the same class and attribute names, but
without any entries.
|
java.util.List<java.lang.String> |
getElementalProperties()
Get the list of elemental properties to be used to compute attributes.
|
ElementEntry |
getEntry(int index)
Retrieve a single entry from the dataset
|
double[] |
getLookupTable(java.lang.String prop)
Get an elemental property lookup table
|
void |
importText(java.lang.String filename,
java.lang.Object[] options)
Imports data from a text file.
|
java.lang.String |
printEntryDescription(boolean htmlFormat)
Print out what the entries to this dataset are.
|
boolean |
removeElementalProperty(java.lang.String name)
Remove an elemental property from the list of those used when computing attributes.
|
protected java.lang.Object |
runAttributeCommand(java.util.List<java.lang.Object> Command)
Run commands related to attributes of each entry.
|
protected java.lang.Object |
runPropertyCommand(java.util.List<java.lang.Object> Command)
Run commands that control which elemental properties are used when
generating attributes
|
void |
setElementalProperties(java.util.List<java.lang.String> properties)
Define the list of elemental properties to be used to compute attributes.
|
addEntries, addEntries, addEntry, addProperty, addProperty, clearPropertyData, combine, definePropertyNames, getClassNames, getMeasuredPropertyArray, getMeasuredPropertyArray, getPredictedPropertyArray, getPredictedPropertyArray, getPropertyClassCount, getPropertyClasses, getPropertyClasses, getPropertyIndex, getPropertyName, getPropertyNames, getTargetPropertyIndex, getTargetPropertyName, hasProperty, importEntryProperties, importPropertyNames, NClasses, NProperties, runCommand, saveCommand, setClassNames, setPropertyClasses, setTargetProperty, setTargetProperty, toJSON, toString, usingPropertyAsClass
about, addAttribute, addAttributeExpander, addAttributeGenerator, addAttributes, clearAttributeExpanders, clearAttributeGenerators, clearAttributes, clearData, clone, combine, combine, containsEntry, deleteMeasuredClasses, deletePredictedClasses, finalizeGeneration, generateAttributes, getAttributeArray, getAttributeExpanders, getAttributeGenerators, getAttributeIndex, getAttributeName, getAttributeNames, getCitations, getClassName, getClassProbabilityArray, getDistribution, getDistributionCount, getDuplicates, getEntries, getEntriesWriteAccess, getEntryArray, getMeasuredClassArray, getPredictedClassArray, getRandomSplit, getRandomSplit, getRandomSplit, getRandomSplit, getRandomSubset, getRandomSubset, getSingleAttributeArray, getSubset, getTrainingExamples, getUniqueEntries, loadState, matchEntries, NAttributes, NEntries, partition, partition, printAttributeDescription, printCommand, printDescription, printDistribution, printEntries, printUsage, removeDuplicates, resolveDuplicates, restoreAttributes, runAttributeExpanders, runAttributeExpansionCommand, runAttributeGeneratorCommand, runAttributeGenerators, saveState, saveTemplate, setAttributeNames, setClassProbabilities, setMeasuredClasses, setOptions, setPredictedClasses, splitForThreading, splitIntoFolds, splitIntoFolds, subtract, transferToWeka
public java.lang.String LookupDirectory
public java.util.List<java.lang.String> ElementalProperties
public java.util.Map<java.lang.String,double[]> PropertyData
public ElementDataset()
public ElementDataset(boolean useDefaultGenerators)
useDefaultGenerators
- Whether to use default attribute generatorsElementDataset()
public ElementDataset emptyClone()
Dataset
emptyClone
in class MultiPropertyDataset
public ElementDataset createTemplate()
Dataset
createTemplate
in class MultiPropertyDataset
public void importText(java.lang.String filename, java.lang.Object[] options) throws java.lang.Exception
Dataset
Attribute1Name, Attribute2Name, ..., AttributeNName, Class
Attribute1, Attribute2, ..., AttributeN, ClassVariable
importText
in class Dataset
filename
- Path to data fileoptions
- Any options used to control importjava.lang.Exception
- If text import failspublic BaseEntry addEntry(java.lang.String entry) throws java.lang.Exception
Dataset
public ElementEntry getEntry(int index)
Dataset
getEntry
in class MultiPropertyDataset
index
- Index of entrypublic void setElementalProperties(java.util.List<java.lang.String> properties)
properties
- List of elemental propertiespublic java.util.List<java.lang.String> getElementalProperties()
public void addElementalProperty(java.lang.String name)
name
- Name of elemental propertypublic boolean removeElementalProperty(java.lang.String name)
name
- Name of elemental property to be removedpublic void addElementalPropertySet(java.lang.String setName) throws java.lang.Exception
setName
- Name of setjava.lang.Exception
PropertyLists.getPropertySet(java.lang.String)
public double[] getLookupTable(java.lang.String prop) throws java.lang.Exception
prop
- Name of propertyjava.lang.Exception
protected void calculateAttributes() throws java.lang.Exception
Dataset
calculateAttributes
in class Dataset
java.lang.Exception
- If attribute calculation failsprotected java.lang.Object runAttributeCommand(java.util.List<java.lang.Object> Command) throws java.lang.Exception
Dataset
runAttributeCommand
in class Dataset
Command
- Operation to be run on/about attributesjava.lang.Exception
- On any errorprotected java.lang.Object runPropertyCommand(java.util.List<java.lang.Object> Command) throws java.lang.Exception
Command
- Command to act onjava.lang.Exception
public java.lang.String printEntryDescription(boolean htmlFormat)
Dataset
printEntryDescription
in class Dataset
htmlFormat
- Whether to print in HTML format