code: def test_feature_rep():
      # multivariate ts
      frep = transform.FeatureRep(features=all_features())
      X = np.random.rand(100, 10, 5)
      y = np.ones(100)
      frep.fit(X, y)
      Xt = frep.transform(X)
      assert Xt.shape[0] == len(X)
      assert len(frep.f_labels) == Xt.shape[1]
  
      # univariate ts
      X = np.random.rand(100, 10)
      y = np.ones(100)
      frep.fit(X, y)
      Xt = frep.transform(X)
      assert Xt.shape[0] == len(X)
      assert len(frep.f_labels) == Xt.shape[1]
  
      # single feature
      frep = transform.FeatureRep(features={"mean": mean})
      frep.fit(X, y)
      Xt = frep.transform(X)
      assert Xt.shape[0] == len(X)
      assert len(frep.f_labels) == Xt.shape[1]
      assert Xt.shape[1] == 1
  
      # ts with multivariate contextual data
      frep = transform.FeatureRep(features=all_features())
      X = TS_Data(np.random.rand(100, 10, 5), np.random.rand(100, 3))
      y = np.ones(100)
      frep.fit(X, y)
      Xt = frep.transform(X)
      assert Xt.shape[0] == len(X)
      assert len(frep.f_labels) == Xt.shape[1]
  
      # ts with univariate contextual data
      X = TS_Data(np.random.rand(100, 10, 5), np.random.rand(100))
      y = np.ones(100)
      frep.fit(X, y)
      Xt = frep.transform(X)
      assert Xt.shape[0] == len(X)
      assert len(frep.f_labels) == Xt.shape[1]
  
file_path: seglearn/seglearn/tests/test_transform.py
imports: import warnings
  import numpy
  import pytest
  import seglearn.transform
  from seglearn.base import TS_Data
  from seglearn.feature_functions import all_features, mean
  from seglearn.util import get_ts_data_parts
label_desc: Use image node_id 3 for calling a global function with example usage: test_feature_rep() without return types