GithubHelp home page GithubHelp logo

chuski92 / roboticauvic-unsupervised Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aramisa/roboticauvic-unsupervised

0.0 0.0 0.0 6.77 MB

UVic Robotics Master. Perception. Homework Session 8

Jupyter Notebook 100.00%

roboticauvic-unsupervised's Introduction

Pattern Recognition Assignments 3: Unsupervised Learning

UVic Robotics Master. Perception. Homework 8.

Instructions

Clone this repository and write code to complete the assignments. When executed, your code must print the answers to the questions in each section, alongside the results that led to these conclusions. Module textwrap can be used to format long paragraphs of text and make them look nicer. An IPython notebook is an acceptable alternative to a plain python program.

This is a personal assignment, please complete it individually.

K-Means

  • Q1 Implement the K-Means algorithm. The K-Means technique is an iterative method to find the best K cluster centers of a set of data according to the reconstruction error (i.e. accumulated distances from the real points to their assigned centroids. Each iteration, the algorithm computes the assignemnt of each point to the closest centroid, and then recomputes the centroids based on the points that have been assigned to them.

Here is the pseudocode for the K-Means algorithm:

  1. Initialize the K cluster centers C # To initialize use random values¹ or, alternatively, K random points in the dataset.
  2. While Y changed during the last iteration do:
    # Assign each point to the nearest centroid².
  3.     Y[i] = nearest_centroid(X[i], C)
    # Recompute each centroid as the mean of the points assigned to it².
  4.     C = recompute_centroids(Y, X)
  5. Return C #Final stable centroids.

¹ To avoid degenerate solutions, make sure that the random values are in the range taken by the components of the data set vectors.
² Nearest_centroid and recompute_centroids have to compute respectively:
Nearest centroid
Update centroids

  • Q2 Try the implemented K-Means algorithm with K=3 in the first two dimensions of the iris dataset, so you can visualize it. Then try it with the full four-dimensional vectors and report the MSE for each cluster and globally. Optional: Compare how far are the clusters from the actual center of each class (i.e. how well the clusters predict the classes).

Extra

HAR dataset

roboticauvic-unsupervised's People

Contributors

chuski92 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.