marytts.machinelearning
Class SoP

java.lang.Object
  extended by marytts.machinelearning.SoP

public class SoP
extends java.lang.Object

Contains the coefficients and factors of an equation of the form: if interceptTterm = TRUE solution = coeffs[0] + coeffs[1]*factors[0] + coeffs[2]*factors[1] + ... + coeffs[n]*factors[n-1] if interceptterm = FALSE solution = coeffs[0]*factors[0] + coeffs[1]*factors[1] + ... + coeffs[n]*factors[n]

Author:
marcela

Constructor Summary
SoP()
           
SoP(FeatureDefinition featDef)
          Build a new empty sop with the given feature definition.
SoP(java.lang.String line, FeatureDefinition feaDef)
           
 
Method Summary
 double[] getCoeffs()
           
 double getCorrelation()
           
 int[] getFactorsIndex()
           
 FeatureDefinition getFeatureDefinition()
           
 double getRMSE()
           
 double interpret(Target t)
           
 void load(java.lang.String sopFile)
           
 void printCoefficients()
           
 void saveSelectedFeatures(java.io.PrintWriter toSopFile)
          First line vowel coefficients plus factors, second line consonant coefficients plus factors
 void setCoeffsAndFactors(double[] coeffsVal, int[] selectedFactorsIndex, java.lang.String[] allFactorsList, boolean b0)
          if b0=true then the number of selected factors 0 numCoeffs-1 (there is one coeff more) if b0=false then the number of selected factor is the same as the number of coeffs When setting the factors, it checks to which indexes correspond according to the featureDefinition.
 void setCoeffsAndFactors(java.lang.String line)
           
 void setCorrelation(double val)
           
 void setRMSE(double val)
           
 double solve(Target t, FeatureDefinition feaDef, boolean log)
          Solve the linear equation given the features (factors) in t and coeffs and factors in the SoP object * if interceptTterm = TRUE solution = coeffs[0] + coeffs[1]*factors[0] + coeffs[2]*factors[1] + ...
 double solve(Target t, FeatureDefinition feaDef, boolean log, boolean debug)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoP

public SoP()

SoP

public SoP(FeatureDefinition featDef)
Build a new empty sop with the given feature definition.

Parameters:
featDef -

SoP

public SoP(java.lang.String line,
           FeatureDefinition feaDef)
Method Detail

setCorrelation

public void setCorrelation(double val)

setRMSE

public void setRMSE(double val)

getCoeffs

public double[] getCoeffs()

getCorrelation

public double getCorrelation()

getRMSE

public double getRMSE()

getFactorsIndex

public int[] getFactorsIndex()

setCoeffsAndFactors

public void setCoeffsAndFactors(double[] coeffsVal,
                                int[] selectedFactorsIndex,
                                java.lang.String[] allFactorsList,
                                boolean b0)
                         throws java.lang.Exception
if b0=true then the number of selected factors 0 numCoeffs-1 (there is one coeff more) if b0=false then the number of selected factor is the same as the number of coeffs When setting the factors, it checks to which indexes correspond according to the featureDefinition.

Parameters:
coeffsVal -
selectedFactorsIndex -
allFactorsList -
b0 -
Throws:
java.lang.Exception

load

public void load(java.lang.String sopFile)

setCoeffsAndFactors

public void setCoeffsAndFactors(java.lang.String line)

getFeatureDefinition

public FeatureDefinition getFeatureDefinition()

solve

public double solve(Target t,
                    FeatureDefinition feaDef,
                    boolean log)
Solve the linear equation given the features (factors) in t and coeffs and factors in the SoP object * if interceptTterm = TRUE solution = coeffs[0] + coeffs[1]*factors[0] + coeffs[2]*factors[1] + ... + coeffs[n]*factors[n-1] if interceptterm = FALSE solution = coeffs[0]*factors[0] + coeffs[1]*factors[1] + ... + coeffs[n]*factors[n]


solve

public double solve(Target t,
                    FeatureDefinition feaDef,
                    boolean log,
                    boolean debug)

interpret

public double interpret(Target t)

saveSelectedFeatures

public void saveSelectedFeatures(java.io.PrintWriter toSopFile)
First line vowel coefficients plus factors, second line consonant coefficients plus factors


printCoefficients

public void printCoefficients()