Commit 5c5bc580 authored by Davis King's avatar Davis King

Added some comments and cleaned up code slightly.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403420
parent 0350895d
......@@ -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:
/*
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment