|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.miningmart.compiler.wrapper.SVM_Wrapper
Abstract superclass for the wrappers for the Support Vector Machine algorithms mySVM and mySVM/db.
Field Summary | |
protected double |
b
|
static long |
DEFAULTSAMPLESIZE
|
protected boolean |
forClassification
|
protected java.lang.String |
inputTableName
|
protected java.lang.String |
lossNeg
|
protected java.lang.String |
lossPos
|
protected long |
myStepId
|
protected int |
noSV
|
protected static java.lang.String |
SAMPLE_TABLE_PREFIX
|
protected long |
sampleSize
|
protected java.lang.String |
schema
|
protected java.lang.String |
targetColSQLDefinition
|
protected java.lang.String |
targetPositive
|
protected static java.lang.String |
TEMP_TABLE_PREFIX
|
protected edu.udo.cs.miningmart.compiler.wrapper.ColumnInfo[] |
theColumnInfos
|
protected boolean |
useOracle
|
protected boolean |
usePostgres
|
protected double |
xiAlphaEstimation
|
Constructor Summary | |
SVM_Wrapper(CompilerDatabaseService databaseObj,
Print printObj,
java.lang.String nameForDatabaseUse,
java.lang.String nameOfDatabaseSchema,
long stepId)
Constructor. |
Method Summary | |
abstract void |
callSVM(Columnset inputColumnset,
Column targetColumn,
long conceptId,
java.lang.String c,
java.lang.String kernelType,
java.lang.String epsilon,
java.util.Vector thePredictingColumns)
This abstract method defines how to call the external mySVM algorithm for training with the specified parameters. |
protected abstract void |
checkColSetType(java.lang.String type)
|
protected java.lang.String |
checkDouble(java.lang.String test)
|
protected void |
checkForConversion(Columnset inputCS,
java.util.Vector predictingColumns,
Column targetColumn)
|
protected abstract void |
checkKernel(java.lang.String kern)
|
protected java.lang.String |
createBody(java.lang.String kernelType)
|
protected void |
createDecisionFunctionAsSQL_Function(java.lang.String kernelType)
|
protected java.lang.String |
createDecisionFunctionTemplate()
|
protected java.lang.String |
createDeclaration(java.lang.String kernelType)
|
protected abstract void |
extractNumberSV()
Must be implemented by subclasses. |
protected abstract void |
extractXiAlpha()
Must be implemented by subclasses. |
protected abstract java.util.Vector |
getColNamesInput()
|
protected java.lang.String |
getCompleteSelectString()
|
protected CompilerDatabaseService |
getDatabaseObj()
Gets the databaseObj. |
protected java.lang.String |
getDBMS_Datatype(java.lang.String m4ColumnDatatype,
java.lang.String columnName)
|
java.lang.String |
getDecisionFunctionName()
Returns the name of the model function that the SVM installed in the database (business schema). |
protected java.lang.String |
getDecisionFunctionNameWithArgumentTypes()
Returns the name of the decision function that the SVM installed in the database (business schema) together with the function's argument types. |
java.lang.String |
getDecisionFunctionNameWithSchema()
Returns the name of the decision function that the SVM installed in the database (business schema), prefixed by the name of the schema in which it is installed. |
protected java.lang.String |
getInputViewName()
|
protected java.util.Vector |
getKernelParams(java.lang.String kern)
|
protected java.lang.String |
getLogTableName()
|
protected java.lang.String |
getModelTableName()
|
protected abstract java.lang.String |
getModelTablePlusCondition()
|
int |
getNumberOfSupportVectors()
This method returns the number of support vectors computed by the SVM algorithm during training. |
protected java.lang.String |
getOutputViewName()
|
protected java.lang.String |
getParTableName()
|
protected java.lang.String |
getPositiveTargetValue()
|
protected Print |
getPrint()
|
protected java.lang.String |
getSampleRatio(long maxSample,
java.lang.String tableName)
|
double |
getXiAlphaEstimation()
This method returns the XiAlpha-Estimation that was computed by the SVM algorithm during training. |
protected void |
insertFunctionIntoDB(java.lang.String theFunction)
|
protected java.lang.String |
replace(java.lang.String theString,
java.lang.String searchFor,
java.lang.String replaceBy)
|
protected void |
setPositiveTargetValue(java.lang.String posValue)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final long DEFAULTSAMPLESIZE
protected static final java.lang.String SAMPLE_TABLE_PREFIX
protected static final java.lang.String TEMP_TABLE_PREFIX
protected long sampleSize
protected final boolean useOracle
protected final boolean usePostgres
protected java.lang.String lossPos
protected java.lang.String lossNeg
protected edu.udo.cs.miningmart.compiler.wrapper.ColumnInfo[] theColumnInfos
protected java.lang.String targetColSQLDefinition
protected java.lang.String schema
protected java.lang.String inputTableName
protected long myStepId
protected java.lang.String targetPositive
protected boolean forClassification
protected double b
protected double xiAlphaEstimation
protected int noSV
Constructor Detail |
public SVM_Wrapper(CompilerDatabaseService databaseObj, Print printObj, java.lang.String nameForDatabaseUse, java.lang.String nameOfDatabaseSchema, long stepId) throws M4CompilerError
databaseObj
- the DB object to be used for database connectionsprintObj
- the Print object to be used for log messagesnameForDatabaseUse
- Prefix for all functions, view and tables that
this wrapper creates in the databasenameOfDatabaseSchema
- Name of the database schema that holds the business
views and tablesstepId
- Id of the step where this wrapper is executed
M4CompilerError
- A simple exception object with an error message.Method Detail |
public abstract void callSVM(Columnset inputColumnset, Column targetColumn, long conceptId, java.lang.String c, java.lang.String kernelType, java.lang.String epsilon, java.util.Vector thePredictingColumns) throws M4CompilerError
inputColumnset
- The ColumnSet in the database that belongs to the
input Concept of the operator that uses this wrapper. The Columns that the SVM learns
from belong to this ColumnSet.targetColumn
- the Column in the database that
belongs to the target attribute of the operator that uses this
wrapper.conceptId
- Unique M4 Id of the input Concept of the operator that
uses this wrapper.c
- The parameter C for the support vector machine.kernelType
- One of a few possible kernel types, depending on the
actual SVM algorithm used.epsilon
- The parameter epsilon for the support vector machine.thePredictingColumns
- A Vector containing the Columns in the database that the support
vector machine will use as learning attributes.
M4CompilerError
- A simple exception object with an error message.public double getXiAlphaEstimation()
callSVM()
.
public int getNumberOfSupportVectors()
callSVM()
.
protected abstract void extractXiAlpha() throws M4CompilerError
getXiAlphaEstimation()
can return the right value.
M4CompilerError
protected abstract void extractNumberSV() throws M4CompilerError
getNumberOfSupportVectors()
can return the right value.
M4CompilerError
protected void checkForConversion(Columnset inputCS, java.util.Vector predictingColumns, Column targetColumn) throws M4CompilerError
M4CompilerError
protected java.lang.String getCompleteSelectString()
protected java.lang.String getDBMS_Datatype(java.lang.String m4ColumnDatatype, java.lang.String columnName) throws M4CompilerError
M4CompilerError
protected java.lang.String getSampleRatio(long maxSample, java.lang.String tableName) throws M4CompilerError
M4CompilerError
protected void createDecisionFunctionAsSQL_Function(java.lang.String kernelType) throws M4CompilerError
M4CompilerError
protected java.lang.String createDeclaration(java.lang.String kernelType) throws M4CompilerError
M4CompilerError
protected java.lang.String createBody(java.lang.String kernelType) throws M4CompilerError
M4CompilerError
protected void insertFunctionIntoDB(java.lang.String theFunction) throws M4CompilerError
M4CompilerError
protected java.lang.String replace(java.lang.String theString, java.lang.String searchFor, java.lang.String replaceBy)
protected java.lang.String createDecisionFunctionTemplate() throws M4CompilerError
M4CompilerError
protected java.lang.String checkDouble(java.lang.String test) throws M4CompilerError
M4CompilerError
protected void setPositiveTargetValue(java.lang.String posValue)
protected java.lang.String getPositiveTargetValue()
protected abstract void checkKernel(java.lang.String kern) throws M4CompilerError
M4CompilerError
protected abstract java.lang.String getModelTablePlusCondition() throws M4CompilerError
M4CompilerError
protected abstract java.util.Vector getColNamesInput()
protected abstract void checkColSetType(java.lang.String type) throws M4CompilerError
M4CompilerError
protected CompilerDatabaseService getDatabaseObj()
protected java.lang.String getParTableName()
protected java.lang.String getLogTableName()
protected java.lang.String getOutputViewName()
protected java.lang.String getInputViewName()
protected java.lang.String getModelTableName()
public java.lang.String getDecisionFunctionName()
protected java.lang.String getDecisionFunctionNameWithArgumentTypes()
public java.lang.String getDecisionFunctionNameWithSchema() throws M4CompilerError
M4CompilerError
protected Print getPrint()
protected java.util.Vector getKernelParams(java.lang.String kern)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |