# Path: oe_utils/utils/h5_utils.py
# def load(filename, load_all=True):
# def dump(data, filename, attrs=None, options=None):


import collections
import cPickle as pickle
import gflags as flags
import gzip
import logging
import numpy as np
import pandas as pd
import sys
from oe_utils.utils import h5_utils
from sklearn import cross_validation
from sklearn import ensemble
from sklearn import grid_search
from sklearn import linear_model
from sklearn import metrics
from sklearn import preprocessing
from sklearn import svm
    rocs_inactives = h5_utils.load(FLAGS.rocs_inactives % dataset)

    num_actives = len(rocs_actives['shape_tanimoto'])
    num_inactives = len(rocs_inactives['shape_tanimoto'])
    labels = np.concatenate((np.ones(num_actives, dtype=int),
                             np.zeros(num_inactives, dtype=int)))

    for feature in ['shape_tanimoto', 'color_tanimoto', 'shape_overlap',
                    'color_overlap', 'ref_self_shape', 'ref_self_color',
                    'fit_self_shape', 'fit_self_color', 'ref_titles',
                    'fit_titles']:
        features[feature] = np.concatenate((rocs_actives[feature],
                                            rocs_inactives[feature]))
    features['combo_tanimoto'] = np.true_divide(
        features['shape_tanimoto'] + features['color_tanimoto'], 2)

    # Tversky.
    features['shape_tversky'] = np.true_divide(
        features['shape_overlap'],
        0.95 * features['ref_self_shape'] +
        0.05 * features['fit_self_shape'])
    features['color_tversky'] = np.true_divide(
        features['color_overlap'],
        0.95 * features['ref_self_color'] +
        0.05 * features['fit_self_color'])
    features['combo_tversky'] = np.true_divide(
        features['shape_tversky'] + features['color_tversky'], 2)

    # Color components.
    cc_actives = h5_utils.load(FLAGS.color_components_actives % dataset)

# Path: oe_utils/utils/h5_utils.py
# def load(filename, load_all=True):
# def dump(data, filename, attrs=None, options=None):


# Path: paper/code/models.py
import collections
import cPickle as pickle
import gflags as flags
import gzip
import logging
import numpy as np
import pandas as pd
import sys
from oe_utils.utils import h5_utils
from sklearn import cross_validation
from sklearn import ensemble
from sklearn import grid_search
from sklearn import linear_model
from sklearn import metrics
from sklearn import preprocessing
from sklearn import svm

    rocs_inactives = h5_utils.load(FLAGS.rocs_inactives % dataset)

    num_actives = len(rocs_actives['shape_tanimoto'])
    num_inactives = len(rocs_inactives['shape_tanimoto'])
    labels = np.concatenate((np.ones(num_actives, dtype=int),
                             np.zeros(num_inactives, dtype=int)))

    for feature in ['shape_tanimoto', 'color_tanimoto', 'shape_overlap',
                    'color_overlap', 'ref_self_shape', 'ref_self_color',
                    'fit_self_shape', 'fit_self_color', 'ref_titles',
                    'fit_titles']:
        features[feature] = np.concatenate((rocs_actives[feature],
                                            rocs_inactives[feature]))
    features['combo_tanimoto'] = np.true_divide(
        features['shape_tanimoto'] + features['color_tanimoto'], 2)

    # Tversky.
    features['shape_tversky'] = np.true_divide(
        features['shape_overlap'],
        0.95 * features['ref_self_shape'] +
        0.05 * features['fit_self_shape'])
    features['color_tversky'] = np.true_divide(
        features['color_overlap'],
        0.95 * features['ref_self_color'] +
        0.05 * features['fit_self_color'])
    features['combo_tversky'] = np.true_divide(
        features['shape_tversky'] + features['color_tversky'], 2)

    # Color components.
    cc_actives = h5_utils.load(FLAGS.color_components_actives % dataset)

    cc_inactives = h5_utils.load(FLAGS.color_components_inactives % dataset)