|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.miningmart.operator.ExecutableOperator
edu.udo.cs.miningmart.operator.ConceptOperator
edu.udo.cs.miningmart.operator.SingleCSOperator
edu.udo.cs.miningmart.operator.ModelApplier
This class is the abstract super-class for model-applying
operators. It cares about creating an intermediate table in
the business data schema linked to the original data by the
keys specified, creates the meta-data and ensures integrity
of the parameters. The abstract method predict()
has to read the data from the database, apply the model(s)
and update the intermediate table accordingly.
Field Summary |
Fields inherited from class edu.udo.cs.miningmart.operator.ExecutableOperator |
generatedSQLDefinitions |
Constructor Summary | |
ModelApplier()
|
Method Summary | |
protected void |
createPredictedAttributeInDb(int loop)
Helper method adding a new attribute to the newly created database table for the attribute values created in the specified loop. |
protected Columnset |
createSingleColumnSet(int index)
Method overridden to create Column s for the newly created attributes. |
static BaseAttribute |
findCorrespondingBaInConcept(BaseAttribute ba,
Concept concept)
Helper method: The keys are part of the output concept, but the input concept's key columns are necessary when copying virtual columns. |
java.lang.String |
generateSQLDefinition(java.lang.String selectPart)
This method must return the SQL definition of the newly created ColumnSet. |
protected abstract java.lang.String |
getDatabaseDtForNewColumn(BaseAttribute ba)
Specifies the relational datatype for the new Columns based on their BaseAttribute. |
protected java.lang.String |
getDatabaseQueryForRows(java.lang.Long fromRowNum,
java.lang.Long toRowNum)
Builds a database query on the input Columnset projected to the set of
keys and predicting attributes. |
Concept |
getInputConcept()
This method provides TheInputConcept for this operator. |
java.util.Vector |
getKeyColumnNames()
Similar to getKeyColumns() , but returns the Column names, only. |
java.util.Vector |
getKeyColumns()
After initialization at the beginning of generateSQLDefinition
this method returns a Collection of the InputConcept 's
current key Column s. |
Concept |
getOutputConcept()
This method provides TheOutputConcept for this operator. |
BaseAttribute |
getPredictedAttribute(int loop)
|
java.util.Vector |
getPredictionColumnNames()
Similar to getPredictionColumns() , but returns the Column names,
only. |
java.util.Vector |
getPredictionColumns()
After initialization at the beginning of generateSQLDefinition
this method returns a Collection of the InputConcept 's
current Column that might be exploited for predicting values.
|
protected abstract java.lang.String |
getRelationalDtForNewColumn(BaseAttribute ba)
Specifies the relational datatype for the new Columns based on their BaseAttribute. |
protected java.lang.String |
getSelectStatementOfKeys()
This method cares about creating a well-formed select part to read the key attributes from the input Columnset . |
protected java.lang.String |
getSelectStatementOfPredAttribs()
This method is similar to getSelectStatementOfKeys() , but
creates a select part for the predicting columns specified as parameters.
|
protected java.lang.String |
getTargetTableName()
The name of the helper table with primary keys and target value is chosen here. |
java.util.Collection |
getTheKeys()
|
Feature[] |
getThePredictingAttributes()
|
java.lang.String |
getTypeOfNewColumnSet()
This operator creates a view joining the InputConcept with a new table holding the predicted values. |
protected boolean |
mustCopyFeature(java.lang.String nameOfFeature)
All Columns of the InputConcept need to be copied to the OutputConcept. |
protected abstract void |
predict()
Predicts the values applying the specified models. |
protected static java.lang.String |
stringCollectionToCommaSeparatedString(java.util.Collection columnNames)
Service method turning a Collection of Column
names or other attributes or SQL definitions into a comma separated format
usuable within SQL statements. |
Methods inherited from class edu.udo.cs.miningmart.operator.SingleCSOperator |
generateColumnSetsForOp, generateSQLDefinition, getNewCSName, getTypeOfNewColumnSet |
Methods inherited from class edu.udo.cs.miningmart.operator.ConceptOperator |
compileStatement, createMetadata, createMetadataForOneBA, createStatement, estimateStatistics, generateColumns, getNewCSName, getStringForSelection, setNewCSMultiStepBranch |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ModelApplier()
Method Detail |
public java.util.Vector getKeyColumns()
generateSQLDefinition
this method returns a Collection
of the InputConcept
's
current key Column
s.
Collection
of Column
spublic java.util.Vector getKeyColumnNames()
getKeyColumns()
, but returns the Column names, only.
Collection
of String
spublic java.util.Vector getPredictionColumns()
generateSQLDefinition
this method returns a Collection
of the InputConcept
's
current Column
that might be exploited for predicting values.
The Column
s correspond to the parameter PredictingAttributes.
Collection
of Column
spublic java.util.Vector getPredictionColumnNames()
getPredictionColumns()
, but returns the Column names,
only.
Collection
of String
spublic java.lang.String getTypeOfNewColumnSet()
getTypeOfNewColumnSet
in class SingleCSOperator
SingleCSOperator.getTypeOfNewColumnSet()
public java.lang.String generateSQLDefinition(java.lang.String selectPart) throws M4CompilerError
SingleCSOperator
generateSQLDefinition
in class SingleCSOperator
selectPart
- The SQL string between "SELECT" and "FROM" for the
SQL definition to be returned.
M4CompilerError
SingleCSOperator.generateSQLDefinition(String)
protected void createPredictedAttributeInDb(int loop) throws M4CompilerError
loop
- the loop number sepcifying the attribute to be predicted
M4CompilerError
protected java.lang.String getSelectStatementOfKeys()
Columnset
. It is relevant
for creating the joint output view, but is also useful for the
predict()
part.
String
contains the part between SELECT
and FROM if you would only want to select the keys from the
Columnset
.protected java.lang.String getSelectStatementOfPredAttribs()
getSelectStatementOfKeys()
, but
creates a select part for the predicting columns specified as parameters.
This method is a service method for the predict()
part to
be implemented by the non-abstract ModelAppliers
.
String
contains the part between SELECT
and FROM if you would only want to select these attributes from the
Columnset
.protected static java.lang.String stringCollectionToCommaSeparatedString(java.util.Collection columnNames)
Collection
of Column
names or other attributes or SQL definitions into a comma separated format
usuable within SQL statements.
columnNames
- a Collection
of Column
names
String
of these names.public static BaseAttribute findCorrespondingBaInConcept(BaseAttribute ba, Concept concept) throws M4Exception
M4Exception
protected java.lang.String getTargetTableName() throws M4CompilerError
M4CompilerError
protected boolean mustCopyFeature(java.lang.String nameOfFeature) throws M4CompilerError
mustCopyFeature
in class ConceptOperator
nameOfFeature
- Name of the feature in question.
M4CompilerError
ConceptOperator.mustCopyFeature(String)
protected Columnset createSingleColumnSet(int index) throws M4CompilerError
Column
s for the newly created attributes.
createSingleColumnSet
in class ConceptOperator
index
- For MultipleCSOperators, the number of the columnset to be
created, starting with 0. For SingleCSOperators, this parameter must
be -1.
M4CompilerError
protected java.lang.String getDatabaseQueryForRows(java.lang.Long fromRowNum, java.lang.Long toRowNum) throws M4CompilerError
Columnset
projected to the set of
keys and predicting attributes. The parameters specify a possible ROWNUM-restriction,
to read only a block of tuples.
fromRowNum
- the first row number to be returned or null
for unrestrictedtoRowNum
- the last row number to be returned or null
for unrestricted
String
M4CompilerError
public Concept getInputConcept() throws M4CompilerError
ConceptOperator
getInputConcept
in class ConceptOperator
M4CompilerError
public Concept getOutputConcept() throws M4CompilerError
ConceptOperator
getOutputConcept
in class ConceptOperator
M4CompilerError
public Feature[] getThePredictingAttributes() throws M4CompilerError
BaseAttribute
s used to make the prediction
M4CompilerError
public BaseAttribute getPredictedAttribute(int loop) throws M4CompilerError
BaseAttribute
to be predicted by the model.
M4CompilerError
public java.util.Collection getTheKeys() throws M4CompilerError
BaseAttribute
s that form the
primary key of the input concept
M4CompilerError
protected abstract java.lang.String getRelationalDtForNewColumn(BaseAttribute ba)
ba
- the BaseAttribute of a Column to be predicted
NUMBER
or String
.protected abstract java.lang.String getDatabaseDtForNewColumn(BaseAttribute ba) throws M4CompilerError
ba
- the BaseAttribute of a Column to be predicted
VARCHAR2(10)
.
M4CompilerError
protected abstract void predict() throws M4Exception, M4CompilerError
M4Exception
M4CompilerError
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |