diff options
author | Théo de la Hogue | 2023-05-23 10:28:08 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-05-23 10:28:08 +0200 |
commit | dfed54f6194b9a41755dac5fa9e1eb9dd5dbf3c3 (patch) | |
tree | 487d529445b948b2331d688958b3265d9b4b0dfa /src | |
parent | 91f0aa415d97fc866729ab2578f04eb6d36918c9 (diff) | |
download | argaze-dfed54f6194b9a41755dac5fa9e1eb9dd5dbf3c3.zip argaze-dfed54f6194b9a41755dac5fa9e1eb9dd5dbf3c3.tar.gz argaze-dfed54f6194b9a41755dac5fa9e1eb9dd5dbf3c3.tar.bz2 argaze-dfed54f6194b9a41755dac5fa9e1eb9dd5dbf3c3.tar.xz |
Fixing transition probabilities matrix normalization.
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/GazeAnalysis/TransitionMatrix.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/argaze/GazeAnalysis/TransitionMatrix.py b/src/argaze/GazeAnalysis/TransitionMatrix.py index d85bd0b..7806fcc 100644 --- a/src/argaze/GazeAnalysis/TransitionMatrix.py +++ b/src/argaze/GazeAnalysis/TransitionMatrix.py @@ -35,7 +35,7 @@ class AOIScanPathAnalyzer(GazeFeatures.AOIScanPathAnalyzer): sequence.append(aoi_scan_step.aoi) - transition_matrix_probabilities = pandas.crosstab(pandas.Series(sequence[1:], name='to'), pandas.Series(sequence[:-1], name='from'), normalize=1) + transition_matrix_probabilities = pandas.crosstab(pandas.Series(sequence[1:], name='to'), pandas.Series(sequence[:-1], name='from'), normalize='index') transition_matrix_density = (transition_matrix_probabilities == 0.).astype(int).sum(axis=1).sum() / transition_matrix_probabilities.size return transition_matrix_probabilities , transition_matrix_density |