You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions closest_cluster and compute_centers might take a lot of time to run. Also the loop of assigning instances to clusters can incur some computational cost.
We should profile the code on a relatively large dataset (e.g. the digits dataset) and identify the critical parts. Then we have to implement those parts in C. To avoid extra dependencies, we are going to use ctypes.
Using C imposes a limit on the available data structures. We need to implement the sorting algorithm ourselves. But for keeping track of constraints while assigning nodes to clusters, it is enough to have k boolean arrays that indicate what instances can not be added to a cluster. This array is updated after assignment of each instance to a cluster.
The text was updated successfully, but these errors were encountered:
Instead of ctypes, we will use Cython. The advantage is that conversion from python to C can be done incrementally. Unlike ctypes, a rich set of containers are at our disposal. It also provides functionalities for easy installation.
Functions
closest_cluster
andcompute_centers
might take a lot of time to run. Also the loop of assigning instances to clusters can incur some computational cost.We should profile the code on a relatively large dataset (e.g. the digits dataset) and identify the critical parts. Then we have to implement those parts in C. To avoid extra dependencies, we are going to use
ctypes
.Using C imposes a limit on the available data structures. We need to implement the sorting algorithm ourselves. But for keeping track of constraints while assigning nodes to clusters, it is enough to have k boolean arrays that indicate what instances can not be added to a cluster. This array is updated after assignment of each instance to a cluster.
The text was updated successfully, but these errors were encountered: