Let's see how we can use unsupervised learning for stock market analysis. Since we don't know how many clusters there are, we'll use an algorithm called affinity propagation (AP) on the cluster. It tries to find a representative datapoint for each cluster in our data, along with measures of similarity between pairs of datapoints, and considers all our datapoints as potential representatives, also called exemplars, of their respective clusters.
Finding patterns in stock market data
Getting ready
In this recipe, we will analyze the stock market variations of companies over a specified duration. Our goal is to then find out what companies behave similarly in terms of their quotes over time.