Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.udo.cs.miningmart.compiler.wrapper
Class SVM_CL

    java.lang.Object
      edu.udo.cs.miningmart.compiler.wrapper.SVM_Wrapper
          edu.udo.cs.miningmart.compiler.wrapper.SupportVectorMachine
              edu.udo.cs.miningmart.compiler.wrapper.SVM_CL

public class SVM_CL
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 classification.

See Also:
  `edu.udo.cs.miningmart.m4.core.operator.SupportVectorMachine`, `edu.udo.cs.miningmart.m4.core.operator.SVM_RG`

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_CL(CompilerDatabaseService databaseObj, Print printObj, java.lang.String databasePrefix, java.lang.String nameOfDatabaseSchema, long stepId, long sampleSize, java.lang.String positiveTargetValue)` 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()` Must be implemented by subclasses.
`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_CL

    public SVM_CL(CompilerDatabaseService databaseObj,
                  Print printObj,
                  java.lang.String databasePrefix,
                  java.lang.String nameOfDatabaseSchema,
                  long stepId,
                  long sampleSize,
                  java.lang.String positiveTargetValue)
           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
  `positiveTargetValue` - Decides which of the two values of the target attribute is to be interpreted as the positive label.
Throws:
  `M4CompilerError` - A simple exception object with an error message.
  `java.io.IOException`
  `java.lang.Exception`

Method Detail

### extractXiAlpha

    protected void extractXiAlpha()
                           throws M4CompilerError

  Description copied from class: `SVM_Wrapper`
  Must be implemented by subclasses. Extracts the XiAlpha estimation from the output of the SVM algorithm so that the public method `getXiAlphaEstimation()` can return the right value.

  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`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005