if train_total_length != len(train_cluster_id):
raise ValueError("train_sequence length is not equal to "
"train_cluster_id length.")
if type(train_sequence).__module__ != np.__name__:
raise TypeError("train_sequence type should be an numpy array.")
if type(train_cluster_id).__module__ != np.__name__:
raise TypeError("train_cluster_id type should be an numpy array.")
After Change
raise TypeError("train_cluster_id type be an numpy array.")
// check dimension
if train_sequence.ndim != 2:
raise ValueError("train_sequence must be 2-dim array")
if train_cluster_id.ndim != 1:
raise ValueError("train_cluster_id must be 1-dim array")
// check length and size
train_total_length, observation_dim = train_sequence.shape