Answers.Body: <p>The usual parameters to adjust in a k-means:</p>
  
  <ol>
  <li>Number of clusters (recall many clusters can have same label). </li>
  <li>Distance definition (euclidean is the most basic, Gauss is an<br>
  improvement)   </li>
  <li>Selection of initial cluster positions.</li>
  <li>Data preprocessing (data normalization, ...)</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-09T09:54:58.653Z
Answers.LastActivityDate: 2018-05-09T10:09:30.840Z
Answers.LastEditDate: 2018-05-09T10:09:30.840Z
Answers.UserDisplayName: pasaba por aqui
Body: <p>I'm working with a data set where the data is stored in a string such as <code>AxByCyA</code> where <code>A</code>, <code>B</code> and <code>C</code> are actions and <code>v,w,x,y,z</code> are times between the actions (each letter represents an interval of time). It's worth noting that <code>B</code> cannot occur without <code>A</code>, and <code>C</code> cannot occur without <code>B</code>, and <code>C</code> is the action I'm attempting to study (ie: I'd like to be able to predict whether a user will do <code>C</code> based on their prior actions).</p>
  <p>I intend to create 2 clusters: people who do <code>C</code> and those who don't.</p>
  <p>From this data set, I build a training array to run the sci-kit (python) k-means algorithm on, containing the number of <code>A</code>s, the number of <code>B</code>s, the mean time between actions (calculated using the average of each interval) and the standard deviation between each interval.</p>
  <p>This gives me an overall success rate of 82% on the test set, but is there anything I can do for more accuracy?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-02T23:31:05.757Z
Comments.Text: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/108810/discussion-on-question-by-jessica-chambers-how-to-refine-k-means-clustering-on-a).
Comments.UserDisplayName: nbro
Tags: <classification><training><python><clustering><k-means>
Title: How to refine K-means clustering on a data set?
UserDisplayName: Jessica Chambers
ThreadText: # How to refine K-means clustering on a data set?
  
  (Asked by: username_0 on 2018-05-09)
  
  I'm working with a data set where the data is stored in a string such as `AxByCyA` where `A`, `B` and `C` are actions and `v,w,x,y,z` are times between the actions (each letter represents an interval of time). It's worth noting that `B` cannot occur without `A`, and `C` cannot occur without `B`, and `C` is the action I'm attempting to study (ie: I'd like to be able to predict whether a user will do `C` based on their prior actions).
  
  I intend to create 2 clusters: people who do `C` and those who don't.
  
  From this data set, I build a training array to run the sci-kit (python) k-means algorithm on, containing the number of `A`s, the number of `B`s, the mean time between actions (calculated using the average of each interval) and the standard deviation between each interval.
  
  This gives me an overall success rate of 82% on the test set, but is there anything I can do for more accuracy?
  
  **Tags:** classification, training, python, clustering, k-means
  > **Comments:**
  > **username_1**: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/108810/discussion-on-question-by-jessica-chambers-how-to-refine-k-means-clustering-on-a).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-05-09. Score: 5 | Accepted answer
  
  The usual parameters to adjust in a k-means:
  
  1. Number of clusters (recall many clusters can have same label).
  2. Distance definition (euclidean is the most basic, Gauss is an  
     improvement)
  3. Selection of initial cluster positions.
  4. Data preprocessing (data normalization, ...)
  
  
  ---
  
  