Fix minor spelling and style issues.
This commit is contained in:
@@ -355,7 +355,7 @@ BOOST_AUTO_TEST_CASE(SimpleDropoutLayerTest)
|
||||
|
||||
/**
|
||||
* Perform dropout x times using ones as input, sum the number of ones and
|
||||
* validate that the layer is is producing approximately the right number of
|
||||
* validate that the layer is producing approximately the correct number of
|
||||
* ones.
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE(DropoutProbabilityTest)
|
||||
|
||||
@@ -77,14 +77,14 @@ BOOST_AUTO_TEST_CASE(DecisionTreeOutputDimensionTest)
|
||||
|
||||
// Check that number of output points are equal to number of input points.
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::Row<size_t>>("predictions").n_cols,
|
||||
testSize);
|
||||
testSize);
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::mat>("probabilities").n_cols,
|
||||
testSize);
|
||||
testSize);
|
||||
|
||||
// Check number of output rows equals number of classes in case of
|
||||
// probabilities and 1 for predictions.
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::Row<size_t>>("predictions").n_rows,
|
||||
1);
|
||||
BOOST_REQUIRE_EQUAL(
|
||||
CLI::GetParam<arma::Row<size_t>>("predictions").n_rows, 1);
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::mat>("probabilities").n_rows, 3);
|
||||
}
|
||||
|
||||
@@ -160,20 +160,20 @@ BOOST_AUTO_TEST_CASE(DecisionModelReuseTest)
|
||||
// Input trained model.
|
||||
SetInputParam("test", std::move(testData));
|
||||
SetInputParam("input_model",
|
||||
std::move(CLI::GetParam<DecisionTreeModel>("output_model")));
|
||||
std::move(CLI::GetParam<DecisionTreeModel>("output_model")));
|
||||
|
||||
mlpackMain();
|
||||
|
||||
// Check that number of output points are equal to number of input points.
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::Row<size_t>>("predictions").n_cols,
|
||||
testSize);
|
||||
testSize);
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::mat>("probabilities").n_cols,
|
||||
testSize);
|
||||
testSize);
|
||||
|
||||
// Check number of output rows equals number of classes in case of
|
||||
// probabilities and 1 for predicitions.
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::Row<size_t>>("predictions").n_rows,
|
||||
1);
|
||||
BOOST_REQUIRE_EQUAL(
|
||||
CLI::GetParam<arma::Row<size_t>>("predictions").n_rows, 1);
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::mat>("probabilities").n_rows, 3);
|
||||
|
||||
// Check that initial predictions and predictions using saved model are same.
|
||||
|
||||
@@ -122,11 +122,9 @@ BOOST_AUTO_TEST_CASE(EMSTFirstTwoOutputRowsIntegerTest)
|
||||
for (size_t i = 0; i < CLI::GetParam<arma::mat>("output").n_cols; i++)
|
||||
{
|
||||
BOOST_REQUIRE_CLOSE(CLI::GetParam<arma::mat>("output")(0, i),
|
||||
boost::math::iround(
|
||||
CLI::GetParam<arma::mat>("output")(0, i)), 1e-5);
|
||||
boost::math::iround(CLI::GetParam<arma::mat>("output")(0, i)), 1e-5);
|
||||
BOOST_REQUIRE_CLOSE(CLI::GetParam<arma::mat>("output")(1, i),
|
||||
boost::math::iround(
|
||||
CLI::GetParam<arma::mat>("output")(1, i)), 1e-5);
|
||||
boost::math::iround(CLI::GetParam<arma::mat>("output")(1, i)), 1e-5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(LRWrongResponseSizeTest)
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensuring that test data dimensionality is is checked.
|
||||
* Ensuring that test data dimensionality is checked.
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE(LRWrongDimOfDataTest1)
|
||||
{
|
||||
@@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE(LRWrongDimOfDataTest1)
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensuring that test data dimensionality is is checked when model is loaded.
|
||||
* Ensuring that test data dimensionality is checked when model is loaded.
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE(LRWrongDimOfDataTest2)
|
||||
{
|
||||
|
||||
@@ -122,9 +122,9 @@ BOOST_AUTO_TEST_CASE(PreprocessImputerListwiseDimensionTest)
|
||||
if (std::to_string(inputData(0, i)) == "nan" ||
|
||||
std::to_string(inputData(1, i)) == "nan" ||
|
||||
std::to_string(inputData(2, i)) == "nan")
|
||||
{
|
||||
countNaN++;
|
||||
}
|
||||
{
|
||||
countNaN++;
|
||||
}
|
||||
}
|
||||
|
||||
// Input custom data points and labels.
|
||||
|
||||
@@ -105,9 +105,9 @@ BOOST_AUTO_TEST_CASE(PreprocessSplitLabelLessDimensionTest)
|
||||
|
||||
// Now check that the output has desired dimensions.
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::mat>("training").n_cols,
|
||||
std::ceil(0.9 * inputSize));
|
||||
std::ceil(0.9 * inputSize));
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::mat>("test").n_cols,
|
||||
std::floor(0.1 * inputSize));
|
||||
std::floor(0.1 * inputSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,8 +161,8 @@ BOOST_AUTO_TEST_CASE(PreprocessSplitZeroTestRatioTest)
|
||||
|
||||
BOOST_REQUIRE_EQUAL(
|
||||
CLI::GetParam<arma::Mat<size_t>>("training_labels").n_cols, labelSize);
|
||||
BOOST_REQUIRE_EQUAL(CLI::GetParam<arma::Mat<size_t>>("test_labels").n_cols,
|
||||
0);
|
||||
BOOST_REQUIRE_EQUAL(
|
||||
CLI::GetParam<arma::Mat<size_t>>("test_labels").n_cols, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -157,7 +157,7 @@ BOOST_AUTO_TEST_CASE(GermanTest)
|
||||
// The bandwidth of the kernel is selected to be the half the average
|
||||
// distance between each point and the mean of the dataset. This isn't
|
||||
// _exactly_ what the paper says, but I've modified what it said because our
|
||||
// formulation of what the Gaussian kernel is is different.
|
||||
// formulation of what the Gaussian kernel is different.
|
||||
GaussianKernel gk(16.461);
|
||||
|
||||
// Calculate the true kernel matrix.
|
||||
|
||||
Reference in New Issue
Block a user