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
So I have been utilizing the transition matrices from my MoSeq outputs and I noticed that they all get normalized to 'bigram'.
I see in the code that they can also get normalized to 'row' or 'column' but I would like to see what sort of code/calculation is being used for this normalization so I can better understand the output.
For reference I am including a screen shot of the code where the normalize command is referenced.
The text was updated successfully, but these errors were encountered:
If you look a few lines down from the snippet you posted, you can see that normalize is passed to the get_group_trans_mats function from moseq2_viz, whose code you can find here. As you can see, the relevant details of the normalization can be further found within the moseq2_viz.model.get_transition_matrix and the moseq2_viz.model.normalize_transition_matrix functions. The normalization either divides by the total number of transitions (bigrams) or divides each row/column by their sums (to normalize with respect to incoming or outgoing transitions).
frommoseq2_viz.model.trans_graphimportget_trans_graph_groups, get_group_trans_mats# syllable threshold defined above. Uncomment if you want to manually set# max_syllables = 40# select a transition matrix normalization methodnormalize='bigram'# options: bigram, columns, rows# load your modelmodel_path=progress_paths['model_path']
model_data=parse_model_results(model_path)
model_data['labels'] =relabel_by_usage(model_data['labels'], count='usage')[0]
# Get modeled session uuids to compute group-mean transition graph for each grouplabel_group, uuids=get_trans_graph_groups(model_data)
group=list(set(label_group))
# compute transition matrices and usages for each groupprint('Group(s):', ', '.join(group))
trans_mats, usages=get_group_trans_mats(model_data['labels'], label_group, group, max_syllables, normalize=normalize)
So I have been utilizing the transition matrices from my MoSeq outputs and I noticed that they all get normalized to 'bigram'.
I see in the code that they can also get normalized to 'row' or 'column' but I would like to see what sort of code/calculation is being used for this normalization so I can better understand the output.
For reference I am including a screen shot of the code where the normalize command is referenced.
The text was updated successfully, but these errors were encountered: