Commit f38a35a7 authored by Julian Rogawski's avatar Julian Rogawski
Browse files

Machine Learning Method notebook finished

parent dd623d27
This diff is collapsed.
......@@ -32,9 +32,9 @@ model = SimpleDeepNeuralNetworkClassifier(feature_columns,
classes=2)
predictions = Predictor.predict_classification(model, PredictionDataSet(person_predict_data, features, targets))
Predictor.print_prediction_classification(predictions, labels, person_predict_data["is_speaker"].astype(int))
#Predictor.print_prediction_classification(predictions, labels, person_predict_data["is_speaker"].astype(int))
for person, prediction in zip(person_predict_data, predictions):
person["is_speaker"] = prediction['class_ids'][0]
for index, person in person_predict_data.iterrows():
person["is_speaker"] = next(predictions)['class_ids'][0]
f = open("src/julian/data/02_speaker_predictions.json", "w")
pd.DataFrame.to_json(person_predict_data[["name", "gender", "conference_name", "is_speaker"]], f, orient="records")
\ No newline at end of file
model_checkpoint_path: "model.ckpt-10000"
all_model_checkpoint_paths: "model.ckpt-10000"
model_checkpoint_path: "model.ckpt-20000"
all_model_checkpoint_paths: "model.ckpt-20000"
This diff is collapsed.
......@@ -15,9 +15,11 @@ class Model:
self.optimizer: Optimizer = optimizer
self.estimator: Estimator = None
self.save_directory: str = save_directory
if self.save_directory is not None:
self.save_directory = self.save_directory + "/checkpoints"
self.run_config = tf.estimator.RunConfig(save_summary_steps=100,
keep_checkpoint_max=1,
model_dir=self.save_directory + "/checkpoints")
model_dir=self.save_directory)
self.feature_columns = feature_columns
def generate_estimator(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment