code: def fit(self, labels, samples, pstates):
          
          assert len(labels) == len(samples) == len(pstates)
  
          for label in set(labels):
              label_samples = [s for l,s in zip(labels, samples) if l == label]
              label_pstates = [p for l,p in zip(labels, pstates) if l == label]
  
              pohmm = self.pohmm_factory()
              pohmm.fit(label_samples, label_pstates)
              self.pohmms[label] = pohmm
  
          return self
docs: Fit the classifier with labels y and observations X