Exemplo n.º 1
0
n_samples, h, w = lfw_people.images.shape

# for machine learning we use the 2 data directly (as relative pixel
# positions info is ignored by this model)
X = lfw_people.data
n_features = X.shape[1]

# the label to predict is the id of the person
y = lfw_people.target
# y = self.translate_to_binary_array(y)

target_names = lfw_people.target_names
n_classes = target_names.shape[0]

# split into a training and testing set
X_train, X_test, y_train, y_test = sklearn_train_test_split(
    X, y, test_size=0.25)

y_pred = None
y_test = None
with np.load('target-predicted-info-file-npz-exp-1.npz') as data:
    y_pred = data['arr_1']
    y_test = data['arr_0']

learning_rates = None
with np.load('learning-rates-info-file-npz-exp-1.npz') as data:
    learning_rates = data['arr_0']

plot_learning_rates_versus_epochs(1, False, learning_rates)


prediction_titles = [title(y_pred, y_test, target_names, i)
Exemplo n.º 2
0
# for machine learning we use the 2 data directly (as relative pixel
# positions info is ignored by this model)
X = lfw_people.data
n_features = X.shape[1]

# the label to predict is the id of the person
y = lfw_people.target
# y = self.translate_to_binary_array(y)

target_names = lfw_people.target_names
n_classes = target_names.shape[0]

# split into a training and testing set
X_train, X_test, y_train, y_test = sklearn_train_test_split(X,
                                                            y,
                                                            test_size=0.25)

y_pred = None
y_test = None
with np.load('target-predicted-info-file-npz-exp-1.npz') as data:
    y_pred = data['arr_1']
    y_test = data['arr_0']

learning_rates = None
with np.load('learning-rates-info-file-npz-exp-1.npz') as data:
    learning_rates = data['arr_0']

plot_learning_rates_versus_epochs(1, False, learning_rates)

prediction_titles = [