From 8251db9abf5efb7aaa863ad16034602f35abefe0 Mon Sep 17 00:00:00 2001 From: Karolina Oparczyk Date: Thu, 20 May 2021 19:50:46 +0200 Subject: [PATCH] trigger other projects --- Dockerfile | 1 + JenkinsfileEval | 2 +- evaluate_network.py | 19 ++++++++++++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e852858..2602a7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ RUN pip3 install pandas RUN pip3 install kaggle RUN pip3 install tensorflow RUN pip3 install sklearn +RUN pip3 install matplotlib COPY ./data_dev ./ COPY ./evaluate_network.py ./ RUN mkdir /.kaggle diff --git a/JenkinsfileEval b/JenkinsfileEval index 88e7477..45225ce 100644 --- a/JenkinsfileEval +++ b/JenkinsfileEval @@ -19,7 +19,7 @@ node { } stage('Clone repo') { - docker.image("karopa/ium:16").inside { + docker.image("karopa/ium:20").inside { stage('Test') { checkout([$class: 'GitSCM', branches: [[name: '*/evaluation']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s434765/ium_434765']]]) copyArtifacts fingerprintArtifacts: true, projectName: 's434765-create-dataset', selector: buildParameter("BUILD_DATASET") diff --git a/evaluate_network.py b/evaluate_network.py index 782408a..e2cd8f0 100644 --- a/evaluate_network.py +++ b/evaluate_network.py @@ -2,15 +2,16 @@ import pandas as pd import numpy as np from sklearn.metrics import mean_squared_error from tensorflow import keras +import matplotlib.pyplot as plt model = keras.models.load_model('model') data = pd.read_csv("data_dev", sep=',', error_bad_lines=False, skip_blank_lines=True, nrows=527, names=["video_id", "last_trending_date", - "publish_date", "publish_hour", "category_id", - "channel_title", "views", "likes", "dislikes", - "comment_count"]).dropna() -X_test = data.loc[:,data.columns == "views"].astype(int) -y_test = data.loc[:,data.columns == "likes"].astype(int) + "publish_date", "publish_hour", "category_id", + "channel_title", "views", "likes", "dislikes", + "comment_count"]).dropna() +X_test = data.loc[:, data.columns == "views"].astype(int) +y_test = data.loc[:, data.columns == "likes"].astype(int) min_val_sub = np.min(X_test) max_val_sub = np.max(X_test) @@ -39,3 +40,11 @@ print(error) with open("rmse.txt", "a") as file: file.write(str(error) + "\n") + +with open("rmse.txt", "r") as file: + lines = file.readlines() + plt.plot(range(len(lines)), [line[:-2] for line in lines]) + plt.tight_layout() + plt.ylabel('RMSE') + plt.xlabel('evaluation no') + plt.savefig('evaluation.png')