title: K-means clustering multiple dimensions
body: <p>I'm working on the K-means clustering algorithm. There are alot of examples available, but I can't find an example that explains what I'm trying to do.</p>
  
  <p>My dataset contains customers and their purchases. Every 1 in the dataset means the customer bought this item. A 0 means not bought.</p>
  
  <pre><code>0,0,0,0,1,0,1,0,0,1
  1,0,0,1,0,0,0,1,1,0
  1,1,0,0,0,0,0,0,0,0
  0,0,0,0,1,1,1,0,0,0
  </code></pre>
  
  <p>Left to right represent the different items.
  Top to bottom represent the customers. I want to cluster the customers. So there are 4 dimensions in the dataset and there will be 10 points. </p>
  
  <p>Now I'm trying to create points from this dataset for the next steps. I want to create a list containing all point object and then assign them to the right clusters, but I don't know how to handle the 4 different dimensions when I create a point object.</p>
  
  <pre><code>class Point
  {
      public int ClusterNumber { get; set; }
      public int X { get; set; }
      public int Y { get; set; }
  
      public Point(int clusterNumber, int CustomerId, int ProductId)
      {
          ClusterNumber = clusterNumber;
          X = CustomerId;
          Y = ProductId;
      }
  }
  </code></pre>