I have a dataset of xyz coordinates with a date component in a pandas dataframe
ex:
- date1: $[x_1,y_1,z_1]$,
- date2: $[x_2,y_2,z_2]$,
- date3: $[x_3,y_3,z_3]$, ..
I would like to classify a sample of object positions over the period of a week (using indexes to re-map the classification label back to the date), like this:
- Week 1: $[x_1,y_1,z_1], [x_2, y_2, z_2], [x_3,y_3,z_3], [x_4,y_4,z_4], [x_5,y_5,z_5], [x_6,y_6,z_6], [x_7,y_7,z_7]$,
- Week 2: $[x_8,y_8,z_8],[x_9,y_9,z_9],[x_{10},y_{10},z_{10}],[x_{11},y_{11},z_{11}],[x_{12},y_{12},z_{12}],[x_{13},y_{13},z_{13}],[x_{14},y_{14},z_{14}]$,
When I try to run KMeans it returns
k_means = KMeans(n_clusters=cclasses)
k_means.fit(process_set.hpc)
date_classes = k_means.labels_
ValueError: Found array with dim 3. Expected <= 2
Questions:
- Do I have to run it through Principal Component Analysis (PCA) first? if so, how do I maintain date mapping to the classification created?
- Are there any other methods I could use?
- Am I doing everything completely backwards and should consider a different approach, any thoughts?
Thanks!
process_set
andprocess_set.hpc
(the first few lines as printed bypandas
are enough). Also, please clarify if you want to cluster or classify this dataset. You cannot classify if you do not have pre-existing labels. $\endgroup$