Use double for the validationSize parameter
This commit is contained in:
@@ -53,7 +53,7 @@ class SimpleCV :
|
||||
* constructors for reference).
|
||||
*/
|
||||
template<typename... CVBaseArgs>
|
||||
SimpleCV(const float validationSize, const CVBaseArgs&... args);
|
||||
SimpleCV(const double validationSize, const CVBaseArgs&... args);
|
||||
|
||||
/**
|
||||
* Train on the training set and assess performance on the validation set by
|
||||
@@ -101,7 +101,7 @@ class SimpleCV :
|
||||
template<typename DataArgsTupleT,
|
||||
typename = typename std::enable_if<
|
||||
std::tuple_size<DataArgsTupleT>::value == 2>::type>
|
||||
void Init(const float validationSize, const DataArgsTupleT& dataArgsTuple);
|
||||
void Init(const double validationSize, const DataArgsTupleT& dataArgsTuple);
|
||||
|
||||
/**
|
||||
* Initialize with weights.
|
||||
@@ -110,17 +110,17 @@ class SimpleCV :
|
||||
typename = typename std::enable_if<
|
||||
std::tuple_size<DataArgsTupleT>::value == 3>::type,
|
||||
typename = void>
|
||||
void Init(const float validationSize, const DataArgsTupleT& dataArgsTuple);
|
||||
void Init(const double validationSize, const DataArgsTupleT& dataArgsTuple);
|
||||
|
||||
/**
|
||||
* Initialize training and validation sets.
|
||||
*/
|
||||
void InitTrainingAndValidationSets(const float validationSize);
|
||||
void InitTrainingAndValidationSets(const double validationSize);
|
||||
|
||||
/**
|
||||
* Calculate the number of training points and assert it is legitimate.
|
||||
*/
|
||||
size_t CalculateAndAssertNumberOfTrainingPoints(const float validationSize);
|
||||
size_t CalculateAndAssertNumberOfTrainingPoints(const double validationSize);
|
||||
|
||||
/**
|
||||
* Train and run evaluation in the case of non-weighted learning.
|
||||
|
||||
@@ -27,7 +27,7 @@ SimpleCV<MLAlgorithm,
|
||||
Metric,
|
||||
MatType,
|
||||
PredictionsType,
|
||||
WeightsType>::SimpleCV(const float validationSize,
|
||||
WeightsType>::SimpleCV(const double validationSize,
|
||||
const CVBaseArgs&... args) :
|
||||
Base(args...)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ void SimpleCV<MLAlgorithm,
|
||||
Metric,
|
||||
MatType,
|
||||
PredictionsType,
|
||||
WeightsType>::Init(const float validationSize,
|
||||
WeightsType>::Init(const double validationSize,
|
||||
const DataArgsTupleT& dataArgsTuple)
|
||||
{
|
||||
xs = std::get<0>(dataArgsTuple);
|
||||
@@ -101,7 +101,7 @@ void SimpleCV<MLAlgorithm,
|
||||
Metric,
|
||||
MatType,
|
||||
PredictionsType,
|
||||
WeightsType>::Init(const float validationSize,
|
||||
WeightsType>::Init(const double validationSize,
|
||||
const DataArgsTupleT& dataArgsTuple)
|
||||
{
|
||||
xs = std::get<0>(dataArgsTuple);
|
||||
@@ -125,7 +125,7 @@ void SimpleCV<MLAlgorithm,
|
||||
MatType,
|
||||
PredictionsType,
|
||||
WeightsType>::InitTrainingAndValidationSets(
|
||||
const float validationSize)
|
||||
const double validationSize)
|
||||
{
|
||||
size_t numberOfTrainingPoints = CalculateAndAssertNumberOfTrainingPoints(
|
||||
validationSize);
|
||||
@@ -147,7 +147,7 @@ size_t SimpleCV<MLAlgorithm,
|
||||
MatType,
|
||||
PredictionsType,
|
||||
WeightsType>::CalculateAndAssertNumberOfTrainingPoints(
|
||||
const float validationSize)
|
||||
const double validationSize)
|
||||
{
|
||||
if (validationSize < 0.0F || validationSize > 1.0F)
|
||||
throw std::invalid_argument("SimpleCV: the validationSize parameter should "
|
||||
|
||||
Reference in New Issue
Block a user