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')