OTB  6.7.0
Orfeo Toolbox
Classes | Typedefs
otb::sampleAugmentation Namespace Reference

Classes

struct  NeighborSorter
 
struct  NeighborType
 

Typedefs

using SampleType = std::vector< double >
 
using SampleVectorType = std::vector< SampleType >
 

Functions

SampleType EstimateStds (const SampleVectorType &samples)
 
SampleType SmoteCombine (const SampleType &s1, const SampleType &s2, double position)
 
void Smote (const SampleVectorType &inSamples, const vcl_size_t nbSamples, SampleVectorType &newSamples, const int nbNeighbors, const int seed=std::time(nullptr))
 
using NNIndicesType = std::vector< NeighborType >
 
using NNVectorType = std::vector< NNIndicesType >
 
void ReplicateSamples (const SampleVectorType &inSamples, const vcl_size_t nbSamples, SampleVectorType &newSamples)
 
void JitterSamples (const SampleVectorType &inSamples, const vcl_size_t nbSamples, SampleVectorType &newSamples, float stdFactor=10, const int seed=std::time(nullptr))
 
double ComputeSquareDistance (const SampleType &x, const SampleType &y)
 
void FindKNNIndices (const SampleVectorType &inSamples, const vcl_size_t nbNeighbors, NNVectorType &nnVector)
 

Typedef Documentation

Create new samples by replicating input samples. We loop through the input samples and add them to the new data set until nbSamples are added. The elements of newSamples are removed before proceeding.

Definition at line 167 of file otbSampleAugmentation.h.

Create new samples by replicating input samples. We loop through the input samples and add them to the new data set until nbSamples are added. The elements of newSamples are removed before proceeding.

Definition at line 168 of file otbSampleAugmentation.h.

using otb::sampleAugmentation::SampleType = typedef std::vector<double>

Definition at line 39 of file otbSampleAugmentation.h.

Definition at line 40 of file otbSampleAugmentation.h.

Function Documentation

double otb::sampleAugmentation::ComputeSquareDistance ( const SampleType &  x,
const SampleType &  y 
)

Create new samples by replicating input samples. We loop through the input samples and add them to the new data set until nbSamples are added. The elements of newSamples are removed before proceeding.

Definition at line 156 of file otbSampleAugmentation.h.

Referenced by FindKNNIndices().

SampleType otb::sampleAugmentation::EstimateStds ( const SampleVectorType &  samples)

Estimate standard deviations of the components in one pass using Welford's algorithm

Definition at line 46 of file otbSampleAugmentation.h.

Referenced by JitterSamples().

void otb::sampleAugmentation::FindKNNIndices ( const SampleVectorType &  inSamples,
const vcl_size_t  nbNeighbors,
NNVectorType &  nnVector 
)

Returns the indices of the nearest neighbors for each input sample

Definition at line 171 of file otbSampleAugmentation.h.

References ComputeSquareDistance().

Referenced by Smote().

void otb::sampleAugmentation::JitterSamples ( const SampleVectorType &  inSamples,
const vcl_size_t  nbSamples,
SampleVectorType &  newSamples,
float  stdFactor = 10,
const int  seed = std::time(nullptr) 
)

Create new samples by adding noise to existing samples. Gaussian noise is added to randomly selected samples. The standard deviation of the noise added to each component is the same as the one of the input variables divided by stdFactor (defaults to 10). The elements of newSamples are removed before proceeding.

Definition at line 107 of file otbSampleAugmentation.h.

References EstimateStds().

void otb::sampleAugmentation::ReplicateSamples ( const SampleVectorType &  inSamples,
const vcl_size_t  nbSamples,
SampleVectorType &  newSamples 
)

Create new samples by replicating input samples. We loop through the input samples and add them to the new data set until nbSamples are added. The elements of newSamples are removed before proceeding.

Definition at line 82 of file otbSampleAugmentation.h.

void otb::sampleAugmentation::Smote ( const SampleVectorType &  inSamples,
const vcl_size_t  nbSamples,
SampleVectorType &  newSamples,
const int  nbNeighbors,
const int  seed = std::time(nullptr) 
)

Create new samples using the SMOTE algorithm Chawla, N. V., Bowyer, K. W., Hall, L. O., & Kegelmeyer, W. P., Smote: synthetic minority over-sampling technique, Journal of artificial intelligence research, 16(), 321–357 (2002). http://dx.doi.org/10.1613/jair.953

Definition at line 214 of file otbSampleAugmentation.h.

References FindKNNIndices(), and SmoteCombine().

SampleType otb::sampleAugmentation::SmoteCombine ( const SampleType &  s1,
const SampleType &  s2,
double  position 
)

Generate the new sample in the line linking s1 and s2

Definition at line 199 of file otbSampleAugmentation.h.

Referenced by Smote().