# Path: ramp/metrics.py
# class Metric(object):
# class SKLearnMetric(Metric):
# class LogLoss(Metric):
# class MCC(SKLearnMetric):
# class ThresholdMetric(Metric):
# class Recall(ThresholdMetric):
# class WeightedRecall(ThresholdMetric):
# class PositiveRate(ThresholdMetric):
# class Precision(ThresholdMetric):
# class FalsePositiveRate(ThresholdMetric):
#     def name(self):
#     def score(self, result):
#     def __init__(self, metric, **kwargs):
#     def name(self):
#     def score(self, result):
# def as_ramp_metric(metric_like):
# def rmse(*args, **kwargs):
#     def score(self, result):
#     def __init__(self, threshold=None):
#     def score(self, result, threshold=None):
#     def tp(self, result, threshold):
#     def tn(self, result, threshold):
#     def fp(self, result, threshold):
#     def fn(self, result, threshold):
#     def score_with_threshold(self, result, threshold):
#     def __init__(self, threshold=None, weight_column=None):
#     def score_with_threshold(self, result, threshold):
#     def score_with_threshold(self, result, threshold):
#     def score_with_threshold(self, result, threshold):
#     def score_with_threshold(self, result, threshold):
# 
# Path: ramp/utils.py
# def pprint_scores(scores):
#     scores = np.array(scores)
#     stderr = scores.std() / np.sqrt(len(scores))
#     mn = scores.mean()
#     s = "%g (+/- %g) [%g, %g]\n" % (
#         mn, stderr, mn - 2 * stderr, mn + 2 * stderr)
#     return s


from collections import defaultdict
from pandas import DataFrame, Series
from ramp import metrics
from ramp.utils import pprint_scores
import copy
import logging
import numpy as np
import pandas as pd
    import pylab as pl
import sklearn
    def _plot(self, fig, ax, index=1, color='b'):
        ax.plot([index]*len(self.results), self.metric_values, '+', mew=2, color=color)
        ax.plot([index], self.summary_df['Mean'], 'rs', alpha=.5)
        ax.set_xticks([index])
        ax.set_xticklabels([self.metric.name])
        return ax


class DualThresholdMetricReporter(MetricReporter):
    """
    Reports on a pair of metrics which are threshold sensitive.

    Thresholds are automatically detected from the evaluation results unless
    explicitly set in the config.
    """

    def __init__(self, metric1, metric2, granularity_sigfigs=3, **kwargs):
        """
        Accepts a Metric object and evaluates it at each fold.

        Parameters:
        Thresholds: [Float], default: None
            Thresholds for reporting the two metrics. If not set, thresholds
            are model predictions from all runs computed on the fly.

        lower_quantile, upper_quantile: Float, default 0.05, 0.095
            Quantiles to be used for reporting metrics.
        """
        Reporter.__init__(self, **kwargs)
        if (not isinstance(metric1, metrics.ThresholdMetric)

# Path: ramp/metrics.py
# class Metric(object):
# class SKLearnMetric(Metric):
# class LogLoss(Metric):
# class MCC(SKLearnMetric):
# class ThresholdMetric(Metric):
# class Recall(ThresholdMetric):
# class WeightedRecall(ThresholdMetric):
# class PositiveRate(ThresholdMetric):
# class Precision(ThresholdMetric):
# class FalsePositiveRate(ThresholdMetric):
#     def name(self):
#     def score(self, result):
#     def __init__(self, metric, **kwargs):
#     def name(self):
#     def score(self, result):
# def as_ramp_metric(metric_like):
# def rmse(*args, **kwargs):
#     def score(self, result):
#     def __init__(self, threshold=None):
#     def score(self, result, threshold=None):
#     def tp(self, result, threshold):
#     def tn(self, result, threshold):
#     def fp(self, result, threshold):
#     def fn(self, result, threshold):
#     def score_with_threshold(self, result, threshold):
#     def __init__(self, threshold=None, weight_column=None):
#     def score_with_threshold(self, result, threshold):
#     def score_with_threshold(self, result, threshold):
#     def score_with_threshold(self, result, threshold):
#     def score_with_threshold(self, result, threshold):
# 
# Path: ramp/utils.py
# def pprint_scores(scores):
#     scores = np.array(scores)
#     stderr = scores.std() / np.sqrt(len(scores))
#     mn = scores.mean()
#     s = "%g (+/- %g) [%g, %g]\n" % (
#         mn, stderr, mn - 2 * stderr, mn + 2 * stderr)
#     return s


# Path: ramp/reporters.py
from collections import defaultdict
from pandas import DataFrame, Series
from ramp import metrics
from ramp.utils import pprint_scores
import copy
import logging
import numpy as np
import pandas as pd
    import pylab as pl
import sklearn

    def _plot(self, fig, ax, index=1, color='b'):
        ax.plot([index]*len(self.results), self.metric_values, '+', mew=2, color=color)
        ax.plot([index], self.summary_df['Mean'], 'rs', alpha=.5)
        ax.set_xticks([index])
        ax.set_xticklabels([self.metric.name])
        return ax


class DualThresholdMetricReporter(MetricReporter):
    """
    Reports on a pair of metrics which are threshold sensitive.

    Thresholds are automatically detected from the evaluation results unless
    explicitly set in the config.
    """

    def __init__(self, metric1, metric2, granularity_sigfigs=3, **kwargs):
        """
        Accepts a Metric object and evaluates it at each fold.

        Parameters:
        Thresholds: [Float], default: None
            Thresholds for reporting the two metrics. If not set, thresholds
            are model predictions from all runs computed on the fly.

        lower_quantile, upper_quantile: Float, default 0.05, 0.095
            Quantiles to be used for reporting metrics.
        """
        Reporter.__init__(self, **kwargs)
        if (not isinstance(metric1, metrics.ThresholdMetric)

                or not isinstance(metric2, metrics.ThresholdMetric)):