Timing run of hierarchical clustering
In earlier exercises of this chapter, you have used the data of Comic-Con footfall to create clusters. In this exercise you will time how long it takes to run the algorithm on DataCamp's system.
Remember that you can time the execution of small code snippets with:
%timeit sum([1, 3, 2])
The data is stored in a pandas DataFrame, comic_con
. x_scaled
and y_scaled
are the column names of the standardized X and Y coordinates of people at a given point in time. The timeit
module and linkage
function are already imported
How long does it take to the run the linkage
function on the comic con data?
This exercise is part of the course
Cluster Analysis in Python
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
