Package pycv :: Package cs :: Package ml :: Package cla :: Module dataset :: Class ScoredWCDataset
[hide private]
[frames] | no frames]

Class ScoredWCDataset

source code

ml.Dataset --+        
             |        
  cla.CDataset --+    
                 |    
  WeightedCDataset --+
                     |
                    ScoredWCDataset

A WeightedCDataset with score s[i] attached to the sample i. Weight w[i] = exp(s[i]) but to be manually updated by calling update_weights(). No weight is generated until one explicitly calls update_weights().

Instance Methods [hide private]
 
update_weights(self) source code
 
__init__(self, separated_input_data, separated_scores=None) source code
 
new(self)
Make a copy of ScoredWCDataset with a copy of scores and a reference to input_data.
source code
 
set_scores(self, value=0)
Set all weight values to 'value', initialize if necessary
source code
 
dofilter(self, j, filterarray)
Filter away some samples in class j.
source code
 
concat(self, j, input_data, scores=None)
Concatenate a few samples to class j.
source code

Inherited from WeightedCDataset: compute_Stats2, compute_Stats2e, compute_Stats2m, get_skewness, get_tw, get_twpc, initialize_weights, normalize_weights, scale_weights, set_weights

Inherited from WeightedCDataset (private): _get_masks

Method Details [hide private]

__init__(self, separated_input_data, separated_scores=None)
(Constructor)

source code 
Overrides: WeightedCDataset.__init__

new(self)

source code 
Make a copy of ScoredWCDataset with a copy of scores and a reference to input_data.
Overrides: WeightedCDataset.new

dofilter(self, j, filterarray)

source code 

Filter away some samples in class j.

Input:
j: class j filterarray: a 'bool' numpy.array of size self.nspc[j]
Output:
fr: filtering rate, the new number of samples of class j divided
by the old number of samples of class j. The ScoredCDataset is updated.
Overrides: WeightedCDataset.dofilter

concat(self, j, input_data, scores=None)

source code 
Concatenate a few samples to class j.

Input:
    j: class j
    input_data: an array of samples
    scores: the additional scores of the samples
        if scores is None:
            all scores of new samples are set to 0
        else:
            concatenate the new scores to the old scores list
Output:
    The ScoredCDataset is updated.

Overrides: WeightedCDataset.concat