MathBunny/strava-wind-analysis-ml

Rides clustering crashes if number clusters > historical rides

Closed this issue · 0 comments

The error snippet:

 File "StravaWindAnalysisML/unsupervised/kmeans_rides.py", line 13, in clusterActivities
    kmeans = KMeans(n_clusters=num_clusters, random_state=0).fit(X)
  File "/usr/local/lib/python2.7/site-packages/sklearn/cluster/k_means_.py", line 887, in fit
    X = self._check_fit_data(X)
  File "/usr/local/lib/python2.7/site-packages/sklearn/cluster/k_means_.py", line 861, in _check_fit_data
    X.shape[0], self.n_clusters))
ValueError: n_samples=1 should be >= n_clusters=2