Exemplo n.º 1
0
#print(header)

raw_data = np.column_stack((SpamEmails, EnronEmails)).T

print("DEBUG::raw_data:")
print(raw_data)

encoder.process(raw_data, max_cells)
X, y = encoder.encode_data(raw_data, header, maxlen)

# build classifier model
model = Classifier.generate_transfer_model(maxlen,
                                           max_cells,
                                           category_count_prior,
                                           category_count,
                                           checkpoint,
                                           checkpoint_dir,
                                           activation='sigmoid')
#Classifier.load_weights(checkpoint, None, model, checkpoint_dir)
model_compile = lambda m: m.compile(
    loss='binary_crossentropy', optimizer='adam', metrics=['binary_accuracy'])
model_compile(model)

#y = model.predict(X)
# discard empty column edge case
# y[np.all(frame.isnull(),axis=0)]=0
#result = encoder.reverse_label_encode(y,p_threshold)
### FINISHED LABELING COMBINED DATA AS CATEGORICAL/ORDINAL
#print("The predicted classes and probabilities are respectively:")
#print(result)