本文整理汇总了C++中TimeSeriesClassificationData::scale方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeSeriesClassificationData::scale方法的具体用法?C++ TimeSeriesClassificationData::scale怎么用?C++ TimeSeriesClassificationData::scale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeSeriesClassificationData
的用法示例。
在下文中一共展示了TimeSeriesClassificationData::scale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: train_
bool ParticleClassifier::train_(TimeSeriesClassificationData &trainingData){
clear();
numClasses = trainingData.getNumClasses();
numInputDimensions = trainingData.getNumDimensions();
ranges = trainingData.getRanges();
//Scale the training data if needed
if( useScaling ){
trainingData.scale(0, 1);
}
//Train the particle filter
particleFilter.train( numParticles, trainingData, sensorNoise, transitionSigma, phaseSigma, velocitySigma );
classLabels.resize(numClasses);
classLikelihoods.resize(numClasses,0);
classDistances.resize(numClasses,0);
for(unsigned int i=0; i<numClasses; i++){
classLabels[i] = trainingData.getClassTracker()[i].classLabel;
}
trained = true;
return trained;
}
示例2: train_continuous
bool HMM::train_continuous(TimeSeriesClassificationData &trainingData){
clear();
if( trainingData.getNumSamples() == 0 ){
errorLog << "train_continuous(TimeSeriesClassificationData &trainingData) - There are no training samples to train the CHMM classifer!" << endl;
return false;
}
//Reset the CHMM
numInputDimensions = trainingData.getNumDimensions();
numClasses = trainingData.getNumClasses();
classLabels.resize( numClasses );
for(UINT k=0; k<numClasses; k++){
classLabels[k] = trainingData.getClassTracker()[k].classLabel;
}
//Scale the training data if needed
ranges = trainingData.getRanges();
if( useScaling ){
trainingData.scale(0, 1);
}
//Setup the models, there will be 1 model for each training sample
const UINT numTrainingSamples = trainingData.getNumSamples();
continuousModels.resize( numTrainingSamples );
//Train each of the models
for(UINT k=0; k<numTrainingSamples; k++){
//Init the model
continuousModels[k].setDownsampleFactor( downsampleFactor );
continuousModels[k].setModelType( modelType );
continuousModels[k].setDelta( delta );
continuousModels[k].setSigma( sigma );
continuousModels[k].setAutoEstimateSigma( autoEstimateSigma );
continuousModels[k].enableScaling( false ); //Scaling should always off for the models as we do any scaling in the CHMM
//Train the model
if( !continuousModels[k].train_( trainingData[k] ) ){
errorLog << "train_continuous(TimeSeriesClassificationData &trainingData) - Failed to train CHMM for sample " << k << endl;
return false;
}
}
if( committeeSize > trainingData.getNumSamples() ){
committeeSize = trainingData.getNumSamples();
warningLog << "train_continuous(TimeSeriesClassificationData &trainingData) - The committeeSize is larger than the number of training sample. Setting committeeSize to number of training samples: " << trainingData.getNumSamples() << endl;
}
//Flag that the model has been trained
trained = true;
//Compute any null rejection thresholds if needed
if( useNullRejection ){
//Compute the rejection thresholds
nullRejectionThresholds.resize(numClasses);
}
return true;
}