From 536d52d1c9aa9e144adee5d4248c488584c5bb6b Mon Sep 17 00:00:00 2001 From: Kacper Dudzic Date: Sun, 24 Apr 2022 17:10:42 +0200 Subject: [PATCH] work on lab6 --- lab6/Jenkinsfile | 5 +++-- simple_regression.py | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lab6/Jenkinsfile b/lab6/Jenkinsfile index af5e588..7302dce 100644 --- a/lab6/Jenkinsfile +++ b/lab6/Jenkinsfile @@ -11,8 +11,9 @@ pipeline { echo 'Datasets copied' echo 'Conducting simple regression model test' sh 'python3 simple_regression.py' - echo 'Model predictions saved' - sh 'head lego_linreg_results.csv' + echo 'Model and predictions saved' + sh 'head lego_reg_results.csv' + sh 'head lego_reg_model' } } } diff --git a/simple_regression.py b/simple_regression.py index 8a45617..f0be61e 100644 --- a/simple_regression.py +++ b/simple_regression.py @@ -1,5 +1,6 @@ import tensorflow as tf from keras import layers +from keras import save_model import pandas as pd import numpy as np import matplotlib.pyplot as plt @@ -51,7 +52,10 @@ y = model.predict(x) # Zapis predykcji do pliku results = pd.DataFrame({"input_piece_count": x.numpy().tolist(), "predicted_price": [a[0] for a in y.tolist()]}) -results.to_csv(r'lego_linreg_results.csv', index=False, header=True) +results.to_csv(r'lego_reg_results.csv', index=False, header=True) + +# Zapis modelu do pliku +model.save('lego_reg_model') # Opcjonalne statystyki, wykresy '''