Skip to content

Commit

Permalink
fix(classification): skip model predict if input all NA
Browse files Browse the repository at this point in the history
  • Loading branch information
chanshing committed Nov 6, 2024
1 parent ba14445 commit a32957c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/accelerometer/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def activityClassification(
print(f"{len(epoch) - np.sum(ok)} rows with NaN or Inf values, out of {len(epoch)}")

Y = pd.Series(index=epoch.index)
Y.loc[ok] = viterbi(model.predict(X[ok]), hmmParams)
if ok.any():
Y.loc[ok] = viterbi(model.predict(X[ok]), hmmParams)

# TODO: Chan's logic hardcoded here
if activityModel == 'chan':
Expand Down

0 comments on commit a32957c

Please sign in to comment.