Skip to content

Instantly share code, notes, and snippets.

@MiraLak MiraLak/RecognizeActivity.java Secret
Created May 31, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.