def _check_cv(self, val, random_state=None):
        """
        Validate the cv method passed in. Returns the split strategy if no
        validation exception is raised.
        """
        # Use default splitter in this case
        if val is None: val = 0.1

        if isinstance(val, float) and val <= 1.0:
            return ShuffleSplit(
                n_splits=1, test_size=val, random_state=random_state
            )

        if hasattr(val, "split") and hasattr(val, "get_n_splits"):
            if random_state is not None and hasattr(val, "random_state"):
                val.random_state = random_state
            return val

        raise YellowbrickValueError(
            "'{}' is not a valid cv splitter".format(type(val))
        )
Validate the cv method passed in. Returns the split strategy if no
        validation exception is raised.