I am clustering a rectangular data set with 82 records and 2 columns (a date and an integer between 1 and 2). The goal is to cluster dates that are close in proximity automatically in a way that perhaps an analyst could manually achieve by "circling" close data points on a timeline.
In Python/Pandas/SKLearn I am fitting the model to the data as such:
mod = KMeans(n_clusters=15) mod.fit(df)
This results in a model that I feel fits very well to the data and "makes sense" to the eye when plotted. I am attempting to recreate my results in SPSS using the KMeans clustering tool with the following parameters using both variables (date/integer) just like the model I fit in SciKit-Learn:
Number of Clusters = 15 Method = "Iterate and Classify" Maxiumum Iterations = 300 (copied from defaults from SKLearn KMeans) Convergence Criterion = .0001 (copied from defaults from SKLearn KMeans)
SPSS fits the data in a far less (at least it appears to the eye) optimally. In Python the dates are converted to numeric using Pandas.to_numeric and then converted back after the clusters are created. In SPSS I have tried clustering with and without converting the dates to numeric formats.
Am I doing something wrong? I would certainly (perhaps, incorrectly) that SKLearn is trustworthy using out of the box settings and only modifying the n_clusters parameter. Do I have something wrong in SPSS?
--Also: if this exchange is not appropriate for my post and better suited to StackOverflow, please let me know!