|
Biorithm
1.1
|
A super-duper rilly, rilly abstract class for function prediction algorithms in GAIN. This class only contains basic methods that all algorithms need. More...
#include <gain-algorithm.h>
Public Member Functions | |
| virtual void | initialiseAlgorithm () |
| virtual string | getName ()=0 |
| virtual void | pipeline (const BioFunction &function)=0 |
| virtual void | printStatistics (ostream &statsStream) |
A super-duper rilly, rilly abstract class for function prediction algorithms in GAIN. This class only contains basic methods that all algorithms need.
GAIN contains an easy-to-use framework to implement new function prediction algorithms. Here are the steps that you will need to take:
Decide if the algorithm uses both positive and negative examples or only positive examples. We call algorithms that use both positive and negative example "one-versus-all" algorithms and those that use only positive examples "one-versus-none" algorithms. The steps below show how to add a one-versus-none algorithm called "local" to the GAIN code. The steps for adding a one-versus-all algorithm are analogous.
Give your algorithm a short mnemonic name, e.g., "local".
Add your algorithm's name as a possible option to the one-versus-none and the shorter ovn option in gain.ggo. This change will allow the user to invoke the algorithm with the --one-versus-none local or the --ovn local option.
Create a class called MyOneVersusNoneLocalGainAlgo as a subclass of MyOneVersusNoneGainAlgo in gain-algorithm.h. Document the class, especially by summarising the algorithm. Override any methods in MyOneVersusNoneGainAlgo that you need to.
You will have to override MyOneVersusNoneGainAlgo::getName(). In this case, MyOneVersusNoneLocalGainAlgo::getName() returns "OneVersusNoneLocal".
You will also have to override MyOneVersusNoneGainAlgo::computeState(), since this method is at the very core of every algorithm: it specifies how the state of a node is to be computed, usually by combining the states of the node's neighbours.
Add code to the function addAlgorithms in gain.C that will create an instance of MyOneVersusNoneLocalGainAlgo().
| virtual string MyReallyAbstractGainAlgo::getName | ( | ) | [pure virtual] |
Return the name of the algorithm.
Implemented in MyOneVersusAllGeneManiaGainAlgo, MyOneVersusNoneLocalGainAlgo, MyOneVersusNoneFunctionalFlowGainAlgo, MyOneVersusNoneSinkSourceGainAlgo, MyOneVersusAllSinkSourceGainAlgo, MyOneVersusAllSVMLightTransductiveGainAlgo, MyOneVersusAllSVMLightGainAlgo, MyOneVersusAllLibSVMGainAlgo, MyOneVersusAllHierarchicalHopfieldGainAlgo, MyOneVersusAllSemiHierarchicalHopfieldGainAlgo, MyOneVersusAllMincutGainAlgo, MyOneVersusAllHopfieldGainAlgo, MyOneVersusAllLocalGainAlgo, MyOneVersusNoneGainAlgo, MyOneVersusAllGainAlgo, MyAbstractGainAlgo< StateType >, and MyAbstractGainAlgo< MyGainTriStateType >.
| virtual void MyReallyAbstractGainAlgo::initialiseAlgorithm | ( | ) | [inline, virtual] |
Initialise internal data structures for the algorithm.
Reimplemented in MyOneVersusAllSemiHierarchicalHopfieldGainAlgo.
| virtual void MyReallyAbstractGainAlgo::pipeline | ( | const BioFunction & | function | ) | [pure virtual] |
Run the complete pipeline for the algorithm.
Implemented in MyAbstractGainAlgo< StateType >, and MyAbstractGainAlgo< MyGainTriStateType >.
| virtual void MyReallyAbstractGainAlgo::printStatistics | ( | ostream & | statsStream | ) | [inline, virtual] |
Print statistics about the performance of the algorithm, after processing all functions.
Reimplemented in MyOneVersusAllSemiHierarchicalHopfieldGainAlgo, and MyOneVersusAllGainAlgo.
1.7.6.1