|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.yale.datatable.AbstractDataTable
edu.udo.cs.yale.datatable.DataTableKernelModelAdapter
public class DataTableKernelModelAdapter
This class can be used to use a kernel model as data table. The data is directly read from the kernel model instead of building a copy. Please note that the method for adding new rows is not supported by this type of data tables.
Nested Class Summary | |
---|---|
private static class |
DataTableKernelModelAdapter.KernelModelIterator
Helper class to iterated over the examples or support vectors of a KernelModel . |
Field Summary | |
---|---|
private java.util.Map<java.lang.Integer,java.lang.String> |
index2LabelMap
|
private KernelModel |
kernelModel
|
private java.util.Map<java.lang.String,java.lang.Integer> |
label2IndexMap
|
private int[] |
sampleMapping
|
Constructor Summary | |
---|---|
DataTableKernelModelAdapter(KernelModel kernelModel)
|
Method Summary | |
---|---|
void |
add(DataTableRow row)
Adds the given DataTableRow to the table. |
int |
getColumnIndex(java.lang.String name)
Returns the column index of the column with the given name. |
java.lang.String |
getColumnName(int i)
Returns the name of the i-th column. |
double |
getColumnWeight(int column)
Returns the weight of the column or Double.NaN if no weight is available. |
java.lang.String |
getName()
Returns the name of this data table. |
int |
getNumberOfColumns()
Returns the total number of columns. |
int |
getNumberOfRows()
Returns the total number of rows. |
int |
getNumberOfSpecialColumns()
Returns the total number of special columns. |
int |
getNumberOfValues(int column)
Returns the number of different values for the i-th column. |
DataTableRow |
getRow(int index)
Returns the data table row with the given index. |
boolean |
isNominal(int index)
Indicates if the column with the given index is nominal. |
boolean |
isSpecial(int index)
Returns true if this column is a special column which might usually not be used for some plotters, for example weights or labels. |
boolean |
isSupportingColumnWeights()
Returns true if this data table is supporting column weights. |
java.util.Iterator<DataTableRow> |
iterator()
Returns an iterator over all DataTableRow s. |
java.lang.String |
mapIndex(int column,
int value)
If a column is nominal, the index value must be mapped to the nominal value by this method. |
int |
mapString(int column,
java.lang.String value)
If a column is nominal, the nominal value must be mapped to a (new) index by this method. |
void |
sample(int newSize)
Performs a sampling of this data table. |
Methods inherited from class edu.udo.cs.yale.datatable.AbstractDataTable |
---|
addDataTableListener, containsMissingValues, fireEvent, getColumnNames, getValueAsString, removeDataTableListener, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private KernelModel kernelModel
private int[] sampleMapping
private java.util.Map<java.lang.Integer,java.lang.String> index2LabelMap
private java.util.Map<java.lang.String,java.lang.Integer> label2IndexMap
Constructor Detail |
---|
public DataTableKernelModelAdapter(KernelModel kernelModel)
Method Detail |
---|
public int getNumberOfSpecialColumns()
DataTable
DataTable.isSpecial(int)
should be used.
public boolean isSpecial(int index)
DataTable
public boolean isNominal(int index)
DataTable
public java.lang.String mapIndex(int column, int value)
DataTable
NullPointerException
.
public int mapString(int column, java.lang.String value)
DataTable
NullPointerException
.
public int getNumberOfValues(int column)
DataTable
public java.lang.String getColumnName(int i)
DataTable
public int getColumnIndex(java.lang.String name)
DataTable
public boolean isSupportingColumnWeights()
DataTable
public double getColumnWeight(int column)
DataTable
public int getNumberOfColumns()
DataTable
public int getNumberOfRows()
DataTable
public java.lang.String getName()
DataTable
public void add(DataTableRow row)
DataTable
DataTableRow
to the table.
public DataTableRow getRow(int index)
DataTable
public java.util.Iterator<DataTableRow> iterator()
DataTable
DataTableRow
s.
public void sample(int newSize)
DataTable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |