Skip to content

Commit

Permalink
Count first crossing as the predicted state for the sorted spike decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
edeno committed Dec 8, 2017
1 parent 8bebe1a commit 28abbf5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion replay_classification/decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,13 @@ def state_probability(self):
return self.results['posterior_density'].sum('position').to_series().unstack()

def predicted_state(self):
return self.state_probability().iloc[-1].argmax()
state_probability = self.state_probability()
is_threshold = np.sum(
(state_probability > self.confidence_threshold), axis=1)
if np.any(is_threshold):
return state_probability.loc[is_threshold.argmax()].argmax()
else:
return 'Unclassified'

def predicted_state_probability(self):
return self.state_probability().iloc[-1].max()
Expand Down

0 comments on commit 28abbf5

Please sign in to comment.