class_docstr: Provide test coverage when using provided estimators for optimal number of
  bins
class_docstr_tok: ["Provide","test","coverage","when","using","provided","estimators","for","optimal","number","of","bins"]
docstr: Check the FD, Scott and Doane with outliers.
  
  The FD estimates a smaller binwidth since it's less affected by
  outliers. Since the range is so (artificially) large, this means more
  bins, most of which will be empty, but the data of interest usually is
  unaffected. The Scott estimator is more affected and returns fewer bins,
  despite most of the variance being in one area of the data. The Doane
  estimator lies somewhere between the other two.
docstr_tok: ["Check","the","FD",",","Scott","and","Doane","with","outliers",".","The","FD","estimates","a","smaller","binwidth","since","it","'s","less","affected","by","outliers",".","Since","the","range","is","so","(","artificially",")","large",",","this","means","more","bins",",","most","of","which","will","be","empty",",","but","the","data","of","interest","usually","is","unaffected",".","The","Scott","estimator","is","more","affected","and","returns","fewer","bins",",","despite","most","of","the","variance","being","in","one","area","of","the","data",".","The","Doane","estimator","lies","somewhere","between","the","other","two","."]
code: def test_outlier(self):
      """
      Check the FD, Scott and Doane with outliers.
  
      The FD estimates a smaller binwidth since it's less affected by
      outliers. Since the range is so (artificially) large, this means more
      bins, most of which will be empty, but the data of interest usually is
      unaffected. The Scott estimator is more affected and returns fewer bins,
      despite most of the variance being in one area of the data. The Doane
      estimator lies somewhere between the other two.
      """
      xcenter = np.linspace(-10, 10, 50)
      outlier_dataset = np.hstack((np.linspace(-110, -100, 5), xcenter))
  
      outlier_resultdict = {
          "fd": 21,
          "scott": 5,
          "doane": 11,
          "stone": 6,
      }
  
      for estimator, numbins in outlier_resultdict.items():
          a, b = np.histogram(outlier_dataset, estimator)
          assert_equal(len(a), numbins)
  
imports: import numpy
  from numpy import histogram, histogramdd, histogram_bin_edges
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_raises, assert_allclose, assert_array_max_ulp, assert_raises_regex, suppress_warnings
  from numpy.testing._private.utils import requires_memory
  import pytest
label_desc: Use image node_id 7 for calling the TestHistogramOptimBinNums obj's underlying member method code with example usage: obj.test_outlier() without return types