docstr: Make sure we cannot call the Factor linear regression method on factors
  or slices that are not of float or int dtype.
docstr_tok: ["Make","sure","we","can","not","call","the","Factor","linear","regression","method","on","factors","or","slices","that","are","not","of","float","or","int","dtype","."]
code: def _test_regression_method_bad_type(self):
      """
      Make sure we cannot call the Factor linear regression method on factors
      or slices that are not of float or int dtype.
      """
      # These are arbitrary for the purpose of this test.
      returns_length = 2
      regression_length = 10
  
      returns = Returns(window_length=returns_length, inputs=[self.col])
      returns_slice = returns[self.my_asset]
  
      class BadTypeFactor(CustomFactor):
          window_length = 1
          inputs = []
          dtype = datetime64ns_dtype
          window_safe = True
  
          def compute(self, today, assets, out):
              pass
  
      bad_type_factor = BadTypeFactor()
      bad_type_factor_slice = bad_type_factor[self.my_asset]
  
      with self.assertRaises(TypeError):
          bad_type_factor.linear_regression(
              target=returns_slice,
              regression_length=regression_length,
          )
      with self.assertRaises(TypeError):
          returns.linear_regression(
              target=bad_type_factor_slice,
              regression_length=regression_length,
          )
  
imports: from numpy import arange, full, full_like, nan, where
  from pandas import DataFrame, date_range, Int64Index, Timestamp
  from pandas.util.testing import assert_frame_equal
  from scipy.stats import linregress, pearsonr, spearmanr
  from catalyst.assets import Equity
  from catalyst.errors import IncompatibleTerms, NonExistentAssetInTimeFrame
  from catalyst.pipeline import CustomFactor, Pipeline
  from catalyst.pipeline.data import USEquityPricing
  from catalyst.pipeline.data.testing import TestingDataSet
  from catalyst.pipeline.engine import SimplePipelineEngine
  from catalyst.pipeline.factors.equity import Returns, RollingLinearRegressionOfReturns, RollingPearsonOfReturns, RollingSpearmanOfReturns
  from catalyst.pipeline.loaders.frame import DataFrameLoader
  from catalyst.pipeline.sentinels import NotSpecified
  from catalyst.testing import AssetID, AssetIDPlusDay, check_arrays, make_alternating_boolean_array, make_cascading_boolean_array, parameter_space
  from catalyst.testing.fixtures import WithSeededRandomPipelineEngine, WithTradingEnvironment, CatalystTestCase
  from catalyst.utils.numpy_utils import bool_dtype, datetime64ns_dtype, float64_dtype
label_desc: Use image node_id 5 for calling the StatisticalMethodsTestCase obj's underlying member method code with example usage: obj._test_regression_method_bad_type() without return types