mulan.classifier.neural
Class BPMLL

java.lang.Object
  extended by mulan.classifier.MultiLabelLearnerBase
      extended by mulan.classifier.neural.BPMLL
All Implemented Interfaces:
Serializable, MultiLabelLearner, TechnicalInformationHandler

public class BPMLL
extends MultiLabelLearnerBase

The implementation of Back-Propagation Multi-Label Learning (BPMLL) learner. The learned model is stored in {@link NeuralNet} neural network. The models of the learner built by {@link BPMLLAlgorithm} from given training data set.

BibTeX:

 @article{Zhang2006,
    author = {Zhang, M.L., Zhou, Z.H.},
    journal = {IEEE Transactions on Knowledge and Data Engineering},
    pages = {1338-1351},
    title = {Multi-label neural networks with applications to functional genomics and text categorization},
    volume = {18},
    year = {2006}
 }
 

Version:
2012.02.27
Author:
Jozef Vilcek
See Also:
BPMLLAlgorithm, Serialized Form

Field Summary
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
BPMLL()
          Creates a new instance of BPMLL learner.
BPMLL(long randomnessSeed)
          Creates a new instance of BPMLL learner.
 
Method Summary
protected  void buildInternal(MultiLabelInstances instances)
          Learner specific implementation of building the model from MultiLabelInstances training data set.
 int[] getHiddenLayers()
          Gets an array defining topology of hidden layer of the underlying neural model.
 double getLearningRate()
          Gets the learning rate.
 boolean getNormalizeAttributes()
          Gets a value if normalization of nominal attributes should take place.
 TechnicalInformation getTechnicalInformation()
          Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
 int getTrainingEpochs()
          Gets number of training epochs.
 double getWeightsDecayRegularization()
          Gets a value of the regularization cost term for weights decay.
 String globalInfo()
          Returns a string describing the multi-label learner.
 MultiLabelOutput makePredictionInternal(Instance instance)
          Learner specific implementation for predicting on specified data based on trained model.
 void setHiddenLayers(int[] hiddenLayers)
          Sets the topology of hidden layers for neural network.
 void setLearningRate(double learningRate)
          Sets the learning rate.
 void setNormalizeAttributes(boolean normalize)
          Sets whether attributes of instances data (except label attributes) should be normalized prior to building the learner.
 void setTrainingEpochs(int epochs)
          Sets the number of training epochs.
 void setWeightsDecayRegularization(double weightsDecayCost)
          Sets the regularization cost term for weights decay.
 
Methods inherited from class mulan.classifier.MultiLabelLearnerBase
build, debug, getDebug, isModelInitialized, isUpdatable, makeCopy, makePrediction, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BPMLL

public BPMLL()
Creates a new instance of BPMLL learner.


BPMLL

public BPMLL(long randomnessSeed)
Creates a new instance of BPMLL learner.

Parameters:
randomnessSeed - the seed value for pseudo-random generator
Method Detail

setHiddenLayers

public void setHiddenLayers(int[] hiddenLayers)
Sets the topology of hidden layers for neural network. The length of passed array defines number of hidden layers. The value at particular index of array defines number of neurons in that layer. If null is specified, no hidden layers will be created.
The network is created when learner is being built. The input and output layer is determined from input training data.

Parameters:
hiddenLayers -
Throws:
IllegalArgumentException - if any value in the array is less or equal to zero

getHiddenLayers

public int[] getHiddenLayers()
Gets an array defining topology of hidden layer of the underlying neural model.

Returns:
The method returns a copy of the array.

setLearningRate

public void setLearningRate(double learningRate)
Sets the learning rate. Must be greater than 0 and no more than 1.
Default value is 0.05.

Parameters:
learningRate - the learning rate
Throws:
IllegalArgumentException - if passed value is invalid

getLearningRate

public double getLearningRate()
Gets the learning rate. The default value is 0.05.

Returns:
learning rate

setWeightsDecayRegularization

public void setWeightsDecayRegularization(double weightsDecayCost)
Sets the regularization cost term for weights decay. Must be greater than 0 and no more than 1.
Default value is 0.00001.

Parameters:
weightsDecayCost - the weights decay cost term
Throws:
IllegalArgumentException - if passed value is invalid

getWeightsDecayRegularization

public double getWeightsDecayRegularization()
Gets a value of the regularization cost term for weights decay.

Returns:
regularization cost

setTrainingEpochs

public void setTrainingEpochs(int epochs)
Sets the number of training epochs. Must be greater than 0.
Default value is 100.

Parameters:
epochs - the number of training epochs
Throws:
IllegalArgumentException - if passed value is invalid

getTrainingEpochs

public int getTrainingEpochs()
Gets number of training epochs. Default value is 100.

Returns:
training epochs

setNormalizeAttributes

public void setNormalizeAttributes(boolean normalize)
Sets whether attributes of instances data (except label attributes) should be normalized prior to building the learner. Normalization is performed on numeric attributes to the range {-1,1}).
When making prediction, attributes of passed input instance are also normalized prior to making prediction.
Default is true (normalization of attributes takes place).

Parameters:
normalize - flag if normalization of attributes should be used
Throws:
IllegalArgumentException - if passed value is invalid

getNormalizeAttributes

public boolean getNormalizeAttributes()
Gets a value if normalization of nominal attributes should take place. Default value is true.

Returns:
a value if normalization of nominal attributes should take place

buildInternal

protected void buildInternal(MultiLabelInstances instances)
                      throws Exception
Description copied from class: MultiLabelLearnerBase
Learner specific implementation of building the model from MultiLabelInstances training data set. This method is called from MultiLabelLearnerBase.build(MultiLabelInstances) method, where behavior common across all learners is applied.

Specified by:
buildInternal in class MultiLabelLearnerBase
Parameters:
instances - the training data set
Throws:
Exception - if learner model was not created successfully

globalInfo

public String globalInfo()
Description copied from class: MultiLabelLearnerBase
Returns a string describing the multi-label learner.

Specified by:
globalInfo in class MultiLabelLearnerBase
Returns:
a description suitable for displaying in a future gui

getTechnicalInformation

public TechnicalInformation getTechnicalInformation()
Description copied from class: MultiLabelLearnerBase
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.

Specified by:
getTechnicalInformation in interface TechnicalInformationHandler
Specified by:
getTechnicalInformation in class MultiLabelLearnerBase
Returns:
the technical information about this class

makePredictionInternal

public MultiLabelOutput makePredictionInternal(Instance instance)
                                        throws InvalidDataException
Description copied from class: MultiLabelLearnerBase
Learner specific implementation for predicting on specified data based on trained model. This method is called from MultiLabelLearnerBase.makePrediction(weka.core.Instance) which guards for model initialization and apply common handling/behavior.

Specified by:
makePredictionInternal in class MultiLabelLearnerBase
Parameters:
instance - the data instance to predict on
Returns:
the output of the learner for the given instance
Throws:
InvalidDataException - if specified instance data is invalid and can not be processed by the learner