#include <patternset.h>
Inheritance diagram for PatternSource:
Public Types | |
enum | psetflags |
Public Methods | |
PatternSource (const PatternSource &orig) | |
virtual void | print (FILE *out=stdout) const |
virtual double | input (int p, int i) const |
virtual double | output (int p, int j) const |
virtual int | getClass (int p) const |
virtual void | recombine (int startp=-1, int endp=-1) |
virtual void | recombine2 (int startp=-1, int endp=-1) |
virtual void | copy (const PatternSource &other, int startp=-1, int endp=-1) |
void | operator= (const PatternSource &other) |
const String & | name () const |
void | setName (const String &name) |
void | join (const PatternSource &a, const PatternSource &b) |
void | split (PatternSource &a, PatternSource &b, double ratio) const |
void | filter (const PatternSource &source, const String &bits) |
int | classes () const |
Array< int > | countClasses () const |
void | check () const |
Public Attributes | |
int | inputs |
int | outputs |
int | patterns |
Protected Methods | |
virtual void | make (int patterns, int inputs, int outputs) |
Protected Attributes | |
String | mName |
Definition at line 45 of file patternset.h.
|
Pattern set flags.
Definition at line 153 of file patternset.h. |
|
Inheritor's copy constructor should call this.
Definition at line 45 of file patternset.cc. |
|
Implementation for Object.
Reimplemented in PatternSet. Definition at line 212 of file patternset.cc. References inputs, outputs, and patterns. Referenced by PatternSet::check(). |
|
Returns the number of output classes in the set. This assumes that the pattern set is for a classification task. For each class there is one output. But, if there are only two classes, they can be represented by just one output. Definition at line 127 of file patternset.h. References outputs. Referenced by countClasses(). |
|
Copies a range from another training set.
Definition at line 75 of file patternset.cc. References input(), inputs, make(), output(), outputs, and patterns. Referenced by PatternSet::copy(), join(), operator=(), and split(). |
|
Returns the number of instances for each class. This works only for patterns sets used in classification tasks where there is one output for each class (or just one output in case of two classes). It is assumed that when a pattern belongs to a certain class with index c, the c:th input variable is set to value >0.5. Otherwise it is set to value <0.5. Definition at line 201 of file patternset.cc. References classes(), getClass(), and patterns. |
|
Copies another set by filtering the input variables with bit string mask containing characters "0" and "1". If bits string is null (len==0), all inputs will be taken. Definition at line 163 of file patternset.cc. References input(), inputs, make(), output(), outputs, and patterns. |
|
Returns the output class index for pattern p (the index of the highest output).
Definition at line 58 of file patternset.cc. References output(), and outputs. Referenced by countClasses(), and Learner::testClassify(). |
|
Returns the value of input variable i in pattern p.
Reimplemented in PatternSet, and ArrayTrainSet. Definition at line 57 of file patternset.h. Referenced by copy(), filter(), join(), and ANNetwork::testPattern(). |
|
Creates this set as union of two sets.
Definition at line 106 of file patternset.cc. References copy(), input(), inputs, make(), output(), outputs, and patterns. |
|
Initializes a training set with given number of input and output values and patterns.
Reimplemented in PatternSet, and ArrayTrainSet. Definition at line 162 of file patternset.h. |
|
Returns the name of the set.
Definition at line 101 of file patternset.h. References mName. Referenced by setName(). |
|
Sugar for the copy operation.
Definition at line 98 of file patternset.h. References copy(). |
|
Returns the value of output variable j in pattern p.
Reimplemented in PatternSet, and ArrayTrainSet. Definition at line 60 of file patternset.h. Referenced by copy(), filter(), getClass(), join(), Learner::test(), and Learner::testClassify(). |
|
Prints the contents of the set to the given stream.
Reimplemented in PatternSet, and ArrayTrainSet. Definition at line 54 of file patternset.h. |
|
Shuffles the patterns in the set.
Reimplemented in PatternSet. Definition at line 74 of file patternset.h. |
|
As recombine above, except that this shuffles so that the even and odd-numbered patterns are not mixed, but preserve their evenness and oddity. Pattern set or the shuffling range (see the parameters below) must have even number of patterns.
Reimplemented in PatternSet. Definition at line 86 of file patternset.h. |
|
Sets the name of the set.
Definition at line 104 of file patternset.h. |
|
Splits this set into two subsets a and b according to given ratio.
Definition at line 145 of file patternset.cc. |
|
Number of input variables in the patterns.
Definition at line 144 of file patternset.h. Referenced by ArrayTrainSet::ArrayTrainSet(), check(), copy(), filter(), PatternSet::getMatrix(), join(), SNNSDataFormat::load(), ArrayTrainSet::make(), make(), ArrayTrainSet::output(), PatternSet::PatternSet(), PatternSource(), PatternSet::recombine(), PatternSet::recombine2(), split(), ANNetwork::testPattern(), BackpropTrainer::trainPattern(), and ArrayTrainSet::truncate(). |
|
A name for the pattern set.
Definition at line 157 of file patternset.h. Referenced by name(), PatternSource(), and setName(). |
|
Number of output variables in the patterns.
Definition at line 147 of file patternset.h. Referenced by ArrayTrainSet::ArrayTrainSet(), check(), classes(), copy(), filter(), getClass(), PatternSet::getMatrix(), join(), SNNSDataFormat::load(), ArrayTrainSet::make(), make(), PatternSet::PatternSet(), PatternSource(), AbsoluteNeuralPrediction::predict(), PatternSet::recombine(), PatternSet::recombine2(), split(), Learner::test(), Learner::testClassify(), ANNetwork::testPattern(), BackpropTrainer::trainPattern(), and ArrayTrainSet::truncate(). |
|
Number of patterns in the pattern set.
Definition at line 150 of file patternset.h. Referenced by ArrayTrainSet::ArrayTrainSet(), check(), copy(), countClasses(), filter(), PatternSet::getMatrix(), join(), SNNSDataFormat::load(), ArrayTrainSet::make(), make(), AbsoluteNeuralPrediction::makeSet(), PatternSet::PatternSet(), PatternSource(), AbsoluteNeuralPrediction::predict(), PatternSet::recombine(), PatternSet::recombine2(), split(), Learner::test(), Learner::testClassify(), Trainer::train(), BackpropTrainer::trainOnce(), and ArrayTrainSet::truncate(). |