.
Some checks failed
s434784-evaluation/pipeline/head There was a failure building this commit
s434784-training/pipeline/head This commit looks good

This commit is contained in:
Maciej Sobkowiak 2021-05-16 22:10:37 +02:00
parent 3f38290d0b
commit 7d0bc87876
3 changed files with 20 additions and 16 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
__pycache__
.ipynb_checkpoints
suicide_model.h5
test.csv
train.csv
validate.csv

View File

@ -1,5 +1,7 @@
pipeline {
agent any;
agent {
dockerfile true
}
parameters{
buildSelector(
defaultSelector: lastSuccessful(),

View File

@ -5,22 +5,21 @@ import matplotlib.pyplot as plt
from keras import backend as K
from sklearn.metrics import mean_squared_error
model = 'suicide_model.h5'
model = keras.models.load_model(model)
model = keras.models.load_model('suicide_model.h5')
train = pd.read_csv('train.csv')
test = pd.read_csv('test.csv')
validate = pd.read_csv('validate.csv')
# train = pd.read_csv('train.csv')
# test = pd.read_csv('test.csv')
# validate = pd.read_csv('validate.csv')
# podział train set
X_train = train.loc[:, train.columns != 'suicides_no']
y_train = train[['suicides_no']]
X_test = test.loc[:, train.columns != 'suicides_no']
y_test = test[['suicides_no']]
# # podział train set
# X_train = train.loc[:, train.columns != 'suicides_no']
# y_train = train[['suicides_no']]
# X_test = test.loc[:, train.columns != 'suicides_no']
# y_test = test[['suicides_no']]
predictions = model.predict(X_test)
# predictions = model.predict(X_test)
error = mean_squared_error(y_test, predictions)
# error = mean_squared_error(y_test, predictions)
with open('eval_results.txt', 'a') as f:
f.write(str(error) + "\n")
# with open('eval_results.txt', 'a') as f:
# f.write(str(error) + "\n")