Detecting early signs of depressive and manic episodes in patients with bipolar disorder using the signature-based model