Into

Modules

Documentation

classPiiSampleSetCollector

#include <PiiSampleSetCollector.h>

A learning algorithm that just collects all incoming data into a sample set.

Inherits PiiLearningAlgorithm< SampleSet >

Description

Public types

typedef PiiSampleSet::Traits< SampleSet >::ConstFeatureIterator

Constructors and destructor

Creates a new PiiSampleSetCollector that creates the sample, label and weight sets automatically and takes care of deleting them.

(
  • SampleSet * sampleSet
  • QVector< double > * labels
  • QVector< double > * weights
)

Creates a new sample set collector that appends samples to the given sample set, label list and weight list.

(
  • SampleSet * sampleSet
  • QVector< double > * labels
)

Creates a new sample set collector that appends samples to the given sample set and label list.

(
  • SampleSet * sampleSet
)

Creates a new sample set collector that appends samples to the given sample set.

Destroys this sample set collector.

Public member functions

int

Returns the batch size.

virtual PiiClassification::LearnerCapabilities

Returns NonSupervisedLearner | OnlineLearner | WeightedLearner;.

QVector< double > *

Returns the class labels.

bool

Returns true if class labels are being collected, false otherwise.

bool

Returns true if sample weights are being collected, false otherwise.

virtual bool

Returns true.

int

Returns the number of features in the stored samples.

Returns the way full buffer is handled.

virtual void
(
  • const SampleSet & samples
  • const QVector< double > & labels
  • const QVector< double > & weights
)

Replaces all collected samples and labels with the given new ones.

virtual double
(
  • ConstFeatureIterator sample
  • int length
  • double label
  • double weight
)

Appends sample to the sample set.

void
(
  • int samples
)

Resizes the collected sample set and associated labels and weight so that at most samples entries are be retained.

int

Returns the number of samples currently in the sample set.

SampleSet *

Returns the sample set.

QVector< double > *

Returns the sample weights.

void
(
  • int batchSize
)

Sets the maximum size for the buffer.

void
( )

Sets the class labels.

void
(
  • bool collectLabels
)

Enables or disables the collecting of class labels.

void
(
  • bool collectWeights
)

Enables or disables the collecting of sample weights.

void

Sets the strategy of handling a full buffer.

void
(
  • SampleSet * samples
)

Set the sample set.

void
( )

Sets the sample weights.

Function details

  • PiiSampleSetCollector

    ()

    Creates a new PiiSampleSetCollector that creates the sample, label and weight sets automatically and takes care of deleting them.

  • PiiSampleSetCollector

    (
    • SampleSet * sampleSet
    • QVector< double > * labels
    • QVector< double > * weights
    )

    Creates a new sample set collector that appends samples to the given sample set, label list and weight list.

    PiiSampleSetCollector doesn't take the ownership of the pointers, and they must remain valid during the lifetime of this object.

  • PiiSampleSetCollector

    (
    • SampleSet * sampleSet
    • QVector< double > * labels
    )

    Creates a new sample set collector that appends samples to the given sample set and label list.

    PiiSampleSetCollector doesn't take the ownership of the pointers, and they must remain valid during the lifetime of this object. The weight list will be created internally.

  • PiiSampleSetCollector

    (
    • SampleSet * sampleSet
    )

    Creates a new sample set collector that appends samples to the given sample set.

    PiiSampleSetCollector doesn't take the ownership of the pointers and it must remain valid during the lifetime of this object. The label and weight lists will be created internally.

  • ~PiiSampleSetCollector

    ()

    Destroys this sample set collector.

  • int batchSize

    ()

    Returns the batch size.

  • virtual PiiClassification::LearnerCapabilities capabilities

    ()
    [virtual]

    Returns NonSupervisedLearner | OnlineLearner | WeightedLearner;.

    Reimplemented from PiiLearningAlgorithm.

  • QVector< double > * classLabels

    ()

    Returns the class labels.

  • bool collectLabels

    ()

    Returns true if class labels are being collected, false otherwise.

  • bool collectWeights

    ()

    Returns true if sample weights are being collected, false otherwise.

  • virtual bool converged

    ()
    [virtual]

    Returns true.

    Reimplemented from PiiLearningAlgorithm.

  • int featureCount

    ()

    Returns the number of features in the stored samples.

    If the sample set is empty, zero will be returned.

  • Returns the way full buffer is handled.

  • virtual void learn

    (
    • const SampleSet & samples
    • const QVector< double > & labels
    • const QVector< double > & weights
    )
    [virtual]

    Replaces all collected samples and labels with the given new ones.

    Reimplemented from PiiLearningAlgorithm.

  • virtual double learnOne

    (
    • ConstFeatureIterator sample
    • int length
    • double label
    • double weight
    )
    [virtual]

    Appends sample to the sample set.

    If label collection is enabled, label will be added to the label set. If weight collection is enabled, weight will be added to the weight set. If length doesn't match the current number of features, the current sample set will be cleared first. Returns the index of the just added sample in the sample set.

    Reimplemented from PiiLearningAlgorithm.

  • void resize

    (
    • int samples
    )

    Resizes the collected sample set and associated labels and weight so that at most samples entries are be retained.

  • int sampleCount

    ()

    Returns the number of samples currently in the sample set.

  • SampleSet * samples

    ()

    Returns the sample set.

  • QVector< double > * sampleWeights

    ()

    Returns the sample weights.

  • void setBatchSize

    (
    • int batchSize
    )

    Sets the maximum size for the buffer.

    -1 means no limit.

  • void setClassLabels

    ( )

    Sets the class labels.

    If the class labels are set to 0, an empty vector will be automatically created.

  • void setCollectLabels

    (
    • bool collectLabels
    )

    Enables or disables the collecting of class labels.

    If class labels are not collected, the class label list will remain empty. The default value is true, unless only a sample list is given in the constructor.

  • void setCollectWeights

    (
    • bool collectWeights
    )

    Enables or disables the collecting of sample weights.

    If sample weights are not collected, the weight list will remain empty. The default value is false, unless a weight list is explicitly given in the constructor.

  • void setFullBufferBehavior

    Sets the strategy of handling a full buffer.

  • void setSamples

    (
    • SampleSet * samples
    )

    Set the sample set.

    If the samples are set to 0, a new sample set will be automatically created.

  • void setSampleWeights

    ( )

    Sets the sample weights.

    If the weights are set to 0, an empty vector will be automatically created.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.