mlflow save model
All checks were successful
s434765-training/pipeline/head This commit looks good
s434765-evaluation/pipeline/head This commit looks good

This commit is contained in:
Karolina Oparczyk 2021-05-22 17:10:35 +02:00
parent aa00dd0cbb
commit c0013fa129
2 changed files with 11 additions and 3 deletions

View File

@ -16,7 +16,7 @@ node {
} }
stage('Clone repo') { stage('Clone repo') {
/* try {*/ docker.image("karopa/ium:27").inside { /* try {*/ docker.image("karopa/ium:28").inside {
stage('Test') { stage('Test') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s434765/ium_434765']]]) checkout([$class: 'GitSCM', branches: [[name: '*/master']], 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_SELECTOR") copyArtifacts fingerprintArtifacts: true, projectName: 's434765-create-dataset', selector: buildParameter("BUILD_SELECTOR")

View File

@ -5,8 +5,8 @@ import numpy as np
from tensorflow import keras from tensorflow import keras
import sys import sys
import mlflow.sklearn import mlflow
import mlflow.models
import logging import logging
from evaluate_network import evaluate_model from evaluate_network import evaluate_model
@ -66,3 +66,11 @@ with mlflow.start_run() as run:
error = evaluate_model() error = evaluate_model()
mlflow.log_metric("rmse", error) mlflow.log_metric("rmse", error)
signature = mlflow.models.signature.infer_signature(X, model.predict(y))
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)
mlflow.keras.save_model(model, "model", signature=signature, input_example=X_test)