|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.base.node.mine.bayes.naivebayes.predictor.NaiveBayesCellFactory
public class NaiveBayesCellFactory
Naive Bayes AppendCellFactory class which uses the given
NaiveBayesModel to predict the class membership of each row.
| Constructor Summary | |
|---|---|
NaiveBayesCellFactory(NaiveBayesModel model,
DataTableSpec tableSpec,
boolean inclClassProbVals)
Constructor for class NaiveBayesAlgorithm. |
|
NaiveBayesCellFactory(NaiveBayesModel model,
DataTableSpec tableSpec,
boolean inclClassProbVals,
double laplaceCorrector)
Constructor for class NaiveBayesAlgorithm. |
|
| Method Summary | |
|---|---|
static DataColumnSpec |
createResultColSpecs(DataColumnSpec classColumn,
DataTableSpec inSpec,
boolean inclClassProbVals)
Creates the column specification of the result columns and returns them in the order they should be appended to the original table specification. |
static DataColumnSpec[] |
createResultColSpecs(NaiveBayesModel model,
DataTableSpec inSpec,
boolean inclClassProbVals)
Creates the column specification of the result columns and returns them in the order they should be appended to the original table specification. |
DataCell[] |
getAppendedCell(DataRow row)
Get the new cells for a given row. |
DataCell[] |
getCells(DataRow row)
Get the new cells for a given row. |
DataColumnSpec[] |
getColumnSpecs()
The column specs for the cells that are generated in the getCells() method. |
DataColumnSpec[] |
getResultColumnsSpec()
|
void |
setProgress(int curRowNr,
int rowCount,
RowKey lastKey,
ExecutionMonitor exec)
This method is called when a row has been processed. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NaiveBayesCellFactory(NaiveBayesModel model,
DataTableSpec tableSpec,
boolean inclClassProbVals)
model - the NaiveBayesModel which holds all necessary
information to calculate the probability for new records.tableSpec - the basic table specificationinclClassProbVals - if the probability per class instance should
be appended as columns
public NaiveBayesCellFactory(NaiveBayesModel model,
DataTableSpec tableSpec,
boolean inclClassProbVals,
double laplaceCorrector)
model - the NaiveBayesModel which holds all necessary
information to calculate the probability for new records.tableSpec - the basic table specificationinclClassProbVals - if the probability per class instance should
be appended as columnslaplaceCorrector - the Laplace corrector to use. A value greater 0
overcomes zero counts| Method Detail |
|---|
public static DataColumnSpec[] createResultColSpecs(NaiveBayesModel model,
DataTableSpec inSpec,
boolean inclClassProbVals)
model - the NaiveBayesModel to useinSpec - the DataTableSpec of the input data to check
if the winner column name already existsinclClassProbVals - if the probability values should be displayed
DataColumnSpec[] with the column specifications
of the result columns
public static DataColumnSpec createResultColSpecs(DataColumnSpec classColumn,
DataTableSpec inSpec,
boolean inclClassProbVals)
classColumn - the class column specinSpec - the DataTableSpec of the input data to check
if the winner column name already existsinclClassProbVals - if the probability values should be displayed
DataColumnSpec[] with the column specifications
of the result columnspublic DataColumnSpec[] getResultColumnsSpec()
public DataCell[] getAppendedCell(DataRow row)
getAppendedCell in interface AppendedCellFactoryrow - The row of interest.
public String toString()
toString in class Objectpublic DataCell[] getCells(DataRow row)
getCells in interface CellFactoryrow - The row of interest.
public DataColumnSpec[] getColumnSpecs()
getColumnSpecs in interface CellFactory
public void setProgress(int curRowNr,
int rowCount,
RowKey lastKey,
ExecutionMonitor exec)
Note, you don't need to check exec.checkCanceled() in
the implementation as this is done in the calling class.
setProgress in interface CellFactorycurRowNr - The number of the row just processedrowCount - The total number of rows.lastKey - The row's key.exec - The execution monitor to report progress to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||