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: import numpy
  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 empyrical.stats import beta_aligned
  from zipline.assets import Equity, ExchangeInfo
  from zipline.errors import IncompatibleTerms, NonExistentAssetInTimeFrame
  from zipline.pipeline import CustomFactor, Pipeline
  from zipline.pipeline.data import USEquityPricing
  from zipline.pipeline.data.testing import TestingDataSet
  from zipline.pipeline.domain import US_EQUITIES
  from zipline.pipeline.engine import SimplePipelineEngine
  from zipline.pipeline.factors import Returns, RollingLinearRegressionOfReturns, RollingPearsonOfReturns, RollingSpearmanOfReturns, SimpleBeta
  from zipline.pipeline.factors.statistical import vectorized_beta, vectorized_pearson_r
  from zipline.pipeline.loaders.frame import DataFrameLoader
  from zipline.pipeline.sentinels import NotSpecified
  from zipline.testing import AssetID, AssetIDPlusDay, check_arrays, make_alternating_boolean_array, make_cascading_boolean_array, parameter_space
  import zipline.testing.fixtures
  from zipline.testing.predicates import assert_equal
  from zipline.utils.numpy_utils import as_column, 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