wGmdh.jGmdh.oldskul
Class MultiSelectCombi

java.lang.Object
  extended by wGmdh.jGmdh.oldskul.MultiSelectCombi
All Implemented Interfaces:
java.io.Serializable

public class MultiSelectCombi
extends java.lang.Object
implements java.io.Serializable

a multilayered-combinatorial GMDH network class

See Also:
Serialized Form

Nested Class Summary
static class MultiSelectCombi.ModelAndLayer
          A class used to describe the best model trained.
 
Field Summary
protected  weka.core.Attribute attrRegress
           
protected  DatasetSupervised dataset
           
protected  ModelFactory maker
           
 java.util.ArrayList<java.util.ArrayList<? extends Node>> selectedLayers
           
protected  StructureValidationPerformance selectionPerformance
           
protected  NodeFilter selector
           
protected  StructureLearningPerformance trainingPerformance
           
protected  double trainPercentage
           
 
Constructor Summary
MultiSelectCombi(DatasetSupervised h, ModelFactory f, NodeFilter selector)
           
 
Method Summary
 void arrayCleanup()
          Passes through all nodes we have and set to null their trainSetOutput and validationSetOutput.
 MultiSelectCombi.ModelAndLayer bestModel(MultiSelectCombi.ModelAndLayer currentBest)
          Incrementaly finds the best model according to structure validation score.
 DatasetSupervised getDataset()
           
 ModelFactory getMaker()
           
 StructureValidationPerformance getSelectionPerformance()
           
 StructureLearningPerformance getTrainingPerformance()
           
 void initAttributeLayer()
          Initializes the layer of AttributeNodes and presents it to selector
 int mscGrow()
          Grow network by one layer; in multilayered version of selectional-combinatorial algorithm.
 void multiSelectCombi(int nrLayers)
           
static java.lang.String polynomialExpressionGlobal(Model target, int fold)
          Submodels will be marked by their uniqueID.
 void setAttributeLayer(DatasetSupervised dataProvider)
          Reconnect inputs of AttributeNodes.
 void setDataset(DatasetSupervised dataset)
           
 void setMaker(ModelFactory maker)
           
 void setSelectionPerformance(StructureValidationPerformance crit)
           
 void setTrainingPerformance(StructureLearningPerformance meas)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataset

protected DatasetSupervised dataset

trainPercentage

protected double trainPercentage

attrRegress

protected weka.core.Attribute attrRegress

selectionPerformance

protected StructureValidationPerformance selectionPerformance

trainingPerformance

protected StructureLearningPerformance trainingPerformance

selectedLayers

public java.util.ArrayList<java.util.ArrayList<? extends Node>> selectedLayers

maker

protected ModelFactory maker

selector

protected NodeFilter selector
Constructor Detail

MultiSelectCombi

public MultiSelectCombi(DatasetSupervised h,
                        ModelFactory f,
                        NodeFilter selector)
Method Detail

setSelectionPerformance

public void setSelectionPerformance(StructureValidationPerformance crit)

getSelectionPerformance

public StructureValidationPerformance getSelectionPerformance()

setTrainingPerformance

public void setTrainingPerformance(StructureLearningPerformance meas)

getTrainingPerformance

public StructureLearningPerformance getTrainingPerformance()

initAttributeLayer

public void initAttributeLayer()
                        throws java.lang.Exception
Initializes the layer of AttributeNodes and presents it to selector

Throws:
java.lang.Exception

setAttributeLayer

public void setAttributeLayer(DatasetSupervised dataProvider)
Reconnect inputs of AttributeNodes. Useful when serializing/deserializing because references to input dataset are lost.

Parameters:
dataProvider -

multiSelectCombi

public void multiSelectCombi(int nrLayers)
                      throws ExpressionEqualToZero,
                             TooBig,
                             TooSmall
Throws:
ExpressionEqualToZero
TooBig
TooSmall

mscGrow

public int mscGrow()
            throws ExpressionEqualToZero,
                   TooBig,
                   TooSmall
Grow network by one layer; in multilayered version of selectional-combinatorial algorithm. When growing layer k, takes into account models from layers 0, and k-1

Returns:
index of newly grown top node
Throws:
ExpressionEqualToZero
TooBig
TooSmall

getDataset

public DatasetSupervised getDataset()
Returns:
the dataset

setDataset

public void setDataset(DatasetSupervised dataset)
Parameters:
dataset - the dataset to set

getMaker

public ModelFactory getMaker()
Returns:
the maker

setMaker

public void setMaker(ModelFactory maker)
Parameters:
maker - the maker to set

bestModel

public MultiSelectCombi.ModelAndLayer bestModel(MultiSelectCombi.ModelAndLayer currentBest)
Incrementaly finds the best model according to structure validation score. If the structure is trained on one subset and validated on some other and structure validation measure is the same as structure learning score (sse), structure validation score converges. However, because we are averaging the scores on several datasets (obtained by some version of cross-validation), this convergence is only an expected behavior but does not have to occur. Therefore we want to be able to tolerate a number of layers where improvement of structure validation score doesn't have to take place, i.e. to stop training only if that score hasn't improved for a number of predefined layers. Note: all decision making regarding modelAndLayer.layersWithoutImprovement is to be made from the caller; this method only takes care of updating modelAndLayer.layersWithoutImprovement

Parameters:
currentBest - to initialize search, pass null. To build upon a prexisting search (e.g. you know the best one from the 3rd layer and you've grown your layers in the meantime and now you have 10 of them so you can continue from the 4th layer), pass the best model found in last iteration and the index of layer it belongs to, wrapped inside a ModelAndLayer. Remains unchanged.
Returns:
model with best performance (on our internal dataset for selection) together with index of layer it belongs to

polynomialExpressionGlobal

public static java.lang.String polynomialExpressionGlobal(Model target,
                                                          int fold)
                                                   throws TooBig
Submodels will be marked by their uniqueID. Traversal flags are used here

Parameters:
target -
fold - coefficients obtained from fold-th fold will be used
Returns:
Throws:
jGMDH.raw.exceptions.TooBig
TooBig

arrayCleanup

public void arrayCleanup()
Passes through all nodes we have and set to null their trainSetOutput and validationSetOutput.