<commit_before>'''
Created on Jun 12, 2015

@author: <NAME>
Edits: <NAME> (<EMAIL>)
'''


import numpy as np


def plot_model(model, X_lower, X_upper, ax, resolution=0.1,mean_color='r',uncertainity_color='blue',label="Model",std_scale=3,plot_mean=True):
    X = np.arange(X_lower[0], X_upper[0], resolution)

    mean = np.zeros([X.shape[0]])
    var = np.zeros([X.shape[0]])
    for i in xrange(X.shape[0]):
        mean[i], var[i] = model.predict(X[i, np.newaxis, np.newaxis])

    if plot_mean == True:
        ax.plot(X, mean, mean_color, label=label)
    ax.fill_between(X, mean + std_scale * np.sqrt(var), mean - std_scale * np.sqrt(var), facecolor=uncertainity_color, alpha=0.2)
    ax.legend(prop={'size':6})
    return ax


def plot_objective_function(objective_function, X_lower, X_upper, X, Y, ax, resolution=0.1,color='black',label='ObjectiveFunction',maximizer_flag=True):
    grid = np.arange(X_lower[0], X_upper[0], resolution)

    grid_values = np.zeros([grid.shape[0]])
    for i in xrange(grid.shape[0]):
        grid_values[i] = objective_function(grid[i])

    ax.plot(grid, grid_values, color, label=label,linestyle="--")
    if maximizer_flag ==True:
        ax.plot(X[0], Y[0], "bo")
        ax.plot(X[1],Y[1], "rv")
    ax.legend(prop={'size':6})
    return ax


def plot_acquisition_function(acquisition_function, X_lower, X_upper,X, ax, resolution=0.1,label="AcquisitionFunction", maximizer_flag = True):<commit_msg>change7<commit_after>'''
Created on Jun 12, 2015

@author: <NAME>
Edits: <NAME> (<EMAIL>)
'''


import numpy as np


def plot_model(model, X_lower, X_upper, ax, resolution=0.1,mean_color='b',uncertainity_color='blue',label="Model",std_scale=3,plot_mean=True):
    X = np.arange(X_lower[0], X_upper[0], resolution)

    mean = np.zeros([X.shape[0]])
    var = np.zeros([X.shape[0]])
    for i in xrange(X.shape[0]):
        mean[i], var[i] = model.predict(X[i, np.newaxis, np.newaxis])

    if plot_mean == True:
        ax.plot(X, mean, mean_color, label=label)
    ax.fill_between(X, mean + std_scale * np.sqrt(var), mean - std_scale * np.sqrt(var), facecolor=uncertainity_color, alpha=0.2)
    ax.legend(prop={'size':6})
    return ax


def plot_objective_function(objective_function, X_lower, X_upper, X, Y, ax, resolution=0.1,color='black',label='ObjectiveFunction',maximizer_flag=True):
    grid = np.arange(X_lower[0], X_upper[0], resolution)

    grid_values = np.zeros([grid.shape[0]])
    for i in xrange(grid.shape[0]):
        grid_values[i] = objective_function(grid[i])

    ax.plot(grid, grid_values, color, label=label,linestyle="--")
    if maximizer_flag ==True:
        ax.plot(X[0], Y[0], "bo")
        ax.plot(X[1],Y[1], "rv")
    ax.legend(prop={'size':6})
    return ax


def plot_acquisition_function(acquisition_function, X_lower, X_upper,X, ax, resolution=0.1,label="AcquisitionFunction", maximizer_flag = True):
{'fraction_non_alphanumeric': 0.1736111111111111, 'fraction_numerical': 0.021180555555555557, 'mean_word_length': 4.637964774951076, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '752914', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1089, 'n_words': 199}