name: MaximumLikelihoodLinearRegression
synopsis:

>     g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_pr.a

>     #include <MaximumLikelihoodLinearRegression.h>

>     MaximumLikelihoodLinearRegression(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, float split_threshold, float merge_threshold, float num_occ_threshold);
>     boolean eq(const MaximumLikelihoodLinearRegression& arg);
>     boolean setAlgorithm(ALGORITHM algorithm);

quick start:

>     MaximumLikelihoodLinearRegression mllr;
>     mllr.setAlgorithm(REGRESSION_TREE);
>     mllr.setImplementation(ML);

>     mllr.initRegressionTree(Vector& stat_models_a,
>                             Vector & speech_tag_a);
>     mllr.createTransform(Vector& stat_models_a);
>     mllr.adapt(Vector& stat_models_a);

description:
The MaximumLikelihoodLinearRegression class is used to control the process of MLLR adaptation. Those processing steps include RegressionDecisionTree generation, Transformation matrix creation, and statistical models adaptation.
dependencies:

- RegressionDecisionTreeNode
- RegressionDecisionTree
- StatisticalModelAdaptation

public constants:

- define the class name:

      static const String CLASS_NAME = L"MaximumLikelihoodLinearRegression";

- define the algorithm choices:

      enum ALGORITHM { REGRESSION_TREE = 0, TRANSFORM, ADAPT, ALL, DEF_ALGORITHM = ALL  ML = 0, DEF_ALGORITHM = ML };

- define the implementation choices:

      enum IMPLEMENTATION { ML = 0, MEAN, VARIANCE, DEF_IMPLEMENTATION = ML };

- define the adaptation supervision choices

      enum SUPERVISION_MODE { SUPERVISED = 0, UNSUPERVISED, DEF_SUPERVISION_MODE = SUPERVISED };

- define the adaptation sequence choices:

       enum SEQUENCE_MODE { BATCH = 0, INCREMENTAL, DEF_SEQUENCE_MODE = BATCH };>/pre>

- define the static NameMap objects:

      static const NameMap ALGO_MAP(L"REGRESSION_TREE, TRANSFORM, ADAPT, ALL");

      static const NameMap IMPL_MAP(L"DEFAULT");

      static const NameMap SUP_MODE_MAP;

      static const NameMap SEQ_MODE_MAP;

- define i/o related constants:

      static const String DEF_PARAM = L"";

      static const String PARAM_ALGORITHM = L"algorithm";

      static const String PARAM_IMPLEMENTATION = L"implementation";

      static const String PARAM_SUPERVISION_MODE = L"supervision_mode";

      static const String PARAM_SEQUENCE_MODE = L"sequence_mode";

      static const String PARAM_RDT = L"rdt";

      static const String PARAM_SM_ADAPT = L"sm_adapt";

      static const String PARAM_DBGL = L"debug_level";

- other static constants:
- define default value(s) for the thresholds:

      static const int DEF_NUM_CLASSES = 1;

      static const float DEF_MERGE_THRESHOLD = 5;

      static const float DEF_NUM_OCC_THRESHOLD = 100;

error codes:

- error code indicating MaximumLikelihoodLinearRegression class general error:

      static const long ERR = 00100700;

      static const long ERR_UNALG_UNIMP = 00100701;

protected data:

- define the structures:
- algorithm name:

      ALGORITHM algorithm_d;

- implmentation name:

      IMPLEMENTATION implementation_d;

- adaptation supervision mode:

      SUPERVISION_MODE supervision_mode_d;

- adaptation sequence mode:

      SEQUENCE_MODE sequence_mode_d;

- regression decision tree:

      RegressionDecisionTree rdt_d;

- statistical model adaptation:

      StatisticalModelAdaptation sm_adapt_d;

- local copy of the statistical model:

      Vector stat_models_d;

- debug level:

      DebugLevel debug_level_d;>/pre>

- static memory manager:

      static MemoryManager mgr_d;

required public methods:

- static methods:

      static const String& name();

      static boolean diagnose(Integral::DEBUG debug_level);

- debug methods:

      boolean debug(const unichar* message) const;

- destructor/constructor(s):

      ~MaximumLikelihoodLinearRegression();

      MaximumLikelihoodLinearRegression(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);

      MaximumLikelihoodLinearRegression(const MaximumLikelihoodLinearRegression& arg);

- assign methods:

      boolean assign(const MaximumLikelihoodLinearRegression& arg);

- operator= methods:

      MaximumLikelihoodLinearRegression& operator= (const MaximumLikelihoodLinearRegression& arg);

- i/o methods:

      long sofSize() const;

      boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);

      boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;

      boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);

      boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;

- equality methods:

      boolean eq(const MaximumLikelihoodLinearRegression& arg) const;

- memory management methods:

      static void* operator new(size_t size);

      static void* operator new[](size_t size);

      static void operator delete(void* ptr);

      static void operator delete[](void* ptr);

      static boolean setGrowSize(long grow_size);

      boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);

class-specific public methods:

- set methods:

      boolean setAlgorithm(ALGORITHM algorithm);

      boolean setImplementation(IMPLEMENTATION implementation);

      boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);

- get methods:

      ALGORITHM getAlgorithm() const;

      IMPLEMENTATION getImplementation() const;

      boolean get(ALGORITHM& algorithm, IMPLEMENTATION& implementation);

      boolean initRegressionTree(Vector& stat_models_a, Vector & speech_tag_a);

      boolean createTransform(Vector& stat_models_a);

      boolean adapt(Vector& stat_models_a);

- other methods:

      boolean setParser(SofParser* parser);

private methods:
examples:

- none

notes:

- none