|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.data.normalize.AffineTransTable
public class AffineTransTable
Table that performs an affine transformation, i.e. y = a*x + b where a and be b are parameters, x the input value and y the transformed output.
The transformation is only applied to a given set of (DoubleValue
-
compatible) columns. Other columns are copied.
Field Summary | |
---|---|
static double |
VERY_SMALL
A very small number. |
Constructor Summary | |
---|---|
AffineTransTable(DataTable table,
AffineTransConfiguration configuration)
Creates new table, normalizing table with the configuration
given by configuration . |
|
AffineTransTable(DataTable table,
String[] names,
double[] scales,
double[] translations,
double[] min,
double[] max)
Deprecated. Create AffineTransConfiguration object and then
use the constructor
AffineTransTable(DataTable, AffineTransConfiguration) . |
Method Summary | |
---|---|
static DataTableSpec |
createSpec(DataTableSpec spec,
ModelContentRO settings)
Reads the meta information from the settings object and constructs the DataTableSpec, which would be the outcome when a table complying with spec were fet to the load method. |
AffineTransConfiguration |
getConfiguration()
|
DataTableSpec |
getDataTableSpec()
Returns the DataTableSpec object of this table which gives
information about the structure of this data table. |
String |
getErrorMessage()
|
(package private) int[] |
getIndicesInConfiguration()
|
RowIterator |
iterator()
Returns a row iterator which returns each row one-by-one from the table. |
static AffineTransTable |
load(DataTable table,
ModelContentRO sets)
Reads the meta information from the settings object and constructs a AffineTransTable based on this information and the given DataTable. |
void |
save(ModelContentWO settings)
Saves internals to the argument settings object. |
(package private) void |
setErrorMessage(String message)
Sets an error message, if something went wrong during normalization. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double VERY_SMALL
Constructor Detail |
---|
@Deprecated public AffineTransTable(DataTable table, String[] names, double[] scales, double[] translations, double[] min, double[] max)
AffineTransConfiguration
object and then
use the constructor
AffineTransTable(DataTable, AffineTransConfiguration)
.
table
- the Table to wrapnames
- the names of the column to scalescales
- the scale parameters (same order as names
)translations
- the translation parametersmin
- the minimum values (for sanity checks). If the normalized
value is slightly off the desired minimum value because of
rounding errors, it is set to this bounding value. Can be
Double.NaN
, then no checks are performed.max
- the maximum values (for sanity checks). If the normalized
value is slightly off the desired maximum value because of
rounding errors, it is set to this bounding value. Can be
Double.NaN
, then no checks are performed.
NullPointerException
- if any argument is null
IllegalArgumentException
- if the arrays don't have the same
length, the names are not contained in the spec, the double
arrays of scales and translations contain NaN, the target
columns are not DoubleValue
compatiblepublic AffineTransTable(DataTable table, AffineTransConfiguration configuration)
table
with the configuration
given by configuration
.
table
- To be normalizedconfiguration
- Normalization parameters.
NullPointerException
- If either arg is null.
IllegalArgumentException
- If target cols in table are not
numeric.Method Detail |
---|
public DataTableSpec getDataTableSpec()
DataTableSpec
object of this table which gives
information about the structure of this data table.
getDataTableSpec
in interface DataTable
public AffineTransConfiguration getConfiguration()
int[] getIndicesInConfiguration()
public RowIterator iterator()
iterator
in interface Iterable<DataRow>
iterator
in interface DataTable
DataRow
public void save(ModelContentWO settings)
settings
- To write to.public static AffineTransTable load(DataTable table, ModelContentRO sets) throws InvalidSettingsException
table
- The table to which the normalization is applied.sets
- The normalization information.
table
but normalized according
to settings
.
InvalidSettingsException
- If the settings are incomplete
or cannot be applied to spec.public static DataTableSpec createSpec(DataTableSpec spec, ModelContentRO settings) throws InvalidSettingsException
spec
were fet to the load method.
spec
- The original input spec.settings
- The normalization information.
InvalidSettingsException
- If the settings are incomplete
or cannot be applied to spec.void setErrorMessage(String message)
message
- the message to set.public String getErrorMessage()
null
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |