edu.udo.cs.miningmart.compiler.wrapper
Class SVM_RG

java.lang.Object
  extended byedu.udo.cs.miningmart.compiler.wrapper.SVM_Wrapper
      extended byedu.udo.cs.miningmart.compiler.wrapper.SupportVectorMachine
          extended byedu.udo.cs.miningmart.compiler.wrapper.SVM_RG

public class SVM_RG
extends edu.udo.cs.miningmart.compiler.wrapper.SupportVectorMachine

This class inherits all methods from its super class. Use it to handle a Support Vector Machine for regression.

Version:
$Id: SVM_RG.java,v 1.3 2006/04/11 14:10:18 euler Exp $
Author:
Timm Euler
See Also:
edu.udo.cs.miningmart.m4.core.operator.SupportVectorMachine, edu.udo.cs.miningmart.m4.core.operator.SVM_CL

Field Summary
protected  java.lang.String svmOutput
           
 
Fields inherited from class edu.udo.cs.miningmart.compiler.wrapper.SVM_Wrapper
b, DEFAULTSAMPLESIZE, forClassification, inputTableName, lossNeg, lossPos, myStepId, noSV, SAMPLE_TABLE_PREFIX, sampleSize, schema, targetColSQLDefinition, targetPositive, TEMP_TABLE_PREFIX, theColumnInfos, useOracle, usePostgres, xiAlphaEstimation
 
Constructor Summary
SVM_RG(CompilerDatabaseService databaseObj, Print printObj, java.lang.String databasePrefix, java.lang.String nameOfDatabaseSchema, long stepId, long sampleSize, java.lang.String lossFunctionPos, java.lang.String lossFunctionNeg)
          Constructor.
 
Method Summary
 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 is the wrapper.
protected  void checkColSetType(java.lang.String type)
           
protected  void checkKernel(java.lang.String kern)
           
protected  void extractNumberSV()
          Must be implemented by subclasses.
protected  void extractXiAlpha()
          No XiAlpha estimation is possible for regression.
protected  java.util.Vector getColNamesInput()
           
protected  java.lang.String getModelTablePlusCondition()
           
 
Methods inherited from class edu.udo.cs.miningmart.compiler.wrapper.SVM_Wrapper
checkDouble, checkForConversion, createBody, createDecisionFunctionAsSQL_Function, createDecisionFunctionTemplate, createDeclaration, getCompleteSelectString, getDatabaseObj, getDBMS_Datatype, getDecisionFunctionName, getDecisionFunctionNameWithArgumentTypes, getDecisionFunctionNameWithSchema, getInputViewName, getKernelParams, getLogTableName, getModelTableName, getNumberOfSupportVectors, getOutputViewName, getParTableName, getPositiveTargetValue, getPrint, getSampleRatio, getXiAlphaEstimation, insertFunctionIntoDB, replace, setPositiveTargetValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

svmOutput

protected java.lang.String svmOutput
Constructor Detail

SVM_RG

public SVM_RG(CompilerDatabaseService databaseObj,
              Print printObj,
              java.lang.String databasePrefix,
              java.lang.String nameOfDatabaseSchema,
              long stepId,
              long sampleSize,
              java.lang.String lossFunctionPos,
              java.lang.String lossFunctionNeg)
       throws java.io.IOException,
              java.lang.Exception
Constructor. The connections to the databases are needed because the SVM needs to read metadata as well as data and create an intermediate table in the database.

Parameters:
databaseObj - the DB object to be used for database connections
printObj - the Print object to be used for log messages
databasePrefix - Prefix for all functions, view and tables that this wrapper creates in the database
nameOfDatabaseSchema - Name of the database schema that holds the business views and tables
stepId - Id of the step
sampleSize - the maximum number of examples to be used for training; they are selected randomly from the database
lossFunctionPos - The positive loss function value for the support vector machine
lossFunctionNeg - The negative loss function value for the support vector machine
Throws:
M4CompilerError - A simple exception object with an error message.
java.io.IOException
java.lang.Exception
Method Detail

extractXiAlpha

protected void extractXiAlpha()
                       throws M4CompilerError
No XiAlpha estimation is possible for regression. So this method throws an exception.

Specified by:
extractXiAlpha in class SVM_Wrapper
Throws:
M4CompilerError
See Also:
edu.udo.cs.miningmart.m4.core.operator.SVM_Wrapper#extractXiAlpha

callSVM

public 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
This is the wrapper. This method is used to call the external mySVM algorithm for training with the specified parameters. After successful execution, an SQL-Function exists in the database that implements the learned SVM model. The name for this function is given in the parameter 'nameForDatabaseUse'.

Specified by:
callSVM in class SVM_Wrapper
Parameters:
inputColumnset - 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 "dot", "polynomial", "radial", "neural" or "anova".
epsilon - The parameter epsilon for the support vector machine.
thePredictingColumns - A Vector with the Columns in the database that the support vector machine will use as learning attributes.
Returns:
TRUE if a table was created in the DB, FALSE if not. A function is always created if there was no error.
Throws:
M4CompilerError - A simple exception object with an error message.

extractNumberSV

protected void extractNumberSV()
Description copied from class: SVM_Wrapper
Must be implemented by subclasses. Extracts the number of support vectors from the output of the SVM algorithm so that the public method getNumberOfSupportVectors() can return the right value.

Specified by:
extractNumberSV in class SVM_Wrapper

checkKernel

protected void checkKernel(java.lang.String kern)
                    throws M4CompilerError
Specified by:
checkKernel in class SVM_Wrapper
Throws:
M4CompilerError

checkColSetType

protected void checkColSetType(java.lang.String type)
                        throws M4CompilerError
Specified by:
checkColSetType in class SVM_Wrapper
Throws:
M4CompilerError

getColNamesInput

protected java.util.Vector getColNamesInput()
Specified by:
getColNamesInput in class SVM_Wrapper

getModelTablePlusCondition

protected java.lang.String getModelTablePlusCondition()
Specified by:
getModelTablePlusCondition in class SVM_Wrapper


Copyright © 2001-2005