stacker.kmeans.create_kmeans_input#
- create_kmeans_input(data_arrays)[source]#
Blinds SSF Data (removes trajectory labels) for input to K Means
Stacks SSF data into a single 2D numpy array from all frames of all trajectories without labels for each frame. Used for input to KMeans Clustering
- Parameters:
- data_arraysdict
Output of read_and_preprocess_data(). Dictionary where keys are dataset names and values are the processed data arrays.
- Returns:
- blinded_datanp.typing.ArrayLike
A 2D numpy array containing all frames stacked together.
See also
read_and_preprocess_data
Reads and preprocesses data for each dataset
Examples
>>> import stacker as st >>> data_arrays = { ... 'dataset1': np.random.rand(3200, 16129), ... 'dataset2': np.random.rand(3200, 16129) ... } >>> kmeans_input = st.create_kmeans_input(data_arrays) >>> print(kmeans_input.shape) (6400, 16129)