# Path: skutil/utils/fixes.py
# def is_iterable(x):
#     """Python 3.x adds the ``__iter__`` attribute
#     to strings. Thus, our previous tests for iterable
#     will fail when using ``hasattr``.
# 
#     Parameters
#     ----------
# 
#     x : object
#         The object or primitive to test whether
#         or not is an iterable.
# 
# 
#     Returns
#     -------
# 
#     bool
#         True if ``x`` is an iterable
#     """
#     if isinstance(x, six.string_types):
#         return False
#     return hasattr(x, '__iter__')
# 
# def dict_keys(d):
#     """In python 3, the ``d.keys()`` method
#     returns a view and not an actual list.
# 
#     Parameters
#     ----------
# 
#     d : dict
#         The dictionary
# 
# 
#     Returns
#     -------
# 
#     list
#     """
#     return list(d.keys())


from h2o.frame import H2OFrame
from ..utils.fixes import is_iterable, dict_keys
import pandas as pd
import numpy as np
import warnings
            raise ValueError('score_by must be in %s, but got %s'
                             % (', '.join(met), score_by))

        # how many to store in the scoring method?
        if n_folds and not n_iter:
            raise ValueError('if n_folds is set, must set n_iter')

    def as_data_frame(self):
        """Get the summary report of the fold fits in the
        form of a pd.DataFrame.

        Returns
        -------

        df : pd.DataFrame
            A dataframe of summary statistics for each fold
        """

        if not self.n_folds:
            # if there were no folds, these are each individual scores
            return pd.DataFrame.from_dict(self.stats)

        else:
            # otherwise they are cross validation scores...
            # ensure divisibility...
            n_obs, n_folds, n_iter = len(self.stats[dict_keys(self._signs)[0]]), self.n_folds, self.n_iter
            if not (n_folds * n_iter) == n_obs:
                raise ValueError('n_obs is not divisible by n_folds and n_iter')

            new_stats = {}

# Path: skutil/utils/fixes.py
# def is_iterable(x):
#     """Python 3.x adds the ``__iter__`` attribute
#     to strings. Thus, our previous tests for iterable
#     will fail when using ``hasattr``.
# 
#     Parameters
#     ----------
# 
#     x : object
#         The object or primitive to test whether
#         or not is an iterable.
# 
# 
#     Returns
#     -------
# 
#     bool
#         True if ``x`` is an iterable
#     """
#     if isinstance(x, six.string_types):
#         return False
#     return hasattr(x, '__iter__')
# 
# def dict_keys(d):
#     """In python 3, the ``d.keys()`` method
#     returns a view and not an actual list.
# 
#     Parameters
#     ----------
# 
#     d : dict
#         The dictionary
# 
# 
#     Returns
#     -------
# 
#     list
#     """
#     return list(d.keys())


# Path: skutil/metrics/_act.py
from h2o.frame import H2OFrame
from ..utils.fixes import is_iterable, dict_keys
import pandas as pd
import numpy as np
import warnings

            raise ValueError('score_by must be in %s, but got %s'
                             % (', '.join(met), score_by))

        # how many to store in the scoring method?
        if n_folds and not n_iter:
            raise ValueError('if n_folds is set, must set n_iter')

    def as_data_frame(self):
        """Get the summary report of the fold fits in the
        form of a pd.DataFrame.

        Returns
        -------

        df : pd.DataFrame
            A dataframe of summary statistics for each fold
        """

        if not self.n_folds:
            # if there were no folds, these are each individual scores
            return pd.DataFrame.from_dict(self.stats)

        else:
            # otherwise they are cross validation scores...
            # ensure divisibility...
            n_obs, n_folds, n_iter = len(self.stats[dict_keys(self._signs)[0]]), self.n_folds, self.n_iter
            if not (n_folds * n_iter) == n_obs:
                raise ValueError('n_obs is not divisible by n_folds and n_iter')

            new_stats = {}

            for metric in dict_keys(self._signs):