« Back to home

Supervised Learning in Practice

Week Five:

  • “Choosing a supervised learning algorithm” decision tree (forum link)
  • Arduino circuit photo and code (below)
  • Paper questionnaire (handed in)

Reflection:

I found making a decision tree of common supervised machine learning algorithms not entirely straight-forward. The no free lunch theorem (Wikipedia link) states that algorithms can never be optimal for all problems. And the number of exceptions in the decision tree I made point to the same conclusion. For example it suggests not using k-NN if fast computation is a factor despite the fact that kNN is very fast if the “training” data doesn’t have too many dimensions or samples. The word training in the last sentence is in quotes because k-NN doesn’t involve any at all which is another case it is faster than alternatives like SVM.

This week I tried classifying gestures using an Arduino with a light sensor stripboard already attatched. Specifically I tried training a model to differentiate between close hand waving (1-5cm from the LDR) to more distant hand waving (15-25cm). Instead of using an algorithm designed for temporal samples I collected LDR values in the software and calculated mean and standard deviation. When I tried running the model, close hand waves couldn’t be classified without misclassifying it as a distant hand wave at the start and end of the gesture. Training specific gestures to be classified as non-hand waves helped reduce this issue. Photo and code below…

sfiuh

// Code originally from http://www.instructables.com/id/Arduino-to-Processing-Serial-Communication-withou/
// by https://www.instructables.com/member/thelostspore/
// Code was shared under public domain https://creativecommons.org/licenses/publicdomain/

// also based on code from here: https://www.arduino.cc/en/Tutorial/SerialCallResponse

int AnalogPin0 = A0; //Declare an integer variable, hooked up to analog pin 0

void setup() {
  Serial.begin(9600); //Begin Serial Communication with a baud rate of 9600
  while(!Serial) {
	; // wait for serial port to connect
  }
}

void loop() {
   // store reading from LDR sensor
  int Value1 = analogRead(AnalogPin0);

  // send sensor reading out of serial port
  Serial.print(Value1, DEC);

  // follow output with a return/newline
  Serial.println();
}

This post is for Data and Machine Learning for Creative Practice (IS53055A)