In [2]:
image_data = {0.1: [0.31333333333333335, 0.28, 0.36, 0.3433333333333333, 0.38666666666666666], 1.0: [0.5433333333333333, 0.56, 0.5433333333333333, 0.6066666666666667, 0.61], 100.0: [0.5966666666666667, 0.5833333333333334, 0.5733333333333334, 0.58, 0.6266666666666667], 1000.0: [0.04666666666666667, 0.07, 0.03666666666666667, 0.07, 0.08666666666666667], 10.0: [0.62, 0.6233333333333333, 0.62, 0.64, 0.6266666666666667], 0.01: [0.1, 0.12333333333333334, 0.09333333333333334, 0.11666666666666667, 0.15333333333333332], 0.001: [0.04, 0.04, 0.023333333333333334, 0.08, 0.08666666666666667]}
print(image_data)
In [4]:
"""
from bokeh.plotting import figure, output_notebook, show
output_notebook()
p = figure(title="simple line example", x_axis_label='accuracy', y_axis_label='C')
Cs = list(data.keys())
for C, values in data.items():
print("hola", Cs, values)
p.circle(Cs, values, legend="Temp.", line_width=2)
# show the results
show(p)
"""
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
Cs = []
c_matrix = []
for C, values in image_data.items():
print(C, values)
Cs.append(C)
c_matrix.append(values)
c_matrix = np.array(c_matrix)
for i, c in enumerate(Cs):
#print(i, c, c_matrix[:, i])
plt.plot(Cs, c_matrix[:, i], 'ro')
plt.xscale('log')
plt.axis([0.01, 100, 0, 1])
plt.show()
In [5]:
from utils import calculate_accuracy
# load dataset
dataset = load_scene_categories('scene_categories')
ACC = []
for loop in range(5):
train_set, test_set = n_per_class_split(dataset, n=100)
# setup training data
X_train, y_train = split_into_X_y(train_set)
X_test, y_test = split_into_X_y(test_set)
ACC.append(calculate_accuracy(X_train, X_test, y_train, y_test, C=10))
print(ACC)
In [7]:
acc_np = np.array(ACC)
print("Mean:", acc_np.mean())
print("Std:", acc_np.std())
In [ ]: