# What is training data for Python tslearn KNeighborsTimeSeries?

I have 100 two dimensional time series and I also have 1 (benchmark) time series of the same shape. I need to find k nearest neighbors of the benchmark. According to the documentation KNeighborsTimeSeries is unsupervised learning model. But it has fit methods which takes some training data (which is confusing for me, I thought that unsupervised models never have training data). What do I put to fit method to achieve my goal?

I'm not sure about the metric yet, but I believe it can be whatever. I can research and play around with different metrics later

Unsupervised Learning is a kind of learning where the model tries to find patterns in data without labels.

Supervised Learning is a kind of machine learning whose goal is to learn the relation between features and labels.

Hence, unsupervised models do have training data, only not labelled as in the supervised ones.

In your particular case the module kNeighborTimeSeries searches for time series neighbours of your training time series. e.g.

knn = KNeighborsTimeSeries(n_neighbors=1).fit(time_series)
print(knn.kneighbors(return_distance=False))

• In your example you specify the amount of neighbors needed (1) and the set of training series (time_series). In this case you get 1 neighbor of what exact time series (singular)? May 5 at 8:18
• of the training one =) May 10 at 14:37