# Path: automlk/config.py
# METRIC_NULL = 1e7
# 
# Path: automlk/context.py
# def get_dataset_folder(dataset_id):
#     """
#     storage folder of the dataset
#     :param dataset_id: id of the dataset
#     :return: folder path (root of the structure)
#     """
#     return get_data_folder() + '/%s' % dataset_id


import logging
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pylab as plt
import seaborn.apionly as sns
import itertools
import pickle
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import confusion_matrix
from .config import METRIC_NULL
from .context import get_dataset_folder
    from wordcloud import WordCloud
        # create correlation matrix with pandas
        corr = df.corr()

        # display heatmap
        for dark, theme in [(True, 'dark_background'), (False, 'seaborn-whitegrid')]:
            with plt.style.context(theme, after_reset=True):
                if dataset.n_cols > 50:
                    plt.figure(figsize=(10, 10))
                elif dataset.n_cols > 20:
                    plt.figure(figsize=(8, 8))
                elif dataset.n_cols > 10:
                    plt.figure(figsize=(7, 7))
                else:
                    plt.figure(figsize=(6, 6))
                sns.heatmap(corr, mask=np.zeros_like(corr, dtype=np.bool), cmap=sns.diverging_palette(220, 10, as_cmap=True),
                            square=True)

                plt.title('correlation map of the features')
                plt.xticks(rotation=90)
                plt.yticks(rotation=0)
                plt.savefig(get_dataset_folder(dataset.dataset_id) + '/graphs/_correl.png', transparent=TRANSPARENT)
                __save_fig(dataset.dataset_id, '_correl', dark)
    except:
        log.error('error in graph_correl_features with dataset_id %s' % dataset.dataset_id)


def __get_best_scores(scores):
    # returns the list of best scores over time
    # we will generate a list of the best values values over time
    best_scores = []

# Path: automlk/config.py
# METRIC_NULL = 1e7
# 
# Path: automlk/context.py
# def get_dataset_folder(dataset_id):
#     """
#     storage folder of the dataset
#     :param dataset_id: id of the dataset
#     :return: folder path (root of the structure)
#     """
#     return get_data_folder() + '/%s' % dataset_id


# Path: automlk/graphs.py
import logging
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pylab as plt
import seaborn.apionly as sns
import itertools
import pickle
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import confusion_matrix
from .config import METRIC_NULL
from .context import get_dataset_folder
    from wordcloud import WordCloud

        # create correlation matrix with pandas
        corr = df.corr()

        # display heatmap
        for dark, theme in [(True, 'dark_background'), (False, 'seaborn-whitegrid')]:
            with plt.style.context(theme, after_reset=True):
                if dataset.n_cols > 50:
                    plt.figure(figsize=(10, 10))
                elif dataset.n_cols > 20:
                    plt.figure(figsize=(8, 8))
                elif dataset.n_cols > 10:
                    plt.figure(figsize=(7, 7))
                else:
                    plt.figure(figsize=(6, 6))
                sns.heatmap(corr, mask=np.zeros_like(corr, dtype=np.bool), cmap=sns.diverging_palette(220, 10, as_cmap=True),
                            square=True)

                plt.title('correlation map of the features')
                plt.xticks(rotation=90)
                plt.yticks(rotation=0)
                plt.savefig(get_dataset_folder(dataset.dataset_id) + '/graphs/_correl.png', transparent=TRANSPARENT)
                __save_fig(dataset.dataset_id, '_correl', dark)
    except:
        log.error('error in graph_correl_features with dataset_id %s' % dataset.dataset_id)


def __get_best_scores(scores):
    # returns the list of best scores over time
    # we will generate a list of the best values values over time
    best_scores = []

    best = METRIC_NULL