|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.mine.smote.Smoter
class Smoter
Implementation of the Smote algorithm. It's more a controller for the algorithm, ok.
The algorithm is called SMOTE:
Chawla, N.V., Bowyer, K.W., Hall, L.O., Kegelmeyer, W.P. (2002) "SMOTE: Synthetic Minority Over-sampling Technique", Journal of Artificial Intelligence Research, Volume 16, pages 321-357.
Constructor Summary | |
---|---|
Smoter(BufferedDataTable in,
String colName,
ExecutionContext exec,
Random rand)
Creates a new instance given the input table in and the
target column colName . |
Method Summary | |
---|---|
void |
close()
Closes this controller. |
(package private) static DataTableSpec |
createFinalSpec(DataTableSpec inSpec)
Creates the out spec when smoting the table with inSpec . |
Iterator<DataCell> |
getClassValues()
Get iterator of all classes that occur in the target column. |
int |
getCount(DataCell name)
Get frequency of a class name in the input table. |
DataCell |
getMajorityClass()
Get name of the majority class, i.e. |
DataTable |
getSmotedTable()
Get final output table, including original input table and smoted table. |
void |
smote(DataCell name,
int count,
int kNN,
ExecutionMonitor exec)
Oversample the class name such that count
new rows are inserted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Smoter(BufferedDataTable in, String colName, ExecutionContext exec, Random rand) throws CanceledExecutionException
in
and the
target column colName
.
in
- the input tablecolName
- the target column with class informationexec
- monitor to get canceled status from
(may be null
)rand
- The random generator, may be null
.
CanceledExecutionException
- if execution is canceledMethod Detail |
---|
public Iterator<DataCell> getClassValues()
public int getCount(DataCell name)
getClassValues()
.
name
- the class name
public DataCell getMajorityClass()
public void smote(DataCell name, int count, int kNN, ExecutionMonitor exec) throws CanceledExecutionException
name
such that count
new rows are inserted. The kNN
nearest neighbors are
chosen as reference.
name
- the class namecount
- add this amount of new rowskNN
- k nearest neighbor parameterexec
- monitor to get canceled status from
(may be null
)
CanceledExecutionException
- if execution is canceledpublic void close()
getSmotedTable()
. Subsequent calls of
smote(DataCell, int, int, ExecutionMonitor)
will fail.
public DataTable getSmotedTable()
static DataTableSpec createFinalSpec(DataTableSpec inSpec)
inSpec
. It replaces the data types of all
DoubleValue
-compatible columns by DoubleCell.TYPE
.
inSpec
- the table spec of the input table
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |