Skip to content

Instantly share code, notes, and snippets.

@MiraLak
Created May 31, 2015 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiraLak/1cc323a08e3880da4695 to your computer and use it in GitHub Desktop.
Save MiraLak/1cc323a08e3880da4695 to your computer and use it in GitHub Desktop.
Actitacker Spark Cassandra
/**
* build the data set with label & features (11)
* activity, mean_x, mean_y, mean_z, var_x, var_y, var_z, avg_abs_diff_x, avg_abs_diff_y, avg_abs_diff_z, res, peak_y
*/
private static LabeledPoint getLabeledPoint(String activity, double[] mean, double[] variance, double[] avgAbsDiff, double resultant, double avgTimePeak) {
// First the feature
double[] features = new double[]{
mean[0],
mean[1],
mean[2],
variance[0],
variance[1],
variance[2],
avgAbsDiff[0],
avgAbsDiff[1],
avgAbsDiff[2],
resultant,
avgTimePeak
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment