work on lab6
Some checks failed
s449288-training/pipeline/head There was a failure building this commit

This commit is contained in:
Kacper Dudzic 2022-04-24 17:10:42 +02:00
parent a857c78b74
commit 536d52d1c9
2 changed files with 8 additions and 3 deletions

5
lab6/Jenkinsfile vendored
View File

@ -11,8 +11,9 @@ pipeline {
echo 'Datasets copied' echo 'Datasets copied'
echo 'Conducting simple regression model test' echo 'Conducting simple regression model test'
sh 'python3 simple_regression.py' sh 'python3 simple_regression.py'
echo 'Model predictions saved' echo 'Model and predictions saved'
sh 'head lego_linreg_results.csv' sh 'head lego_reg_results.csv'
sh 'head lego_reg_model'
} }
} }
} }

View File

@ -1,5 +1,6 @@
import tensorflow as tf import tensorflow as tf
from keras import layers from keras import layers
from keras import save_model
import pandas as pd import pandas as pd
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
@ -51,7 +52,10 @@ y = model.predict(x)
# Zapis predykcji do pliku # Zapis predykcji do pliku
results = pd.DataFrame({"input_piece_count": x.numpy().tolist(), "predicted_price": [a[0] for a in y.tolist()]}) 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 # Opcjonalne statystyki, wykresy
''' '''