# Author: Arnaud Joly, Joel Nothman, Hamzeh Alsalhi
#
# License: BSD 3 clause
"""
Multi-class / multi-label utility function
==========================================

"""
from __future__ import division
from collections import Sequence
from itertools import chain

from scipy.sparse import issparse
from scipy.sparse.base import spmatrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix

import numpy as np

from ..externals.six import string_types

from .validation import check_array

from ..utils.fixes import bincount

def _unique_multiclass(y):
    if hasattr(y, '__array__'):
        return np.unique(np.asarray(y))
    else:
        return set(y)

def _unique_indicator(y):
    return np.arange(check_array(y, ['csr', 'csc', 'coo']).shape[1])

_FN_UNIQUE_LABELS = {
    'binary': _unique_multiclass,
    'multiclass': _unique_multiclass,
    'multilabel-indicator': _unique_indicator,
}

def unique_labels(*ys):
    """Extract an ordered array of unique labels

    We don't allow:
        - mix of multilabel and multiclass (single label) targets
        - mix of label indicator matrix and anything else,
          because there are no explicit labels)
        - mix of label indicator matrices of different sizes
        - mix of string and integer labels

    At the moment, we also don't allow "multiclass-multioutput" input type.

    Parameters
    ----------
    *ys : array-likes,

    Returns
    -------
    out : numpy array of shape [n_unique_labels]
        An ordered array of unique labels.

    Examples
    --------
    >>> from sklearn.utils.multiclass import unique_labels
    >>> unique_labels([3, 5, 5, 5, 7, 7])
    array([3, 5, 7])
    >>> unique_labels([1, 2, 3, 4], [2, 2, 3, 4])
    array([1, 2, 3, 4])
    >>> unique_labels([1, 2, 10], [5, 11])
    array([ 1,  2,  5, 10, 11])
    """
    if not ys:
        raise ValueError('No argument has been passed.')
    # Check that we don't mix label format

    ys_types = set(type_of_target(x) for x in ys)
    if ys_types == set(["binary", "multiclass"]):
        ys_types = set(["multiclass"])

    if len(ys_types) > 1:
        raise ValueError("Mix type of y not allowed, got types %s" % ys_types)

    label_type = ys_types.pop()

    # Check consistency for the indicator format
    if (label_type == "multilabel-indicator" and
            len(set(check_array(y, ['csr', 'csc', 'coo']).shape[1]
                    for y in ys)) > 1):
        raise ValueError("Multi-label binary indicator input with "
                         "different numbers of labels")

    # Get the unique set of labels
    _unique_labels = _FN_UNIQUE_LABELS.get(label_type, None)
    if not _unique_labels:
        raise ValueError("Unknown label type: %s" % repr(ys))

    ys_labels = set(chain.from_iterable(_unique_labels(y) for y in ys))

    # Check that we don't mix string type with number type
    if (len(set(isinstance(label, string_types) for label in ys_labels)) > 1):
        raise ValueError("Mix of label input types (string and number)")

    return np.array(sorted(ys_labels))

def _is_integral_float(y):
    return y.dtype.kind == 'f' and np.all(y.astype(int) == y)

def is_multilabel(y):
    """ Check if ``y`` is in a multilabel format.

    Parameters
    ----------
    y : numpy array of shape [n_samples]
        Target values.

    Returns
    -------
    out : bool,
        Return ``True``, if ``y`` is in a multilabel format, else ```False``.

    Examples
    --------
    >>> import numpy as np
    >>> from sklearn.utils.multiclass import is_multilabel
    >>> is_multilabel([0, 1, 0, 1])
    False
    >>> is_multilabel([[1], [0, 2], []])
    False
    >>> is_multilabel(np.array([[1, 0], [0, 0]]))
    True
    >>> is_multilabel(np.array([[1], [0], [0]]))
    False
    >>> is_multilabel(np.array([[1, 0, 0]]))
    True
    """
    if hasattr(y, '__array__'):
        y = np.asarray(y)
    if not (hasattr(y, "shape") and y.ndim == 2 and y.shape[1] > 1):
        return False

    if issparse(y):
        if isinstance(y, (dok_matrix, lil_matrix)):
            y = y.tocsr()
        return (len(y.data) == 0 or np.ptp(y.data) == 0 and
                (y.dtype.kind in 'biu' or  # bool, int, uint
                 _is_integral_float(np.unique(y.data))))
    else:
        labels = np.unique(y)

        return len(labels) < 3 and (y.dtype.kind in 'biu' or  # bool, int, uint
                                    _is_integral_float(labels))

def type_of_target(y):
    """Determine the type of data indicated by target `y`

    Parameters
    ----------
    y : array-like

    Returns
    -------
    target_type : string
        One of:
        * 'continuous': `y` is an array-like of floats that are not all
          integers, and is 1d or a column vector.
        * 'continuous-multioutput': `y` is a 2d array of floats that are
          not all integers, and both dimensions are of size > 1.
        * 'binary': `y` contains <= 2 discrete values and is 1d or a column
          vector.
        * 'multiclass': `y` contains more than two discrete values, is not a
          sequence of sequences, and is 1d or a column vector.
        * 'multiclass-multioutput': `y` is a 2d array that contains more
          than two discrete values, is not a sequence of sequences, and both
          dimensions are of size > 1.
        * 'multilabel-indicator': `y` is a label indicator matrix, an array
          of two dimensions with at least two columns, and at most 2 unique
          values.
        * 'unknown': `y` is array-like but none of the above, such as a 3d
          array, sequence of sequences, or an array of non-sequence objects.

    Examples
    --------
    >>> import numpy as np
    >>> type_of_target([0.1, 0.6])
    'continuous'
    >>> type_of_target([1, -1, -1, 1])
    'binary'
    >>> type_of_target(['a', 'b', 'a'])
    'binary'
    >>> type_of_target([1.0, 2.0])
    'binary'
    >>> type_of_target([1, 0, 2])
    'multiclass'
    >>> type_of_target([1.0, 0.0, 3.0])
    'multiclass'
    >>> type_of_target(['a', 'b', 'c'])
    'multiclass'
    >>> type_of_target(np.array([[1, 2], [3, 1]]))
    'multiclass-multioutput'
    >>> type_of_target([[1, 2]])
    'multiclass-multioutput'
    >>> type_of_target(np.array([[1.5, 2.0], [3.0, 1.6]]))
    'continuous-multioutput'
    >>> type_of_target(np.array([[0, 1], [1, 1]]))
    'multilabel-indicator'
    """
    valid = ((isinstance(y, (Sequence, spmatrix)) or hasattr(y, '__array__'))
             and not isinstance(y, string_types))

    if not valid:
        raise ValueError('Expected array-like (array or non-string sequence), '
                         'got %r' % y)

    if is_multilabel(y):
        return 'multilabel-indicator'

    try:
        y = np.asarray(y)
    except ValueError:
        # Known to fail in numpy 1.3 for array of arrays
        return 'unknown'

    # The old sequence of sequences format
    try:
        if (not hasattr(y[0], '__array__') and isinstance(y[0], Sequence)
                and not isinstance(y[0], string_types)):
            raise ValueError('You appear to be using a legacy multi-label data'
                             ' representation. Sequence of sequences are no'
                             ' longer supported; use a binary array or sparse'
                             ' matrix instead.')
    except IndexError:
        pass

    # Invalid inputs
    if y.ndim > 2 or (y.dtype == object and len(y) and
                      not isinstance(y.flat[0], string_types)):
        return 'unknown'  # [[[1, 2]]] or [obj_1] and not ["label_1"]

    if y.ndim == 2 and y.shape[1] == 0:
        return 'unknown'  # [[]]

    if y.ndim == 2 and y.shape[1] > 1:
        suffix = "-multioutput"  # [[1, 2], [1, 2]]
    else:
        suffix = ""  # [1, 2, 3] or [[1], [2], [3]]

    # check float and contains non-integer float values
    if y.dtype.kind == 'f' and np.any(y != y.astype(int)):
        # [.1, .2, 3] or [[.1, .2, 3]] or [[1., .2]] and not [1., 2., 3.]
        return 'continuous' + suffix

    if (len(np.unique(y)) > 2) or (y.ndim >= 2 and len(y[0]) > 1):
        return 'multiclass' + suffix  # [1, 2, 3] or [[1., 2., 3]] or [[1, 2]]
    else:
        return 'binary'  # [1, 2] or [["a"], ["b"]]

def _check_partial_fit_first_call(clf, classes=None):
    """Private helper function for factorizing common classes param logic

    Estimators that implement the ``partial_fit`` API need to be provided with
    the list of possible classes at the first call to partial_fit.

    Subsequent calls to partial_fit should check that ``classes`` is still
    consistent with a previous value of ``clf.classes_`` when provided.

    This function returns True if it detects that this was the first call to
    ``partial_fit`` on ``clf``. In that case the ``classes_`` attribute is also
    set on ``clf``.

    """
    if getattr(clf, 'classes_', None) is None and classes is None:
        raise ValueError("classes must be passed on the first call "
                         "to partial_fit.")

    elif classes is not None:
        if getattr(clf, 'classes_', None) is not None:
            if not np.all(clf.classes_ == unique_labels(classes)):
                raise ValueError(
                    "`classes=%r` is not the same as on last call "
                    "to partial_fit, was: %r" % (classes, clf.classes_))

        else:
            # This is the first call to partial_fit
            clf.classes_ = unique_labels(classes)
            return True

    # classes is None and clf.classes_ has already previously been set:
    # nothing to do
    return False

def class_distribution(y, sample_weight=None):
    """Compute class priors from multioutput-multiclass target data

    Parameters
    ----------
    y : array like or sparse matrix of size (n_samples, n_outputs)
        The labels for each example.

    sample_weight : array-like of shape = (n_samples,), optional
        Sample weights.

    Returns
    -------
    classes : list of size n_outputs of arrays of size (n_classes,)
        List of classes for each column.

    n_classes : list of integrs of size n_outputs
        Number of classes in each column

    class_prior : list of size n_outputs of arrays of size (n_classes,)
        Class distribution of each column.

    """
    classes = []
    n_classes = []
    class_prior = []

    n_samples, n_outputs = y.shape

    if issparse(y):
        y = y.tocsc()
        y_nnz = np.diff(y.indptr)

        for k in range(n_outputs):
            col_nonzero = y.indices[y.indptr[k]:y.indptr[k + 1]]
            # separate sample weights for zero and non-zero elements
            if sample_weight is not None:
                nz_samp_weight = np.asarray(sample_weight)[col_nonzero]
                zeros_samp_weight_sum = (np.sum(sample_weight) -
                                         np.sum(nz_samp_weight))
            else:
                nz_samp_weight = None
                zeros_samp_weight_sum = y.shape[0] - y_nnz[k]

            classes_k, y_k = np.unique(y.data[y.indptr[k]:y.indptr[k + 1]],
                                       return_inverse=True)
            class_prior_k = bincount(y_k, weights=nz_samp_weight)

            # An explicit zero was found, combine its wieght with the wieght
            # of the implicit zeros
            if 0 in classes_k:
                class_prior_k[classes_k == 0] += zeros_samp_weight_sum

            # If an there is an implict zero and it is not in classes and
            # class_prior, make an entry for it
            if 0 not in classes_k and y_nnz[k] < y.shape[0]:
                classes_k = np.insert(classes_k, 0, 0)
                class_prior_k = np.insert(class_prior_k, 0,
                                          zeros_samp_weight_sum)

            classes.append(classes_k)
            n_classes.append(classes_k.shape[0])
            class_prior.append(class_prior_k / class_prior_k.sum())
    else:
        for k in range(n_outputs):
            classes_k, y_k = np.unique(y[:, k], return_inverse=True)
            classes.append(classes_k)
            n_classes.append(classes_k.shape[0])
            class_prior_k = bincount(y_k, weights=sample_weight)
            class_prior.append(class_prior_k / class_prior_k.sum())

    return (classes, n_classes, class_prior)


# data collected by PropertyBasedSettingsTest.experimentWith_threshold_p_for_first_filter_separator_character

data = [
{"value": 0.000000, "errors": 55},
{"value": 0.000500, "errors": 55},
{"value": 0.001000, "errors": 55},
{"value": 0.001500, "errors": 54},
{"value": 0.002000, "errors": 54},
{"value": 0.002500, "errors": 54},
{"value": 0.003000, "errors": 53},
{"value": 0.003500, "errors": 53},
{"value": 0.004000, "errors": 53},
{"value": 0.004500, "errors": 53},
{"value": 0.005000, "errors": 53},
{"value": 0.005500, "errors": 53},
{"value": 0.006000, "errors": 53},
{"value": 0.006500, "errors": 53},
{"value": 0.007000, "errors": 53},
{"value": 0.007500, "errors": 53},
{"value": 0.008000, "errors": 53},
{"value": 0.008500, "errors": 53},
{"value": 0.009000, "errors": 53},
{"value": 0.009500, "errors": 53},
{"value": 0.010000, "errors": 53},
{"value": 0.010500, "errors": 53},
{"value": 0.011000, "errors": 53},
{"value": 0.011500, "errors": 53},
{"value": 0.012000, "errors": 53},
{"value": 0.012500, "errors": 53},
{"value": 0.013000, "errors": 53},
{"value": 0.013500, "errors": 53},
{"value": 0.014000, "errors": 53},
{"value": 0.014500, "errors": 53},
{"value": 0.015000, "errors": 53},
{"value": 0.015500, "errors": 53},
{"value": 0.016000, "errors": 53},
{"value": 0.016500, "errors": 53},
{"value": 0.017000, "errors": 53},
{"value": 0.017500, "errors": 53},
{"value": 0.018000, "errors": 53},
{"value": 0.018500, "errors": 53},
{"value": 0.019000, "errors": 53},
{"value": 0.019500, "errors": 53},
{"value": 0.020000, "errors": 53},
{"value": 0.020500, "errors": 53},
{"value": 0.021000, "errors": 53},
{"value": 0.021500, "errors": 53},
{"value": 0.022000, "errors": 53},
{"value": 0.022500, "errors": 53},
{"value": 0.023000, "errors": 53},
{"value": 0.023500, "errors": 53},
{"value": 0.024000, "errors": 53},
{"value": 0.024500, "errors": 53},
{"value": 0.025000, "errors": 53},
{"value": 0.025500, "errors": 53},
{"value": 0.026000, "errors": 53},
{"value": 0.026500, "errors": 53},
{"value": 0.027000, "errors": 53},
{"value": 0.027500, "errors": 53},
{"value": 0.028000, "errors": 53},
{"value": 0.028500, "errors": 53},
{"value": 0.029000, "errors": 53},
{"value": 0.029500, "errors": 53},
{"value": 0.030000, "errors": 53},
{"value": 0.030500, "errors": 53},
{"value": 0.031000, "errors": 53},
{"value": 0.031500, "errors": 53},
{"value": 0.032000, "errors": 53},
{"value": 0.032500, "errors": 53},
{"value": 0.033000, "errors": 53},
{"value": 0.033500, "errors": 53},
{"value": 0.034000, "errors": 53},
{"value": 0.034500, "errors": 53},
{"value": 0.035000, "errors": 53},
{"value": 0.035500, "errors": 53},
{"value": 0.036000, "errors": 53},
{"value": 0.036500, "errors": 53},
{"value": 0.037000, "errors": 53},
{"value": 0.037500, "errors": 53},
{"value": 0.038000, "errors": 53},
{"value": 0.038500, "errors": 53},
{"value": 0.039000, "errors": 53},
{"value": 0.039500, "errors": 53},
{"value": 0.040000, "errors": 53},
{"value": 0.040500, "errors": 53},
{"value": 0.041000, "errors": 53},
{"value": 0.041500, "errors": 53},
{"value": 0.042000, "errors": 53},
{"value": 0.042500, "errors": 53},
{"value": 0.043000, "errors": 53},
{"value": 0.043500, "errors": 53},
{"value": 0.044000, "errors": 53},
{"value": 0.044500, "errors": 53},
{"value": 0.045000, "errors": 53},
{"value": 0.045500, "errors": 53},
{"value": 0.046000, "errors": 53},
{"value": 0.046500, "errors": 53},
{"value": 0.047000, "errors": 53},
{"value": 0.047500, "errors": 53},
{"value": 0.048000, "errors": 53},
{"value": 0.048500, "errors": 53},
{"value": 0.049000, "errors": 53},
{"value": 0.049500, "errors": 53},
{"value": 0.050000, "errors": 53},
{"value": 0.050500, "errors": 53},
{"value": 0.051000, "errors": 53},
{"value": 0.051500, "errors": 53},
{"value": 0.052000, "errors": 53},
{"value": 0.052500, "errors": 53},
{"value": 0.053000, "errors": 53},
{"value": 0.053500, "errors": 53},
{"value": 0.054000, "errors": 53},
{"value": 0.054500, "errors": 53},
{"value": 0.055000, "errors": 53},
{"value": 0.055500, "errors": 53},
{"value": 0.056000, "errors": 53},
{"value": 0.056500, "errors": 53},
{"value": 0.057000, "errors": 53},
{"value": 0.057500, "errors": 53},
{"value": 0.058000, "errors": 53},
{"value": 0.058500, "errors": 53},
{"value": 0.059000, "errors": 53},
{"value": 0.059500, "errors": 53},
{"value": 0.060000, "errors": 53},
{"value": 0.060500, "errors": 53},
{"value": 0.061000, "errors": 53},
{"value": 0.061500, "errors": 53},
{"value": 0.062000, "errors": 53},
{"value": 0.062500, "errors": 53},
{"value": 0.063000, "errors": 53},
{"value": 0.063500, "errors": 53},
{"value": 0.064000, "errors": 53},
{"value": 0.064500, "errors": 53},
{"value": 0.065000, "errors": 53},
{"value": 0.065500, "errors": 53},
{"value": 0.066000, "errors": 53},
{"value": 0.066500, "errors": 53},
{"value": 0.067000, "errors": 53},
{"value": 0.067500, "errors": 53},
{"value": 0.068000, "errors": 53},
{"value": 0.068500, "errors": 53},
{"value": 0.069000, "errors": 53},
{"value": 0.069500, "errors": 53},
{"value": 0.070000, "errors": 53},
{"value": 0.070500, "errors": 53},
{"value": 0.071000, "errors": 53},
{"value": 0.071500, "errors": 53},
{"value": 0.072000, "errors": 53},
{"value": 0.072500, "errors": 53},
{"value": 0.073000, "errors": 53},
{"value": 0.073500, "errors": 53},
{"value": 0.074000, "errors": 53},
{"value": 0.074500, "errors": 53},
{"value": 0.075000, "errors": 53},
{"value": 0.075500, "errors": 53},
{"value": 0.076000, "errors": 53},
{"value": 0.076500, "errors": 53},
{"value": 0.077000, "errors": 53},
{"value": 0.077500, "errors": 53},
{"value": 0.078000, "errors": 53},
{"value": 0.078500, "errors": 53},
{"value": 0.079000, "errors": 53},
{"value": 0.079500, "errors": 53},
{"value": 0.080000, "errors": 53},
{"value": 0.080500, "errors": 53},
{"value": 0.081000, "errors": 53},
{"value": 0.081500, "errors": 53},
{"value": 0.082000, "errors": 53},
{"value": 0.082500, "errors": 53},
{"value": 0.083000, "errors": 53},
{"value": 0.083500, "errors": 53},
{"value": 0.084000, "errors": 53},
{"value": 0.084500, "errors": 53},
{"value": 0.085000, "errors": 53},
{"value": 0.085500, "errors": 53},
{"value": 0.086000, "errors": 53},
{"value": 0.086500, "errors": 53},
{"value": 0.087000, "errors": 53},
{"value": 0.087500, "errors": 53},
{"value": 0.088000, "errors": 53},
{"value": 0.088500, "errors": 53},
{"value": 0.089000, "errors": 53},
{"value": 0.089500, "errors": 53},
{"value": 0.090000, "errors": 55},
{"value": 0.090500, "errors": 55},
{"value": 0.091000, "errors": 55},
{"value": 0.091500, "errors": 55},
{"value": 0.092000, "errors": 55},
{"value": 0.092500, "errors": 55},
{"value": 0.093000, "errors": 55},
{"value": 0.093500, "errors": 55},
{"value": 0.094000, "errors": 55},
{"value": 0.094500, "errors": 55},
{"value": 0.095000, "errors": 55},
{"value": 0.095500, "errors": 55},
{"value": 0.096000, "errors": 55},
{"value": 0.096500, "errors": 55},
{"value": 0.097000, "errors": 55},
{"value": 0.097500, "errors": 55},
{"value": 0.098000, "errors": 54},
{"value": 0.098500, "errors": 54},
{"value": 0.099000, "errors": 54},
{"value": 0.099500, "errors": 54},
{"value": 0.100000, "errors": 54},
{"value": 0.100500, "errors": 54},
{"value": 0.101000, "errors": 54},
{"value": 0.101500, "errors": 54},
{"value": 0.102000, "errors": 54},
{"value": 0.102500, "errors": 54},
{"value": 0.103000, "errors": 54},
{"value": 0.103500, "errors": 54},
{"value": 0.104000, "errors": 54},
{"value": 0.104500, "errors": 54},
{"value": 0.105000, "errors": 54},
{"value": 0.105500, "errors": 54},
{"value": 0.106000, "errors": 54},
{"value": 0.106500, "errors": 54},
{"value": 0.107000, "errors": 54},
{"value": 0.107500, "errors": 54},
{"value": 0.108000, "errors": 54},
{"value": 0.108500, "errors": 54},
{"value": 0.109000, "errors": 54},
{"value": 0.109500, "errors": 54},
{"value": 0.110000, "errors": 54},
{"value": 0.110500, "errors": 54},
{"value": 0.111000, "errors": 54},
{"value": 0.111500, "errors": 54},
{"value": 0.112000, "errors": 54},
{"value": 0.112500, "errors": 54},
{"value": 0.113000, "errors": 54},
{"value": 0.113500, "errors": 57},
{"value": 0.114000, "errors": 57},
{"value": 0.114500, "errors": 57},
{"value": 0.115000, "errors": 57},
{"value": 0.115500, "errors": 60},
{"value": 0.116000, "errors": 63},
{"value": 0.116500, "errors": 63},
{"value": 0.117000, "errors": 65},
{"value": 0.117500, "errors": 67},
{"value": 0.118000, "errors": 67},
{"value": 0.118500, "errors": 67},
{"value": 0.119000, "errors": 69},
{"value": 0.119500, "errors": 69},
{"value": 0.120000, "errors": 73},
{"value": 0.120500, "errors": 75},
{"value": 0.121000, "errors": 77},
{"value": 0.121500, "errors": 81},
{"value": 0.122000, "errors": 83},
{"value": 0.122500, "errors": 87},
{"value": 0.123000, "errors": 89},
{"value": 0.123500, "errors": 89},
{"value": 0.124000, "errors": 92},
{"value": 0.124500, "errors": 92},
{"value": 0.125000, "errors": 92},
{"value": 0.125500, "errors": 95},
{"value": 0.126000, "errors": 95},
{"value": 0.126500, "errors": 98},
{"value": 0.127000, "errors": 98},
{"value": 0.127500, "errors": 101},
{"value": 0.128000, "errors": 101},
{"value": 0.128500, "errors": 101},
{"value": 0.129000, "errors": 103},
{"value": 0.129500, "errors": 103},
{"value": 0.130000, "errors": 103},
{"value": 0.130500, "errors": 103},
{"value": 0.131000, "errors": 105},
{"value": 0.131500, "errors": 107},
{"value": 0.132000, "errors": 107},
{"value": 0.132500, "errors": 109},
{"value": 0.133000, "errors": 109},
{"value": 0.133500, "errors": 109},
{"value": 0.134000, "errors": 109},
{"value": 0.134500, "errors": 109},
{"value": 0.135000, "errors": 112},
{"value": 0.135500, "errors": 118},
{"value": 0.136000, "errors": 119},
{"value": 0.136500, "errors": 122},
{"value": 0.137000, "errors": 122},
{"value": 0.137500, "errors": 125},
{"value": 0.138000, "errors": 127},
{"value": 0.138500, "errors": 127},
{"value": 0.139000, "errors": 132},
{"value": 0.139500, "errors": 138},
{"value": 0.140000, "errors": 138},
{"value": 0.140500, "errors": 140},
{"value": 0.141000, "errors": 140},
{"value": 0.141500, "errors": 140},
{"value": 0.142000, "errors": 144},
{"value": 0.142500, "errors": 144},
{"value": 0.143000, "errors": 147},
{"value": 0.143500, "errors": 153},
{"value": 0.144000, "errors": 155},
{"value": 0.144500, "errors": 154},
{"value": 0.145000, "errors": 158},
{"value": 0.145500, "errors": 171},
{"value": 0.146000, "errors": 177},
{"value": 0.146500, "errors": 180},
{"value": 0.147000, "errors": 186},
{"value": 0.147500, "errors": 188},
{"value": 0.148000, "errors": 194},
{"value": 0.148500, "errors": 196},
{"value": 0.149000, "errors": 208},
{"value": 0.149500, "errors": 209},
{"value": 0.150000, "errors": 215},
{"value": 0.150500, "errors": 225},
{"value": 0.151000, "errors": 233},
{"value": 0.151500, "errors": 254},
{"value": 0.152000, "errors": 261},
{"value": 0.152500, "errors": 270},
{"value": 0.153000, "errors": 279},
{"value": 0.153500, "errors": 284},
{"value": 0.154000, "errors": 294},
{"value": 0.154500, "errors": 297},
{"value": 0.155000, "errors": 301},
{"value": 0.155500, "errors": 315},
{"value": 0.156000, "errors": 324},
{"value": 0.156500, "errors": 326},
{"value": 0.157000, "errors": 334},
{"value": 0.157500, "errors": 341},
{"value": 0.158000, "errors": 346},
{"value": 0.158500, "errors": 354},
{"value": 0.159000, "errors": 365},
{"value": 0.159500, "errors": 371},
{"value": 0.160000, "errors": 388},
{"value": 0.160500, "errors": 400},
{"value": 0.161000, "errors": 412},
{"value": 0.161500, "errors": 414},
{"value": 0.162000, "errors": 419},
{"value": 0.162500, "errors": 428},
{"value": 0.163000, "errors": 429},
{"value": 0.163500, "errors": 434},
{"value": 0.164000, "errors": 438},
{"value": 0.164500, "errors": 449},
{"value": 0.165000, "errors": 452},
{"value": 0.165500, "errors": 462},
{"value": 0.166000, "errors": 475},
{"value": 0.166500, "errors": 478},
{"value": 0.167000, "errors": 478},
{"value": 0.167500, "errors": 478},
{"value": 0.168000, "errors": 488},
{"value": 0.168500, "errors": 492},
{"value": 0.169000, "errors": 498},
{"value": 0.169500, "errors": 504},
{"value": 0.170000, "errors": 509},
{"value": 0.170500, "errors": 521},
{"value": 0.171000, "errors": 525},
{"value": 0.171500, "errors": 530},
{"value": 0.172000, "errors": 534},
{"value": 0.172500, "errors": 549},
{"value": 0.173000, "errors": 559},
{"value": 0.173500, "errors": 565},
{"value": 0.174000, "errors": 570},
{"value": 0.174500, "errors": 575},
{"value": 0.175000, "errors": 579},
{"value": 0.175500, "errors": 587},
{"value": 0.176000, "errors": 588},
{"value": 0.176500, "errors": 594},
{"value": 0.177000, "errors": 600},
{"value": 0.177500, "errors": 606},
{"value": 0.178000, "errors": 623},
{"value": 0.178500, "errors": 627},
{"value": 0.179000, "errors": 637},
{"value": 0.179500, "errors": 643},
{"value": 0.180000, "errors": 643},
{"value": 0.180500, "errors": 648},
{"value": 0.181000, "errors": 650},
{"value": 0.181500, "errors": 651},
{"value": 0.182000, "errors": 656},
{"value": 0.182500, "errors": 665},
{"value": 0.183000, "errors": 666},
{"value": 0.183500, "errors": 669},
{"value": 0.184000, "errors": 673},
{"value": 0.184500, "errors": 675},
{"value": 0.185000, "errors": 677},
{"value": 0.185500, "errors": 679},
{"value": 0.186000, "errors": 680},
{"value": 0.186500, "errors": 686},
{"value": 0.187000, "errors": 686},
{"value": 0.187500, "errors": 688},
{"value": 0.188000, "errors": 691},
{"value": 0.188500, "errors": 693},
{"value": 0.189000, "errors": 701},
{"value": 0.189500, "errors": 701},
{"value": 0.190000, "errors": 704},
{"value": 0.190500, "errors": 704},
{"value": 0.191000, "errors": 707},
{"value": 0.191500, "errors": 707},
{"value": 0.192000, "errors": 709},
{"value": 0.192500, "errors": 711},
{"value": 0.193000, "errors": 717},
{"value": 0.193500, "errors": 717},
{"value": 0.194000, "errors": 719},
{"value": 0.194500, "errors": 720},
{"value": 0.195000, "errors": 721},
{"value": 0.195500, "errors": 721},
{"value": 0.196000, "errors": 721},
{"value": 0.196500, "errors": 721},
{"value": 0.197000, "errors": 721},
{"value": 0.197500, "errors": 721},
{"value": 0.198000, "errors": 724},
{"value": 0.198500, "errors": 724},
{"value": 0.199000, "errors": 724},
{"value": 0.199500, "errors": 726},
{"value": 0.200000, "errors": 726},
{"value": 0.200500, "errors": 726},
{"value": 0.201000, "errors": 730},
{"value": 0.201500, "errors": 735},
{"value": 0.202000, "errors": 735},
{"value": 0.202500, "errors": 735},
{"value": 0.203000, "errors": 735},
{"value": 0.203500, "errors": 736},
{"value": 0.204000, "errors": 736},
{"value": 0.204500, "errors": 736},
{"value": 0.205000, "errors": 736},
{"value": 0.205500, "errors": 736},
{"value": 0.206000, "errors": 736},
{"value": 0.206500, "errors": 738},
{"value": 0.207000, "errors": 738},
{"value": 0.207500, "errors": 738},
{"value": 0.208000, "errors": 738},
{"value": 0.208500, "errors": 738},
{"value": 0.209000, "errors": 739},
{"value": 0.209500, "errors": 740},
{"value": 0.210000, "errors": 743},
{"value": 0.210500, "errors": 743},
{"value": 0.211000, "errors": 745},
{"value": 0.211500, "errors": 745},
{"value": 0.212000, "errors": 745},
{"value": 0.212500, "errors": 747},
{"value": 0.213000, "errors": 747},
{"value": 0.213500, "errors": 747},
{"value": 0.214000, "errors": 747},
{"value": 0.214500, "errors": 747},
{"value": 0.215000, "errors": 747},
{"value": 0.215500, "errors": 747},
{"value": 0.216000, "errors": 747},
{"value": 0.216500, "errors": 747},
{"value": 0.217000, "errors": 747},
{"value": 0.217500, "errors": 749},
{"value": 0.218000, "errors": 749},
{"value": 0.218500, "errors": 749},
{"value": 0.219000, "errors": 749},
{"value": 0.219500, "errors": 749},
{"value": 0.220000, "errors": 750},
{"value": 0.220500, "errors": 750},
{"value": 0.221000, "errors": 750},
{"value": 0.221500, "errors": 750},
{"value": 0.222000, "errors": 750},
{"value": 0.222500, "errors": 750},
{"value": 0.223000, "errors": 750},
{"value": 0.223500, "errors": 750},
{"value": 0.224000, "errors": 750},
{"value": 0.224500, "errors": 750},
{"value": 0.225000, "errors": 750},
{"value": 0.225500, "errors": 750},
{"value": 0.226000, "errors": 750},
{"value": 0.226500, "errors": 750},
{"value": 0.227000, "errors": 750},
{"value": 0.227500, "errors": 750},
{"value": 0.228000, "errors": 750},
{"value": 0.228500, "errors": 750},
{"value": 0.229000, "errors": 750},
{"value": 0.229500, "errors": 750},
{"value": 0.230000, "errors": 750},
{"value": 0.230500, "errors": 750},
{"value": 0.231000, "errors": 750},
{"value": 0.231500, "errors": 750},
{"value": 0.232000, "errors": 750},
{"value": 0.232500, "errors": 750},
{"value": 0.233000, "errors": 750},
{"value": 0.233500, "errors": 750},
{"value": 0.234000, "errors": 750},
{"value": 0.234500, "errors": 751},
{"value": 0.235000, "errors": 751},
{"value": 0.235500, "errors": 751},
{"value": 0.236000, "errors": 751},
{"value": 0.236500, "errors": 751},
{"value": 0.237000, "errors": 751},
{"value": 0.237500, "errors": 751},
{"value": 0.238000, "errors": 751},
{"value": 0.238500, "errors": 752},
{"value": 0.239000, "errors": 752},
{"value": 0.239500, "errors": 752},
{"value": 0.240000, "errors": 754},
{"value": 0.240500, "errors": 754},
{"value": 0.241000, "errors": 754},
{"value": 0.241500, "errors": 754},
{"value": 0.242000, "errors": 754},
{"value": 0.242500, "errors": 754},
{"value": 0.243000, "errors": 754},
{"value": 0.243500, "errors": 754},
{"value": 0.244000, "errors": 754},
{"value": 0.244500, "errors": 754},
{"value": 0.245000, "errors": 754},
{"value": 0.245500, "errors": 754},
{"value": 0.246000, "errors": 754},
{"value": 0.246500, "errors": 754},
{"value": 0.247000, "errors": 754},
{"value": 0.247500, "errors": 754},
{"value": 0.248000, "errors": 754},
{"value": 0.248500, "errors": 754},
{"value": 0.249000, "errors": 754},
{"value": 0.249500, "errors": 754},
{"value": 0.250000, "errors": 754},
{"value": 0.250500, "errors": 754},
{"value": 0.251000, "errors": 754},
{"value": 0.251500, "errors": 754},
{"value": 0.252000, "errors": 754},
{"value": 0.252500, "errors": 754},
{"value": 0.253000, "errors": 754},
{"value": 0.253500, "errors": 754},
{"value": 0.254000, "errors": 754},
{"value": 0.254500, "errors": 754},
{"value": 0.255000, "errors": 754},
{"value": 0.255500, "errors": 754},
{"value": 0.256000, "errors": 754},
{"value": 0.256500, "errors": 754},
{"value": 0.257000, "errors": 754},
{"value": 0.257500, "errors": 754},
{"value": 0.258000, "errors": 754},
{"value": 0.258500, "errors": 754},
{"value": 0.259000, "errors": 754},
{"value": 0.259500, "errors": 754},
{"value": 0.260000, "errors": 754},
{"value": 0.260500, "errors": 754},
{"value": 0.261000, "errors": 754},
{"value": 0.261500, "errors": 754},
{"value": 0.262000, "errors": 754},
{"value": 0.262500, "errors": 754},
{"value": 0.263000, "errors": 754},
{"value": 0.263500, "errors": 754},
{"value": 0.264000, "errors": 754},
{"value": 0.264500, "errors": 754},
{"value": 0.265000, "errors": 754},
{"value": 0.265500, "errors": 754},
{"value": 0.266000, "errors": 754},
{"value": 0.266500, "errors": 754},
{"value": 0.267000, "errors": 754},
{"value": 0.267500, "errors": 754},
{"value": 0.268000, "errors": 754},
{"value": 0.268500, "errors": 754},
{"value": 0.269000, "errors": 754},
{"value": 0.269500, "errors": 754},
{"value": 0.270000, "errors": 754},
{"value": 0.270500, "errors": 754},
{"value": 0.271000, "errors": 754},
{"value": 0.271500, "errors": 754},
{"value": 0.272000, "errors": 754},
{"value": 0.272500, "errors": 754},
{"value": 0.273000, "errors": 754},
{"value": 0.273500, "errors": 754},
{"value": 0.274000, "errors": 754},
{"value": 0.274500, "errors": 754},
{"value": 0.275000, "errors": 754},
{"value": 0.275500, "errors": 754},
{"value": 0.276000, "errors": 754},
{"value": 0.276500, "errors": 754},
{"value": 0.277000, "errors": 754},
{"value": 0.277500, "errors": 754},
{"value": 0.278000, "errors": 754},
{"value": 0.278500, "errors": 754},
{"value": 0.279000, "errors": 754},
{"value": 0.279500, "errors": 754},
{"value": 0.280000, "errors": 754},
{"value": 0.280500, "errors": 754},
{"value": 0.281000, "errors": 754},
{"value": 0.281500, "errors": 754},
{"value": 0.282000, "errors": 754},
{"value": 0.282500, "errors": 754},
{"value": 0.283000, "errors": 753},
{"value": 0.283500, "errors": 753},
{"value": 0.284000, "errors": 753},
{"value": 0.284500, "errors": 753},
{"value": 0.285000, "errors": 753},
{"value": 0.285500, "errors": 753},
{"value": 0.286000, "errors": 753},
{"value": 0.286500, "errors": 753},
{"value": 0.287000, "errors": 753},
{"value": 0.287500, "errors": 753},
{"value": 0.288000, "errors": 753},
{"value": 0.288500, "errors": 753},
{"value": 0.289000, "errors": 753},
{"value": 0.289500, "errors": 753},
{"value": 0.290000, "errors": 753},
{"value": 0.290500, "errors": 753},
{"value": 0.291000, "errors": 753},
{"value": 0.291500, "errors": 753},
{"value": 0.292000, "errors": 753},
{"value": 0.292500, "errors": 753},
{"value": 0.293000, "errors": 753},
{"value": 0.293500, "errors": 753},
{"value": 0.294000, "errors": 753},
{"value": 0.294500, "errors": 753},
{"value": 0.295000, "errors": 753},
{"value": 0.295500, "errors": 753},
{"value": 0.296000, "errors": 753},
{"value": 0.296500, "errors": 753},
{"value": 0.297000, "errors": 753},
{"value": 0.297500, "errors": 753},
{"value": 0.298000, "errors": 753},
{"value": 0.298500, "errors": 753},
{"value": 0.299000, "errors": 753},
{"value": 0.299500, "errors": 753},
{"value": 0.300000, "errors": 753},
{"value": 0.300500, "errors": 753},
{"value": 0.301000, "errors": 753},
{"value": 0.301500, "errors": 753},
{"value": 0.302000, "errors": 753},
{"value": 0.302500, "errors": 753},
{"value": 0.303000, "errors": 753},
{"value": 0.303500, "errors": 753},
{"value": 0.304000, "errors": 753},
{"value": 0.304500, "errors": 753},
{"value": 0.305000, "errors": 753},
{"value": 0.305500, "errors": 753},
{"value": 0.306000, "errors": 753},
{"value": 0.306500, "errors": 752},
{"value": 0.307000, "errors": 752},
{"value": 0.307500, "errors": 752},
{"value": 0.308000, "errors": 752},
{"value": 0.308500, "errors": 752},
{"value": 0.309000, "errors": 752},
{"value": 0.309500, "errors": 752},
{"value": 0.310000, "errors": 752},
{"value": 0.310500, "errors": 752},
{"value": 0.311000, "errors": 752},
{"value": 0.311500, "errors": 752},
{"value": 0.312000, "errors": 752},
{"value": 0.312500, "errors": 752},
{"value": 0.313000, "errors": 752},
{"value": 0.313500, "errors": 752},
{"value": 0.314000, "errors": 752},
{"value": 0.314500, "errors": 752},
{"value": 0.315000, "errors": 752},
{"value": 0.315500, "errors": 752},
{"value": 0.316000, "errors": 752},
{"value": 0.316500, "errors": 752},
{"value": 0.317000, "errors": 752},
{"value": 0.317500, "errors": 752},
{"value": 0.318000, "errors": 752},
{"value": 0.318500, "errors": 752},
{"value": 0.319000, "errors": 752},
{"value": 0.319500, "errors": 752},
{"value": 0.320000, "errors": 752},
{"value": 0.320500, "errors": 752},
{"value": 0.321000, "errors": 752},
{"value": 0.321500, "errors": 752},
{"value": 0.322000, "errors": 752},
{"value": 0.322500, "errors": 752},
{"value": 0.323000, "errors": 752},
{"value": 0.323500, "errors": 752},
{"value": 0.324000, "errors": 752},
{"value": 0.324500, "errors": 752},
{"value": 0.325000, "errors": 752},
{"value": 0.325500, "errors": 752},
{"value": 0.326000, "errors": 752},
{"value": 0.326500, "errors": 752},
{"value": 0.327000, "errors": 752},
{"value": 0.327500, "errors": 752},
{"value": 0.328000, "errors": 752},
{"value": 0.328500, "errors": 752},
{"value": 0.329000, "errors": 752},
{"value": 0.329500, "errors": 752},
{"value": 0.330000, "errors": 752},
{"value": 0.330500, "errors": 752},
{"value": 0.331000, "errors": 752},
{"value": 0.331500, "errors": 752},
{"value": 0.332000, "errors": 752},
{"value": 0.332500, "errors": 752},
{"value": 0.333000, "errors": 752},
{"value": 0.333500, "errors": 752},
{"value": 0.334000, "errors": 752},
{"value": 0.334500, "errors": 752},
{"value": 0.335000, "errors": 752},
{"value": 0.335500, "errors": 752},
{"value": 0.336000, "errors": 752},
{"value": 0.336500, "errors": 752},
{"value": 0.337000, "errors": 752},
{"value": 0.337500, "errors": 752},
{"value": 0.338000, "errors": 752},
{"value": 0.338500, "errors": 752},
{"value": 0.339000, "errors": 752},
{"value": 0.339500, "errors": 752},
{"value": 0.340000, "errors": 752},
{"value": 0.340500, "errors": 752},
{"value": 0.341000, "errors": 752},
{"value": 0.341500, "errors": 752},
{"value": 0.342000, "errors": 752},
{"value": 0.342500, "errors": 752},
{"value": 0.343000, "errors": 751},
{"value": 0.343500, "errors": 751},
{"value": 0.344000, "errors": 751},
{"value": 0.344500, "errors": 751},
{"value": 0.345000, "errors": 751},
{"value": 0.345500, "errors": 751},
{"value": 0.346000, "errors": 751},
{"value": 0.346500, "errors": 751},
{"value": 0.347000, "errors": 751},
{"value": 0.347500, "errors": 751},
{"value": 0.348000, "errors": 751},
{"value": 0.348500, "errors": 751},
{"value": 0.349000, "errors": 751},
{"value": 0.349500, "errors": 751},
{"value": 0.350000, "errors": 751},
{"value": 0.350500, "errors": 751},
{"value": 0.351000, "errors": 751},
{"value": 0.351500, "errors": 751},
{"value": 0.352000, "errors": 751},
{"value": 0.352500, "errors": 751},
{"value": 0.353000, "errors": 751},
{"value": 0.353500, "errors": 751},
{"value": 0.354000, "errors": 751},
{"value": 0.354500, "errors": 751},
{"value": 0.355000, "errors": 751},
{"value": 0.355500, "errors": 751},
{"value": 0.356000, "errors": 751},
{"value": 0.356500, "errors": 751},
{"value": 0.357000, "errors": 751},
{"value": 0.357500, "errors": 751},
{"value": 0.358000, "errors": 751},
{"value": 0.358500, "errors": 751},
{"value": 0.359000, "errors": 751},
{"value": 0.359500, "errors": 751},
{"value": 0.360000, "errors": 751},
{"value": 0.360500, "errors": 751},
{"value": 0.361000, "errors": 751},
{"value": 0.361500, "errors": 751},
{"value": 0.362000, "errors": 751},
{"value": 0.362500, "errors": 751},
{"value": 0.363000, "errors": 751},
{"value": 0.363500, "errors": 751},
{"value": 0.364000, "errors": 751},
{"value": 0.364500, "errors": 751},
{"value": 0.365000, "errors": 751},
{"value": 0.365500, "errors": 751},
{"value": 0.366000, "errors": 751},
{"value": 0.366500, "errors": 751},
{"value": 0.367000, "errors": 751},
{"value": 0.367500, "errors": 751},
{"value": 0.368000, "errors": 751},
{"value": 0.368500, "errors": 751},
{"value": 0.369000, "errors": 751},
{"value": 0.369500, "errors": 751},
{"value": 0.370000, "errors": 751},
{"value": 0.370500, "errors": 751},
{"value": 0.371000, "errors": 751},
{"value": 0.371500, "errors": 751},
{"value": 0.372000, "errors": 751},
{"value": 0.372500, "errors": 751},
{"value": 0.373000, "errors": 751},
{"value": 0.373500, "errors": 751},
{"value": 0.374000, "errors": 751},
{"value": 0.374500, "errors": 751},
{"value": 0.375000, "errors": 751},
{"value": 0.375500, "errors": 751},
{"value": 0.376000, "errors": 751},
{"value": 0.376500, "errors": 751},
{"value": 0.377000, "errors": 751},
{"value": 0.377500, "errors": 751},
{"value": 0.378000, "errors": 751},
{"value": 0.378500, "errors": 751},
{"value": 0.379000, "errors": 751},
{"value": 0.379500, "errors": 751},
{"value": 0.380000, "errors": 751},
{"value": 0.380500, "errors": 751},
{"value": 0.381000, "errors": 751},
{"value": 0.381500, "errors": 751},
{"value": 0.382000, "errors": 751},
{"value": 0.382500, "errors": 751},
{"value": 0.383000, "errors": 751},
{"value": 0.383500, "errors": 751},
{"value": 0.384000, "errors": 751},
{"value": 0.384500, "errors": 751},
{"value": 0.385000, "errors": 751},
{"value": 0.385500, "errors": 751},
{"value": 0.386000, "errors": 751},
{"value": 0.386500, "errors": 751},
{"value": 0.387000, "errors": 751},
{"value": 0.387500, "errors": 751},
{"value": 0.388000, "errors": 751},
{"value": 0.388500, "errors": 751},
{"value": 0.389000, "errors": 751},
{"value": 0.389500, "errors": 751},
{"value": 0.390000, "errors": 751},
{"value": 0.390500, "errors": 751},
{"value": 0.391000, "errors": 751},
{"value": 0.391500, "errors": 751},
{"value": 0.392000, "errors": 751},
{"value": 0.392500, "errors": 751},
{"value": 0.393000, "errors": 751},
{"value": 0.393500, "errors": 751},
{"value": 0.394000, "errors": 751},
{"value": 0.394500, "errors": 751},
{"value": 0.395000, "errors": 751},
{"value": 0.395500, "errors": 751},
{"value": 0.396000, "errors": 751},
{"value": 0.396500, "errors": 751},
{"value": 0.397000, "errors": 751},
{"value": 0.397500, "errors": 751},
{"value": 0.398000, "errors": 751},
{"value": 0.398500, "errors": 751},
{"value": 0.399000, "errors": 751},
{"value": 0.399500, "errors": 751},
{"value": 0.400000, "errors": 751},
{"value": 0.400500, "errors": 751},
{"value": 0.401000, "errors": 751},
{"value": 0.401500, "errors": 751},
{"value": 0.402000, "errors": 751},
{"value": 0.402500, "errors": 751},
{"value": 0.403000, "errors": 751},
{"value": 0.403500, "errors": 751},
{"value": 0.404000, "errors": 751},
{"value": 0.404500, "errors": 751},
{"value": 0.405000, "errors": 751},
{"value": 0.405500, "errors": 751},
{"value": 0.406000, "errors": 751},
{"value": 0.406500, "errors": 751},
{"value": 0.407000, "errors": 751},
{"value": 0.407500, "errors": 751},
{"value": 0.408000, "errors": 751},
{"value": 0.408500, "errors": 751},
{"value": 0.409000, "errors": 751},
{"value": 0.409500, "errors": 751},
{"value": 0.410000, "errors": 751},
{"value": 0.410500, "errors": 751},
{"value": 0.411000, "errors": 751},
{"value": 0.411500, "errors": 751},
{"value": 0.412000, "errors": 751},
{"value": 0.412500, "errors": 751},
{"value": 0.413000, "errors": 751},
{"value": 0.413500, "errors": 751},
{"value": 0.414000, "errors": 751},
{"value": 0.414500, "errors": 751},
{"value": 0.415000, "errors": 751},
{"value": 0.415500, "errors": 751},
{"value": 0.416000, "errors": 751},
{"value": 0.416500, "errors": 751},
{"value": 0.417000, "errors": 751},
{"value": 0.417500, "errors": 751},
{"value": 0.418000, "errors": 751},
{"value": 0.418500, "errors": 751},
{"value": 0.419000, "errors": 751},
{"value": 0.419500, "errors": 751},
{"value": 0.420000, "errors": 751},
{"value": 0.420500, "errors": 751},
{"value": 0.421000, "errors": 751},
{"value": 0.421500, "errors": 751},
{"value": 0.422000, "errors": 751},
{"value": 0.422500, "errors": 751},
{"value": 0.423000, "errors": 751},
{"value": 0.423500, "errors": 751},
{"value": 0.424000, "errors": 751},
{"value": 0.424500, "errors": 751},
{"value": 0.425000, "errors": 751},
{"value": 0.425500, "errors": 751},
{"value": 0.426000, "errors": 751},
{"value": 0.426500, "errors": 751},
{"value": 0.427000, "errors": 751},
{"value": 0.427500, "errors": 751},
{"value": 0.428000, "errors": 751},
{"value": 0.428500, "errors": 751},
{"value": 0.429000, "errors": 751},
{"value": 0.429500, "errors": 751},
{"value": 0.430000, "errors": 751},
{"value": 0.430500, "errors": 751},
{"value": 0.431000, "errors": 751},
{"value": 0.431500, "errors": 751},
{"value": 0.432000, "errors": 751},
{"value": 0.432500, "errors": 751},
{"value": 0.433000, "errors": 751},
{"value": 0.433500, "errors": 751},
{"value": 0.434000, "errors": 751},
{"value": 0.434500, "errors": 751},
{"value": 0.435000, "errors": 751},
{"value": 0.435500, "errors": 751},
{"value": 0.436000, "errors": 751},
{"value": 0.436500, "errors": 751},
{"value": 0.437000, "errors": 751},
{"value": 0.437500, "errors": 751},
{"value": 0.438000, "errors": 751},
{"value": 0.438500, "errors": 751},
{"value": 0.439000, "errors": 751},
{"value": 0.439500, "errors": 751},
{"value": 0.440000, "errors": 751},
{"value": 0.440500, "errors": 751},
{"value": 0.441000, "errors": 751},
{"value": 0.441500, "errors": 751},
{"value": 0.442000, "errors": 751},
{"value": 0.442500, "errors": 751},
{"value": 0.443000, "errors": 751},
{"value": 0.443500, "errors": 751},
{"value": 0.444000, "errors": 751},
{"value": 0.444500, "errors": 751},
{"value": 0.445000, "errors": 751},
{"value": 0.445500, "errors": 751},
{"value": 0.446000, "errors": 751},
{"value": 0.446500, "errors": 751},
{"value": 0.447000, "errors": 751},
{"value": 0.447500, "errors": 751},
{"value": 0.448000, "errors": 751},
{"value": 0.448500, "errors": 751},
{"value": 0.449000, "errors": 751},
{"value": 0.449500, "errors": 751},
{"value": 0.450000, "errors": 751},
{"value": 0.450500, "errors": 751},
{"value": 0.451000, "errors": 751},
{"value": 0.451500, "errors": 751},
{"value": 0.452000, "errors": 751},
{"value": 0.452500, "errors": 751},
{"value": 0.453000, "errors": 751},
{"value": 0.453500, "errors": 751},
{"value": 0.454000, "errors": 751},
{"value": 0.454500, "errors": 751},
{"value": 0.455000, "errors": 751},
{"value": 0.455500, "errors": 751},
{"value": 0.456000, "errors": 751},
{"value": 0.456500, "errors": 751},
{"value": 0.457000, "errors": 751},
{"value": 0.457500, "errors": 751},
{"value": 0.458000, "errors": 751},
{"value": 0.458500, "errors": 751},
{"value": 0.459000, "errors": 750},
{"value": 0.459500, "errors": 750},
{"value": 0.460000, "errors": 750},
{"value": 0.460500, "errors": 750},
{"value": 0.461000, "errors": 750},
{"value": 0.461500, "errors": 750},
{"value": 0.462000, "errors": 750},
{"value": 0.462500, "errors": 750},
{"value": 0.463000, "errors": 750},
{"value": 0.463500, "errors": 750},
{"value": 0.464000, "errors": 750},
{"value": 0.464500, "errors": 750},
{"value": 0.465000, "errors": 750},
{"value": 0.465500, "errors": 750},
{"value": 0.466000, "errors": 750},
{"value": 0.466500, "errors": 750},
{"value": 0.467000, "errors": 750},
{"value": 0.467500, "errors": 750},
{"value": 0.468000, "errors": 750},
{"value": 0.468500, "errors": 750},
{"value": 0.469000, "errors": 750},
{"value": 0.469500, "errors": 750},
{"value": 0.470000, "errors": 750},
{"value": 0.470500, "errors": 750},
{"value": 0.471000, "errors": 750},
{"value": 0.471500, "errors": 750},
{"value": 0.472000, "errors": 750},
{"value": 0.472500, "errors": 750},
{"value": 0.473000, "errors": 750},
{"value": 0.473500, "errors": 750},
{"value": 0.474000, "errors": 750},
{"value": 0.474500, "errors": 750},
{"value": 0.475000, "errors": 750},
{"value": 0.475500, "errors": 750},
{"value": 0.476000, "errors": 750},
{"value": 0.476500, "errors": 750},
{"value": 0.477000, "errors": 750},
{"value": 0.477500, "errors": 750},
{"value": 0.478000, "errors": 750},
{"value": 0.478500, "errors": 750},
{"value": 0.479000, "errors": 750},
{"value": 0.479500, "errors": 749},
{"value": 0.480000, "errors": 749},
{"value": 0.480500, "errors": 749},
{"value": 0.481000, "errors": 749},
{"value": 0.481500, "errors": 749},
{"value": 0.482000, "errors": 749},
{"value": 0.482500, "errors": 749},
{"value": 0.483000, "errors": 749},
{"value": 0.483500, "errors": 749},
{"value": 0.484000, "errors": 749},
{"value": 0.484500, "errors": 749},
{"value": 0.485000, "errors": 749},
{"value": 0.485500, "errors": 749},
{"value": 0.486000, "errors": 749},
{"value": 0.486500, "errors": 749},
{"value": 0.487000, "errors": 749},
{"value": 0.487500, "errors": 749},
{"value": 0.488000, "errors": 749},
{"value": 0.488500, "errors": 749},
{"value": 0.489000, "errors": 749},
{"value": 0.489500, "errors": 749},
{"value": 0.490000, "errors": 749},
{"value": 0.490500, "errors": 749},
{"value": 0.491000, "errors": 749},
{"value": 0.491500, "errors": 749},
{"value": 0.492000, "errors": 749},
{"value": 0.492500, "errors": 749},
{"value": 0.493000, "errors": 749},
{"value": 0.493500, "errors": 749},
{"value": 0.494000, "errors": 749},
{"value": 0.494500, "errors": 749},
{"value": 0.495000, "errors": 749},
{"value": 0.495500, "errors": 749},
{"value": 0.496000, "errors": 749},
{"value": 0.496500, "errors": 749},
{"value": 0.497000, "errors": 749},
{"value": 0.497500, "errors": 749},
{"value": 0.498000, "errors": 749},
{"value": 0.498500, "errors": 749},
{"value": 0.499000, "errors": 749},
{"value": 0.499500, "errors": 749},
{"value": 0.500000, "errors": 749},
{"value": 0.500500, "errors": 749},
{"value": 0.501000, "errors": 749},
{"value": 0.501500, "errors": 749},
{"value": 0.502000, "errors": 749},
{"value": 0.502500, "errors": 749},
{"value": 0.503000, "errors": 749},
{"value": 0.503500, "errors": 749},
{"value": 0.504000, "errors": 749},
{"value": 0.504500, "errors": 749},
{"value": 0.505000, "errors": 749},
{"value": 0.505500, "errors": 749},
{"value": 0.506000, "errors": 749},
{"value": 0.506500, "errors": 749},
{"value": 0.507000, "errors": 749},
{"value": 0.507500, "errors": 749},
{"value": 0.508000, "errors": 749},
{"value": 0.508500, "errors": 749},
{"value": 0.509000, "errors": 749},
{"value": 0.509500, "errors": 749},
{"value": 0.510000, "errors": 749},
{"value": 0.510500, "errors": 749},
{"value": 0.511000, "errors": 749},
{"value": 0.511500, "errors": 749},
{"value": 0.512000, "errors": 749},
{"value": 0.512500, "errors": 749},
{"value": 0.513000, "errors": 749},
{"value": 0.513500, "errors": 749},
{"value": 0.514000, "errors": 749},
{"value": 0.514500, "errors": 749},
{"value": 0.515000, "errors": 749},
{"value": 0.515500, "errors": 749},
{"value": 0.516000, "errors": 749},
{"value": 0.516500, "errors": 749},
{"value": 0.517000, "errors": 749},
{"value": 0.517500, "errors": 749},
{"value": 0.518000, "errors": 749},
{"value": 0.518500, "errors": 749},
{"value": 0.519000, "errors": 749},
{"value": 0.519500, "errors": 749},
{"value": 0.520000, "errors": 749},
{"value": 0.520500, "errors": 749},
{"value": 0.521000, "errors": 749},
{"value": 0.521500, "errors": 749},
{"value": 0.522000, "errors": 749},
{"value": 0.522500, "errors": 749},
{"value": 0.523000, "errors": 749},
{"value": 0.523500, "errors": 749},
{"value": 0.524000, "errors": 749},
{"value": 0.524500, "errors": 749},
{"value": 0.525000, "errors": 749},
{"value": 0.525500, "errors": 749},
{"value": 0.526000, "errors": 749},
{"value": 0.526500, "errors": 749},
{"value": 0.527000, "errors": 749},
{"value": 0.527500, "errors": 749},
{"value": 0.528000, "errors": 749},
{"value": 0.528500, "errors": 749},
{"value": 0.529000, "errors": 749},
{"value": 0.529500, "errors": 749},
{"value": 0.530000, "errors": 749},
{"value": 0.530500, "errors": 749},
{"value": 0.531000, "errors": 749},
{"value": 0.531500, "errors": 749},
{"value": 0.532000, "errors": 749},
{"value": 0.532500, "errors": 749},
{"value": 0.533000, "errors": 749},
{"value": 0.533500, "errors": 749},
{"value": 0.534000, "errors": 749},
{"value": 0.534500, "errors": 749},
{"value": 0.535000, "errors": 749},
{"value": 0.535500, "errors": 749},
{"value": 0.536000, "errors": 749},
{"value": 0.536500, "errors": 749},
{"value": 0.537000, "errors": 749},
{"value": 0.537500, "errors": 749},
{"value": 0.538000, "errors": 748},
{"value": 0.538500, "errors": 748},
{"value": 0.539000, "errors": 748},
{"value": 0.539500, "errors": 748},
{"value": 0.540000, "errors": 748},
{"value": 0.540500, "errors": 748},
{"value": 0.541000, "errors": 748},
{"value": 0.541500, "errors": 748},
{"value": 0.542000, "errors": 748},
{"value": 0.542500, "errors": 748},
{"value": 0.543000, "errors": 748},
{"value": 0.543500, "errors": 748},
{"value": 0.544000, "errors": 748},
{"value": 0.544500, "errors": 748},
{"value": 0.545000, "errors": 748},
{"value": 0.545500, "errors": 748},
{"value": 0.546000, "errors": 748},
{"value": 0.546500, "errors": 748},
{"value": 0.547000, "errors": 748},
{"value": 0.547500, "errors": 748},
{"value": 0.548000, "errors": 748},
{"value": 0.548500, "errors": 748},
{"value": 0.549000, "errors": 748},
{"value": 0.549500, "errors": 748},
{"value": 0.550000, "errors": 748},
{"value": 0.550500, "errors": 748},
{"value": 0.551000, "errors": 748},
{"value": 0.551500, "errors": 748},
{"value": 0.552000, "errors": 748},
{"value": 0.552500, "errors": 748},
{"value": 0.553000, "errors": 748},
{"value": 0.553500, "errors": 748},
{"value": 0.554000, "errors": 748},
{"value": 0.554500, "errors": 748},
{"value": 0.555000, "errors": 748},
{"value": 0.555500, "errors": 748},
{"value": 0.556000, "errors": 748},
{"value": 0.556500, "errors": 748},
{"value": 0.557000, "errors": 748},
{"value": 0.557500, "errors": 748},
{"value": 0.558000, "errors": 748},
{"value": 0.558500, "errors": 748},
{"value": 0.559000, "errors": 748},
{"value": 0.559500, "errors": 748},
{"value": 0.560000, "errors": 748},
{"value": 0.560500, "errors": 748},
{"value": 0.561000, "errors": 748},
{"value": 0.561500, "errors": 748},
{"value": 0.562000, "errors": 748},
{"value": 0.562500, "errors": 748},
{"value": 0.563000, "errors": 748},
{"value": 0.563500, "errors": 748},
{"value": 0.564000, "errors": 748},
{"value": 0.564500, "errors": 748},
{"value": 0.565000, "errors": 748},
{"value": 0.565500, "errors": 748},
{"value": 0.566000, "errors": 748},
{"value": 0.566500, "errors": 748},
{"value": 0.567000, "errors": 748},
{"value": 0.567500, "errors": 748},
{"value": 0.568000, "errors": 748},
{"value": 0.568500, "errors": 748},
{"value": 0.569000, "errors": 748},
{"value": 0.569500, "errors": 748},
{"value": 0.570000, "errors": 748},
{"value": 0.570500, "errors": 748},
{"value": 0.571000, "errors": 748},
{"value": 0.571500, "errors": 748},
{"value": 0.572000, "errors": 747},
{"value": 0.572500, "errors": 747},
{"value": 0.573000, "errors": 747},
{"value": 0.573500, "errors": 747},
{"value": 0.574000, "errors": 747},
{"value": 0.574500, "errors": 747},
{"value": 0.575000, "errors": 747},
{"value": 0.575500, "errors": 747},
{"value": 0.576000, "errors": 747},
{"value": 0.576500, "errors": 747},
{"value": 0.577000, "errors": 747},
{"value": 0.577500, "errors": 747},
{"value": 0.578000, "errors": 747},
{"value": 0.578500, "errors": 747},
{"value": 0.579000, "errors": 747},
{"value": 0.579500, "errors": 747},
{"value": 0.580000, "errors": 747},
{"value": 0.580500, "errors": 747},
{"value": 0.581000, "errors": 747},
{"value": 0.581500, "errors": 747},
{"value": 0.582000, "errors": 747},
{"value": 0.582500, "errors": 747},
{"value": 0.583000, "errors": 747},
{"value": 0.583500, "errors": 747},
{"value": 0.584000, "errors": 747},
{"value": 0.584500, "errors": 747},
{"value": 0.585000, "errors": 747},
{"value": 0.585500, "errors": 747},
{"value": 0.586000, "errors": 747},
{"value": 0.586500, "errors": 747},
{"value": 0.587000, "errors": 747},
{"value": 0.587500, "errors": 747},
{"value": 0.588000, "errors": 747},
{"value": 0.588500, "errors": 747},
{"value": 0.589000, "errors": 747},
{"value": 0.589500, "errors": 747},
{"value": 0.590000, "errors": 747},
{"value": 0.590500, "errors": 747},
{"value": 0.591000, "errors": 747},
{"value": 0.591500, "errors": 747},
{"value": 0.592000, "errors": 747},
{"value": 0.592500, "errors": 747},
{"value": 0.593000, "errors": 747},
{"value": 0.593500, "errors": 747},
{"value": 0.594000, "errors": 747},
{"value": 0.594500, "errors": 747},
{"value": 0.595000, "errors": 747},
{"value": 0.595500, "errors": 747},
{"value": 0.596000, "errors": 747},
{"value": 0.596500, "errors": 747},
{"value": 0.597000, "errors": 747},
{"value": 0.597500, "errors": 747},
{"value": 0.598000, "errors": 747},
{"value": 0.598500, "errors": 747},
{"value": 0.599000, "errors": 747},
{"value": 0.599500, "errors": 747},
{"value": 0.600000, "errors": 747},
{"value": 0.600500, "errors": 747},
{"value": 0.601000, "errors": 747},
{"value": 0.601500, "errors": 747},
{"value": 0.602000, "errors": 747},
{"value": 0.602500, "errors": 747},
{"value": 0.603000, "errors": 747},
{"value": 0.603500, "errors": 747},
{"value": 0.604000, "errors": 747},
{"value": 0.604500, "errors": 747},
{"value": 0.605000, "errors": 747},
{"value": 0.605500, "errors": 747},
{"value": 0.606000, "errors": 747},
{"value": 0.606500, "errors": 747},
{"value": 0.607000, "errors": 747},
{"value": 0.607500, "errors": 747},
{"value": 0.608000, "errors": 747},
{"value": 0.608500, "errors": 747},
{"value": 0.609000, "errors": 747},
{"value": 0.609500, "errors": 747},
{"value": 0.610000, "errors": 747},
{"value": 0.610500, "errors": 747},
{"value": 0.611000, "errors": 747},
{"value": 0.611500, "errors": 747},
{"value": 0.612000, "errors": 747},
{"value": 0.612500, "errors": 747},
{"value": 0.613000, "errors": 747},
{"value": 0.613500, "errors": 747},
{"value": 0.614000, "errors": 747},
{"value": 0.614500, "errors": 747},
{"value": 0.615000, "errors": 747},
{"value": 0.615500, "errors": 747},
{"value": 0.616000, "errors": 747},
{"value": 0.616500, "errors": 747},
{"value": 0.617000, "errors": 747},
{"value": 0.617500, "errors": 747},
{"value": 0.618000, "errors": 747},
{"value": 0.618500, "errors": 747},
{"value": 0.619000, "errors": 747},
{"value": 0.619500, "errors": 747},
{"value": 0.620000, "errors": 747},
{"value": 0.620500, "errors": 747},
{"value": 0.621000, "errors": 747},
{"value": 0.621500, "errors": 747},
{"value": 0.622000, "errors": 747},
{"value": 0.622500, "errors": 747},
{"value": 0.623000, "errors": 747},
{"value": 0.623500, "errors": 747},
{"value": 0.624000, "errors": 747},
{"value": 0.624500, "errors": 747},
{"value": 0.625000, "errors": 747},
{"value": 0.625500, "errors": 747},
{"value": 0.626000, "errors": 747},
{"value": 0.626500, "errors": 747},
{"value": 0.627000, "errors": 747},
{"value": 0.627500, "errors": 747},
{"value": 0.628000, "errors": 747},
{"value": 0.628500, "errors": 747},
{"value": 0.629000, "errors": 747},
{"value": 0.629500, "errors": 747},
{"value": 0.630000, "errors": 747},
{"value": 0.630500, "errors": 747},
{"value": 0.631000, "errors": 747},
{"value": 0.631500, "errors": 747},
{"value": 0.632000, "errors": 747},
{"value": 0.632500, "errors": 747},
{"value": 0.633000, "errors": 747},
{"value": 0.633500, "errors": 747},
{"value": 0.634000, "errors": 747},
{"value": 0.634500, "errors": 747},
{"value": 0.635000, "errors": 747},
{"value": 0.635500, "errors": 747},
{"value": 0.636000, "errors": 747},
{"value": 0.636500, "errors": 747},
{"value": 0.637000, "errors": 747},
{"value": 0.637500, "errors": 747},
{"value": 0.638000, "errors": 747},
{"value": 0.638500, "errors": 747},
{"value": 0.639000, "errors": 747},
{"value": 0.639500, "errors": 747},
{"value": 0.640000, "errors": 747},
{"value": 0.640500, "errors": 747},
{"value": 0.641000, "errors": 747},
{"value": 0.641500, "errors": 747},
{"value": 0.642000, "errors": 747},
{"value": 0.642500, "errors": 747},
{"value": 0.643000, "errors": 747},
{"value": 0.643500, "errors": 747},
{"value": 0.644000, "errors": 747},
{"value": 0.644500, "errors": 747},
{"value": 0.645000, "errors": 747},
{"value": 0.645500, "errors": 747},
{"value": 0.646000, "errors": 747},
{"value": 0.646500, "errors": 747},
{"value": 0.647000, "errors": 747},
{"value": 0.647500, "errors": 747},
{"value": 0.648000, "errors": 747},
{"value": 0.648500, "errors": 747},
{"value": 0.649000, "errors": 747},
{"value": 0.649500, "errors": 747},
{"value": 0.650000, "errors": 747},
{"value": 0.650500, "errors": 747},
{"value": 0.651000, "errors": 747},
{"value": 0.651500, "errors": 747},
{"value": 0.652000, "errors": 747},
{"value": 0.652500, "errors": 747},
{"value": 0.653000, "errors": 747},
{"value": 0.653500, "errors": 747},
{"value": 0.654000, "errors": 747},
{"value": 0.654500, "errors": 747},
{"value": 0.655000, "errors": 747},
{"value": 0.655500, "errors": 747},
{"value": 0.656000, "errors": 747},
{"value": 0.656500, "errors": 747},
{"value": 0.657000, "errors": 747},
{"value": 0.657500, "errors": 747},
{"value": 0.658000, "errors": 747},
{"value": 0.658500, "errors": 747},
{"value": 0.659000, "errors": 747},
{"value": 0.659500, "errors": 747},
{"value": 0.660000, "errors": 747},
{"value": 0.660500, "errors": 747},
{"value": 0.661000, "errors": 747},
{"value": 0.661500, "errors": 747},
{"value": 0.662000, "errors": 747},
{"value": 0.662500, "errors": 747},
{"value": 0.663000, "errors": 747},
{"value": 0.663500, "errors": 747},
{"value": 0.664000, "errors": 747},
{"value": 0.664500, "errors": 747},
{"value": 0.665000, "errors": 747},
{"value": 0.665500, "errors": 747},
{"value": 0.666000, "errors": 747},
{"value": 0.666500, "errors": 747},
{"value": 0.667000, "errors": 747},
{"value": 0.667500, "errors": 747},
{"value": 0.668000, "errors": 747},
{"value": 0.668500, "errors": 747},
{"value": 0.669000, "errors": 747},
{"value": 0.669500, "errors": 747},
{"value": 0.670000, "errors": 747},
{"value": 0.670500, "errors": 747},
{"value": 0.671000, "errors": 747},
{"value": 0.671500, "errors": 747},
{"value": 0.672000, "errors": 747},
{"value": 0.672500, "errors": 747},
{"value": 0.673000, "errors": 747},
{"value": 0.673500, "errors": 747},
{"value": 0.674000, "errors": 747},
{"value": 0.674500, "errors": 747},
{"value": 0.675000, "errors": 747},
{"value": 0.675500, "errors": 747},
{"value": 0.676000, "errors": 747},
{"value": 0.676500, "errors": 747},
{"value": 0.677000, "errors": 747},
{"value": 0.677500, "errors": 747},
{"value": 0.678000, "errors": 747},
{"value": 0.678500, "errors": 747},
{"value": 0.679000, "errors": 747},
{"value": 0.679500, "errors": 747},
{"value": 0.680000, "errors": 747},
{"value": 0.680500, "errors": 747},
{"value": 0.681000, "errors": 747},
{"value": 0.681500, "errors": 747},
{"value": 0.682000, "errors": 747},
{"value": 0.682500, "errors": 747},
{"value": 0.683000, "errors": 747},
{"value": 0.683500, "errors": 747},
{"value": 0.684000, "errors": 747},
{"value": 0.684500, "errors": 747},
{"value": 0.685000, "errors": 747},
{"value": 0.685500, "errors": 747},
{"value": 0.686000, "errors": 747},
{"value": 0.686500, "errors": 747},
{"value": 0.687000, "errors": 747},
{"value": 0.687500, "errors": 747},
{"value": 0.688000, "errors": 747},
{"value": 0.688500, "errors": 747},
{"value": 0.689000, "errors": 747},
{"value": 0.689500, "errors": 747},
{"value": 0.690000, "errors": 747},
{"value": 0.690500, "errors": 747},
{"value": 0.691000, "errors": 747},
{"value": 0.691500, "errors": 747},
{"value": 0.692000, "errors": 747},
{"value": 0.692500, "errors": 747},
{"value": 0.693000, "errors": 747},
{"value": 0.693500, "errors": 747},
{"value": 0.694000, "errors": 747},
{"value": 0.694500, "errors": 747},
{"value": 0.695000, "errors": 747},
{"value": 0.695500, "errors": 747},
{"value": 0.696000, "errors": 747},
{"value": 0.696500, "errors": 747},
{"value": 0.697000, "errors": 747},
{"value": 0.697500, "errors": 747},
{"value": 0.698000, "errors": 747},
{"value": 0.698500, "errors": 747},
{"value": 0.699000, "errors": 747},
{"value": 0.699500, "errors": 747},
{"value": 0.700000, "errors": 747},
]

x = []
y = []

for value in data:
    x.append(value["value"])
    y.append(value["errors"])

from pandas import *

d = {"x": x, "y": y}
df = DataFrame(d)

import matplotlib.pyplot as plt
from pandas.tools.rplot import *

plt.plot(x, y, 'ro')
plt.ylabel('errors')
plt.xlabel('threshold_p_for_first_filter_separator_character')
plt.title('threshold_p_for_first_filter_separator_character vs errors count')

polynomial = Polynomial(x, y, 4)

new_x = []
new_y = []
current_x = 0.
while current_x < 0.62:
    new_x.append(current_x)
    new_y.append(polynomial.getval(current_x))
    current_x += 0.00005

plt.plot(new_x, new_y, 'ro')
print (polynomial.getval(0.))