class_docstr: The unit tests in this module make sure if the time series features are created properly
class_docstr_tok: ["The","unit","tests","in","this","module","make","sure","if","the","time","series","features","are","created","properly"]
code: def test_extract_features_custom_function(self):
      df = self.create_test_data_sample()
  
      def custom_function(x, p):
          return len(x) + p
  
      settings = PickableSettings(
          {
              "mean": None,
              custom_function: [{"p": 1}, {"p": -1}],
          }
      )
  
      extracted_features = extract_features(
          df,
          default_fc_parameters=settings,
          column_value="val",
          column_id="id",
          column_kind="kind",
          column_sort="sort",
      )
  
      self.assertIsInstance(extracted_features, pd.DataFrame)
  
      mean_a = extracted_features["a__mean"].values
      custom_function_a_1 = extracted_features[
          "a__custom_function__p_1"
      ].values
      custom_function_a_m1 = extracted_features[
          "a__custom_function__p_-1"
      ].values
  
      self.assertAlmostEqual(mean_a[0], 34.55)
      self.assertAlmostEqual(mean_a[1], 50.85)
      self.assertAlmostEqual(custom_function_a_1[0], 21)
      self.assertAlmostEqual(custom_function_a_1[1], 21)
      self.assertAlmostEqual(custom_function_a_m1[0], 19)
      self.assertAlmostEqual(custom_function_a_m1[1], 19)
  
imports: import os
  import tempfile
  import numpy
  import pandas
  from mock import Mock
  from tests.fixtures import DataTestCase
  from tsfresh.feature_extraction.extraction import extract_features
  from tsfresh.feature_extraction.settings import ComprehensiveFCParameters, PickableSettings
  from tsfresh.utilities.distribution import IterableDistributorBaseClass, MapDistributor
label_desc: Use image node_id 6 for calling the ExtractionTestCase obj's underlying member method code with example usage: obj.test_extract_features_custom_function() and returns: unknown