diff --git a/Jenkinsfile_evaluation b/Jenkinsfile_evaluation new file mode 100644 index 0000000..114f1a8 --- /dev/null +++ b/Jenkinsfile_evaluation @@ -0,0 +1,42 @@ +pipeline { + agent { + dockerfile true + } + parameters{ + buildSelector( + defaultSelector: lastSuccessful(), + description: 'Which build to use for copying artifacts', + name: 'WHICH_BUILD_DATA' + ) + buildSelector( + defaultSelector: lastSuccessful(), + description: 'Which build to use for copying artifacts', + name: 'WHICH_BUILD_TRAIN' + ) + } + stages { + stage('checkout') { + steps { + copyArtifacts fingerprintArtifacts: true, projectName: 's430705-create-dataset', selector: buildParameter('WHICH_BUILD_DATA') + } + } + stage('Docker'){ + steps{ + copyArtifacts fingerprintArtifacts: true, projectName: 's430705-training/master', selector: buildParameter('WHICH_BUILD_TRAIN') + sh 'python3 "./lab06-eval.py" >> eval.txt' + } + } + stage('archiveArtifacts') { + steps { + archiveArtifacts 'eval.txt' + } + } + stage('sendMail') { + steps{ + emailext body: currentBuild.result ?: 'SUCCESS EVALUATION', + subject: 's430705 evaluation', + to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + } + } + } +} \ No newline at end of file diff --git a/lab06-eval.py b/lab06-eval.py new file mode 100644 index 0000000..5931f2f --- /dev/null +++ b/lab06-eval.py @@ -0,0 +1,22 @@ +from tensorflow.keras.models import Sequential +from tensorflow.keras.layers import Dense +from tensorflow.keras.optimizers import Adam +from tensorflow.keras.layers import Dropout +from tensorflow.keras.callbacks import EarlyStopping +from sklearn.metrics import mean_squared_error, mean_absolute_error, accuracy_score +from tensorflow.keras.models import load_model +import pandas as pd + +test_df = pd.read_csv('test.csv') +test_df.drop(test_df.columns[0], axis=1, inplace=True) +x_test = test_df.drop("rating", axis=1) +y_test = test_df["rating"] + +model = Sequential() +model = load_model('model_movies') + +y_pred = model.predict(x_test.values) + +rmse = mean_squared_error(y_test, y_pred) + +print(f"RMSE: {rmse}")