Skip to content

Instantly share code, notes, and snippets.

View Steppschuh's full-sized avatar

Stephan Schultz Steppschuh

View GitHub Profile

Comparing Classifications

Testing Walking classifier using data from records that matched pattern:

recorded_records.*phone.*walking_right-back

Using 4 features for specific classifications:

  • Standard Deviation Accelerometer
  • Variance Accelerometer

Emphasis

@Test
public void example() throws Exception {
    StringBuilder sb = new StringBuilder()
            .append(new Text("I am normal")).append("\n")
            .append(new BoldText("I am bold")).append("\n")
            .append(new ItalicText("I am italic")).append("\n")
            .append(new StrikeThroughText("I am strike-through"));
public static float calculateF1Score(float precision, float recall) {
return calculateFScore(1, precision, recall);
}
public static float calculateFScore(double beta, float precision, float recall) {
return (float) (1 + Math.pow(beta, 2)) * ((precision * recall) / (precision + recall));
}
public static float calculatePrecision(int truePositives, int falsePositives) {
return truePositives / (float) (truePositives + falsePositives);
@Steppschuh
Steppschuh / 500pxImageSrc.js
Created March 31, 2018 18:34
Get the image URL of photos viewed on 500px
/**
* Copy & paste this code into the Google Chrome console
* while viewing a photo on 500px and it will open the
* image URL in a new tab.
*
* You can toggle the console by pressing:
* Ctrl+Shift+J (Windows / Linux)
* Cmd+Opt+J (Mac)
*/
@Steppschuh
Steppschuh / BundleUtil.java
Created April 16, 2018 12:33
Convenience methods to convert Android Bundle to PersistableBundle and back
import android.os.BaseBundle;
import android.os.Bundle;
import android.os.PersistableBundle;
public final class BundleUtil {
/**
* Creates a new {@link Bundle} based on the specified {@link PersistableBundle}.
*/
public static Bundle toBundle(PersistableBundle persistableBundle) {