diff --git a/examples/kcentroid_ex.cpp b/examples/kcentroid_ex.cpp index 1756f7e29..79b26fe85 100644 --- a/examples/kcentroid_ex.cpp +++ b/examples/kcentroid_ex.cpp @@ -94,8 +94,9 @@ int main() m(0) = -1.5; m(1) = sinc(m(0))+0.9; cout << " " << test(m) << " is " << rs.scale(test(m)) << " standard deviations from sinc." << endl; m(0) = -0.5; m(1) = sinc(m(0))+1; cout << " " << test(m) << " is " << rs.scale(test(m)) << " standard deviations from sinc." << endl; + // And finally print out the mean and standard deviation of points that are actually from sinc(). cout << "\nmean: " << rs.mean() << endl; - cout << "standard deviation: " << sqrt(rs.variance()) << endl; + cout << "standard deviation: " << rs.stddev() << endl; // The output is as follows: /* diff --git a/examples/rank_features_ex.cpp b/examples/rank_features_ex.cpp index ca8017630..628450a94 100644 --- a/examples/rank_features_ex.cpp +++ b/examples/rank_features_ex.cpp @@ -100,7 +100,9 @@ int main() // The radial_basis_kernel has a parameter called gamma that we need to set. Generally, // you should try the same gamma that you are using for training. But if you don't // have a particular gamma in mind then you can use the following function to - // find a reasonable default gamma for your data. + // find a reasonable default gamma for your data. Another reasonable way to pick a gamma + // is often to use 1.0/compute_mean_squared_distance(samples). This second way has the + // bonus of being quite fast. const double gamma = verbose_find_gamma_with_big_centroid_gap(samples, labels); // Next we declare an instance of the kcentroid object. It is used by rank_features()