vame.analysis.segment_behavior
Variational Animal Motion Embedding 0.1 Toolbox © K. Luxem & P. Bauer, Department of Cellular Neuroscience Leibniz Institute for Neurobiology, Magdeburg, Germany
https://github.com/LINCellularNeuroscience/VAME Licensed under GNU General Public License v3.0
load_data
def load_data(PROJECT_PATH: str, file: str, data: str) -> np.ndarray
Load data for the given file.
Arguments:
PROJECT_PATH
str - Path to the project directory.file
str - Name of the file.data
str - Data to load.
Returns:
np.ndarray
- Loaded data.
kmeans_clustering
def kmeans_clustering(context: np.ndarray, n_clusters: int) -> np.ndarray
Perform k-Means clustering.
Arguments:
context
np.ndarray - Input data for clustering.n_clusters
int - Number of clusters.
Returns:
np.ndarray
- Cluster labels.
gmm_clustering
def gmm_clustering(context: np.ndarray, n_components: int) -> np.ndarray
Perform Gaussian Mixture Model (GMM) clustering.
Arguments:
context
np.ndarray - Input data for clustering.n_components
int - Number of components.
Returns:
np.ndarray
- Cluster labels.
behavior_segmentation
def behavior_segmentation(config: str,
model_name: str = None,
cluster_method: str = 'kmeans',
n_cluster: List[int] = [30]) -> None
Perform behavior segmentation.
Arguments:
config
str - Path to the configuration file.model_name
str, optional - Name of the model. Defaults to None.cluster_method
str, optional - Clustering method. Defaults to 'kmeans'.n_cluster
List[int], optional - List of number of clusters. Defaults to [30].
Returns:
None
- Save data to the results directory.
temporal_quant
def temporal_quant(cfg: dict, model_name: str, files: List[str],
use_gpu: bool) -> Tuple
Quantify the temporal latent space.
Arguments:
cfg
dict - Configuration dictionary.model_name
str - Name of the model.files
List[str] - List of file names.use_gpu
bool - Whether to use GPU.
Returns:
Tuple
- Tuple of latent space array and logger.
cluster_latent_space
def cluster_latent_space(cfg: dict, files: List[str], z_data: np.ndarray,
z_logger: List[int], cluster_method: str,
n_cluster: List[int], model_name: str) -> None
Cluster the latent space.
Arguments:
cfg
dict - Configuration dictionary.files
List[str] - List of file names.z_data
np.ndarray - Latent space data.z_logger
List[int] - Logger for the latent space.cluster_method
str - Clustering method.n_cluster
List[int] - List of number of clusters.model_name
str - Name of the model.
Returns:
None -> Save data to the results directory.