Package adams.ml.data
Interface Dataset
-
- All Superinterfaces:
CloneHandler<SpreadSheet>
,LocaleSupporter
,Mergeable<SpreadSheet>
,Serializable
,SpreadSheet
- All Known Implementing Classes:
DatasetView
,DefaultDataset
,InstancesView
public interface Dataset extends SpreadSheet
ExtendedSpreadSheet
class, providing additional machine learning functionality.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
-
Fields inherited from interface adams.data.spreadsheet.SpreadSheet
COMMENT, MISSING_VALUE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int[]
getClassAttributeIndices()
Returns all the class attributes that are currently set.String[]
getClassAttributeKeys()
Returns all the class attributes that are currently set.String[]
getClassAttributeNames()
Returns all the class attributes that are currently set.Dataset
getClone()
Returns a clone of itself.Dataset
getHeader()
Returns the a spreadsheet with the same header and comments.SpreadSheet
getInputs()
Returns a spreadsheet containing only the input columns, not class columns.SpreadSheet
getOutputs()
Returns a spreadsheet containing only output columns, i.e., the class columns.int
indexOfColumn(String name)
Returns the index of the column using the specified name.boolean
isClassAttribute(int colIndex)
Returns whether the specified column is a class attribute.boolean
isClassAttribute(String colKey)
Returns whether the specified column is a class attribute.boolean
isClassAttributeByName(String name)
Returns whether the specified column is a class attribute.void
removeClassAttributes()
Removes all set class attributes.boolean
setClassAttribute(int colIndex, boolean isClass)
Sets the class attribute status for a column.boolean
setClassAttribute(String colKey, boolean isClass)
Sets the class attribute status for a column.boolean
setClassAttributeByName(String name, boolean isClass)
Sets the class attribute status for a column.-
Methods inherited from interface adams.data.spreadsheet.SpreadSheet
addComment, addComment, addRow, addRow, assign, calculate, clear, equalsHeader, getCell, getCellIndex, getCellPosition, getCellValues, getCellValues, getColumnCount, getColumnName, getColumnNames, getComments, getContentType, getContentTypes, getDataRowClass, getDateFormat, getDateTimeFormat, getDateTimeMsecFormat, getHeaderRow, getLocale, getName, getNumberFormat, getRow, getRow, getRowCount, getRowIndex, getRowKey, getSharedStringsTable, getTimeFormat, getTimeMsecFormat, getTimeZone, hasCell, hasName, hasRow, hasRow, insertColumn, insertColumn, insertColumn, insertRow, isContentType, isDateLenient, isDateTimeLenient, isDateTimeMsecLenient, isNumeric, isNumeric, isTimeLenient, isTimeMsecLenient, mergeWith, newCell, newInstance, removeColumn, removeColumn, removeMissing, removeRow, removeRow, rowKeys, rows, setDataRowClass, setDateLenient, setDateTimeLenient, setDateTimeMsecLenient, setLocale, setName, setTimeLenient, setTimeMsecLenient, setTimeZone, sort, sort, sort, sortRowKeys, sortRowKeys, toMatrix, toString, toView
-
-
-
-
Method Detail
-
getClone
Dataset getClone()
Returns a clone of itself.- Specified by:
getClone
in interfaceCloneHandler<SpreadSheet>
- Specified by:
getClone
in interfaceSpreadSheet
- Returns:
- the clone
-
getHeader
Dataset getHeader()
Returns the a spreadsheet with the same header and comments.- Specified by:
getHeader
in interfaceSpreadSheet
- Returns:
- the spreadsheet
-
indexOfColumn
int indexOfColumn(String name)
Returns the index of the column using the specified name.- Parameters:
name
- the name of the column to locate- Returns:
- the index, -1 if failed to locate
-
removeClassAttributes
void removeClassAttributes()
Removes all set class attributes.
-
isClassAttribute
boolean isClassAttribute(String colKey)
Returns whether the specified column is a class attribute.- Parameters:
colKey
- they key of the column to query- Returns:
- true if column a class attribute
-
isClassAttributeByName
boolean isClassAttributeByName(String name)
Returns whether the specified column is a class attribute.- Parameters:
name
- they name of the column to query- Returns:
- true if column a class attribute
-
isClassAttribute
boolean isClassAttribute(int colIndex)
Returns whether the specified column is a class attribute.- Parameters:
colIndex
- they index of the column to query- Returns:
- true if column a class attribute
-
setClassAttribute
boolean setClassAttribute(String colKey, boolean isClass)
Sets the class attribute status for a column.- Parameters:
colKey
- the column to set the class attribute status forisClass
- if true then the column will be flagged as class attribute, otherwise the flag will get removed- Returns:
- true if successfully updated
-
setClassAttributeByName
boolean setClassAttributeByName(String name, boolean isClass)
Sets the class attribute status for a column.- Parameters:
name
- the name of the column to set the class attribute status forisClass
- if true then the column will be flagged as class attribute, otherwise the flag will get removed- Returns:
- true if successfully updated
-
setClassAttribute
boolean setClassAttribute(int colIndex, boolean isClass)
Sets the class attribute status for a column.- Parameters:
colIndex
- the column to set the class attribute status forisClass
- if true then the column will be flagged as class attribute, otherwise the flag will get removed- Returns:
- true if successfully updated
-
getClassAttributeKeys
String[] getClassAttributeKeys()
Returns all the class attributes that are currently set.- Returns:
- the column keys of class attributes (not ordered)
-
getClassAttributeNames
String[] getClassAttributeNames()
Returns all the class attributes that are currently set.- Returns:
- the column names of class attributes (not ordered)
-
getClassAttributeIndices
int[] getClassAttributeIndices()
Returns all the class attributes that are currently set.- Returns:
- the indices of class attributes (sorted asc)
-
getInputs
SpreadSheet getInputs()
Returns a spreadsheet containing only the input columns, not class columns.- Returns:
- the input features, null if data conists only of class columns
-
getOutputs
SpreadSheet getOutputs()
Returns a spreadsheet containing only output columns, i.e., the class columns.- Returns:
- the output features, null if data has no class columns
-
-