SimpleSplit.java [src/java/m/ann/training/scale] Revision: default Date:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package m.ann.training.scale;
import java.util.List;
import org.bson.Document;
/**
*
* @author sidereus
*/
class SimpleSplit extends ScalingMechanism {
@Override
public String getStrategy() {
return "SimpleSplit";
}
@Override
public DataSetIndices compute(Iterable<Document> d, double trainingPerc) {
int dataLength = getDataLength(d);
int trainingLength = getTrainingLength(trainingPerc, dataLength);
List<Integer> range = getRange(dataLength);
return new DataSetIndices(range.subList(0, trainingLength), range.subList(trainingLength, dataLength));
}
}