Minor style fixes.

This commit is contained in:
Ryan Curtin
2019-06-20 21:03:02 -04:00
parent 748c552390
commit e3989bd4eb
6 changed files with 15 additions and 12 deletions
+2 -1
View File
@@ -2,7 +2,8 @@
###### ????-??-??
* Add Multiple Pole Balancing Environment (#1901).
* Add New paramter Maximum_depth to Decision Tree And Random Forest (#1916).
* Add new parameter `maximum_depth` to decision tree and random forest
bindings (#1916).
* Fix prediction output of softmax regression when test set accuracy is
calculated (#1922).
@@ -657,6 +657,7 @@ double DecisionTree<FitnessFunction,
break;
}
}
// Did we split or not? If so, then split the data and create the children.
if (bestDim != datasetInfo.Dimensionality())
{
@@ -828,6 +829,7 @@ double DecisionTree<FitnessFunction,
break;
}
}
// Did we split or not? If so, then split the data and create the children.
if (bestDim != data.n_rows)
{
@@ -47,9 +47,9 @@ PROGRAM_INFO("Decision tree",
" parameter specifies the minimum number of training points that must fall"
" into each leaf for it to be split. The " +
PRINT_PARAM_STRING("minimum_gain_split") + " parameter specifies "
"the minimum gain that is needed for the node to split. The " +
"the minimum gain that is needed for the node to split. The " +
PRINT_PARAM_STRING("maximum_depth") + " parameter specifies "
"the maximum depth of the tree. If " +
"the maximum depth of the tree. If " +
PRINT_PARAM_STRING("print_training_error") + " is specified, the training "
"error will be printed."
"\n\n"
@@ -102,7 +102,7 @@ PARAM_INT_IN("minimum_leaf_size", "Minimum number of points in a leaf.", "n",
20);
PARAM_DOUBLE_IN("minimum_gain_split", "Minimum gain for node splitting.", "g",
1e-7);
PARAM_INT_IN("maximum_depth", "Maximum Depth of the tree.(0 means no limit)",
PARAM_INT_IN("maximum_depth", "Maximum depth of the tree (0 means no limit).",
"D", 0);
// This is deprecated and should be removed in mlpack 4.0.0.
PARAM_FLAG("print_training_error", "Print the training error (deprecated; will "
@@ -162,7 +162,7 @@ static void mlpackMain()
"leaf size must be positive");
RequireParamValue<int>("maximum_depth", [](int x) { return x >= 0; }, true,
"depth must not be negative");
"maximum depth must not be negative");
RequireParamValue<double>("minimum_gain_split", [](double x)
{ return (x > 0.0 && x < 1.0); }, true,
@@ -50,7 +50,7 @@ PROGRAM_INFO("Random forests",
" controls the number of trees in the random forest. The " +
PRINT_PARAM_STRING("minimum_gain_split") + " parameter controls the minimum"
" required gain for a decision tree node to split. Larger values will "
"force higher-confidence splits. The " +
"force higher-confidence splits. The " +
PRINT_PARAM_STRING("maximum_depth") + " parameter specifies "
"the maximum depth of the tree. The " +
PRINT_PARAM_STRING("subspace_dim") + " parameter is used to control the "
@@ -107,7 +107,7 @@ PARAM_FLAG("print_training_accuracy", "If set, then the accuracy of the model "
PARAM_INT_IN("num_trees", "Number of trees in the random forest.", "N", 10);
PARAM_INT_IN("minimum_leaf_size", "Minimum number of points in each leaf "
"node.", "n", 1);
PARAM_INT_IN("maximum_depth", "Maximum depth of the tree.(0 means no limit)",
PARAM_INT_IN("maximum_depth", "Maximum depth of the tree (0 means no limit).",
"D", 0);
PARAM_MATRIX_OUT("probabilities", "Predicted class probabilities for each "
"point in the test set.", "P");
@@ -181,7 +181,7 @@ static void mlpackMain()
RequireParamValue<int>("minimum_leaf_size", [](int x) { return x > 0; }, true,
"minimum leaf size must be greater than 0");
RequireParamValue<int>("maximum_depth", [](int x) { return x >= 0; }, true,
"depth must not be negative");
"maximum depth must not be negative");
RequireParamValue<int>("subspace_dim", [](int x) { return x >= 0; }, true,
"subspace dimensionality must be nonnegative");
RequireParamValue<double>("minimum_gain_split",
+1 -1
View File
@@ -1217,7 +1217,7 @@ BOOST_AUTO_TEST_CASE(DecisionTreeCategoricalTrainReturnEntropy)
}
/**
* Make sure different Maximum Depth gives different number of children.
* Make sure different maximum depth values give different numbers of children.
*/
BOOST_AUTO_TEST_CASE(DifferentMaximumDepthTest)
{
@@ -174,7 +174,7 @@ BOOST_AUTO_TEST_CASE(DecisionTreeMinimumLeafSizeTest)
}
/**
* Make sure maximum depth size is always a non-negative number.
* Make sure maximum depth is always a non-negative number.
*/
BOOST_AUTO_TEST_CASE(DecisionTreeNonNegativeMaximumDepthTest)
{
@@ -201,6 +201,7 @@ BOOST_AUTO_TEST_CASE(DecisionTreeNonNegativeMaximumDepthTest)
BOOST_REQUIRE_THROW(mlpackMain(), std::runtime_error);
Log::Fatal.ignoreInput = false;
}
/**
* Make sure minimum gain split is always a fraction in range [0,1].
*/
@@ -454,8 +455,7 @@ BOOST_AUTO_TEST_CASE(DecisionModelCategoricalReuseTest)
}
/**
* Check that different maximum depth gives
* different results.
* Check that different maximum depths give different results.
*/
BOOST_AUTO_TEST_CASE(DecisionTreeMaximumDepthTest)
{