Repository: DistrictDataLabs/yellowbrick

Issue:
Remove visualizer tests in type checking
Many of the type checking utilities, e.g. `is_classifier`, `is_regressor`, etc. have a note to remove lines of code that are unnecessary after #90 is implemented. 

For example see: [yellowbrick/utils/types.py#L64](https://github.com/DistrictDataLabs/yellowbrick/blob/develop/yellowbrick/utils/types.py#L64):

```python
def is_classifier(estimator):
    """
    Returns True if the given estimator is (probably) a classifier.

    Parameters
    ----------
    estimator : class or instance
        The object to test if it is a Scikit-Learn clusterer, especially a
        Scikit-Learn estimator or Yellowbrick visualizer

    See also
    --------
    is_classifier
        `sklearn.is_classifier() <https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/base.py#L518>`_
    """
    # TODO: once we make ScoreVisualizer and ModelVisualizer pass through
    # wrappers as in Issue #90, these three lines become unnecessary.
    # NOTE: This must be imported here to avoid recursive import.
    from yellowbrick.base import Visualizer
    if isinstance(estimator, Visualizer):
        return is_classifier(estimator.estimator)

    # Test the _estimator_type property
    return getattr(estimator, "_estimator_type", None) == "classifier"

# Alias for closer name to isinstance and issubclass
isclassifier = is_classifier
```

We should remove these lines of code and **ensure the tests have correct coverage**. 


Discussion:
Another alternative is to: 

```python 
if hasattr(estimator, "estimator"):
    return is_classifier(estimator.estimator) 
```
Working on it

Resolving patch:
diff --git a/yellowbrick/utils/types.py b/yellowbrick/utils/types.py
--- a/yellowbrick/utils/types.py
+++ b/yellowbrick/utils/types.py
@@ -61,12 +61,6 @@ def is_classifier(estimator):
     is_classifier
         `sklearn.is_classifier() <https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/base.py#L518>`_
     """
-    # TODO: once we make ScoreVisualizer and ModelVisualizer pass through
-    # wrappers as in Issue #90, these three lines become unnecessary.
-    # NOTE: This must be imported here to avoid recursive import.
-    from yellowbrick.base import Visualizer
-    if isinstance(estimator, Visualizer):
-        return is_classifier(estimator.estimator)
 
     # Test the _estimator_type property
     return getattr(estimator, "_estimator_type", None) == "classifier"
@@ -90,12 +84,6 @@ def is_regressor(estimator):
     is_regressor
         `sklearn.is_regressor() <https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/base.py#L531>`_
     """
-    # TODO: once we make ScoreVisualizer and ModelVisualizer pass through
-    # wrappers as in Issue #90, these three lines become unnecessary.
-    # NOTE: This must be imported here to avoid recursive import.
-    from yellowbrick.base import Visualizer
-    if isinstance(estimator, Visualizer):
-        return is_regressor(estimator.estimator)
 
     # Test the _estimator_type property
     return getattr(estimator, "_estimator_type", None) == "regressor"
@@ -114,12 +102,6 @@ def is_clusterer(estimator):
         The object to test if it is a Scikit-Learn clusterer, especially a
         Scikit-Learn estimator or Yellowbrick visualizer
     """
-    # TODO: once we make ScoreVisualizer and ModelVisualizer pass through
-    # wrappers as in Issue #90, these three lines become unnecessary.
-    # NOTE: This must be imported here to avoid recursive import.
-    from yellowbrick.base import Visualizer
-    if isinstance(estimator, Visualizer):
-        return is_clusterer(estimator.estimator)
 
     # Test the _estimator_type property
     return getattr(estimator, "_estimator_type", None) == "clusterer"
@@ -138,12 +120,6 @@ def is_gridsearch(estimator):
         The object to test if it is a Scikit-Learn clusterer, especially a
         Scikit-Learn estimator or Yellowbrick visualizer
     """
-    # TODO: once we make ScoreVisualizer and ModelVisualizer pass through
-    # wrappers as in Issue #90, these three lines become unnecessary.
-    # NOTE: This must be imported here to avoid recursive import.
-    from yellowbrick.base import Visualizer
-    if isinstance(estimator, Visualizer):
-        return is_gridsearch(estimator.estimator)
 
     from sklearn.model_selection import GridSearchCV, RandomizedSearchCV
 


Test patch: