mlflow save model
This commit is contained in:
parent
c68e8d94e6
commit
933d80f25e
29
JenkinsfileMLflow
Normal file
29
JenkinsfileMLflow
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
node {
|
||||||
|
stage('Preparation') {
|
||||||
|
|
||||||
|
properties([
|
||||||
|
parameters([
|
||||||
|
buildSelector(defaultSelector: lastSuccessful(),
|
||||||
|
description: 'Which build to use for copying artifacts',
|
||||||
|
name: 'BUILD_SELECTOR')
|
||||||
|
])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
stage('Clone repo') {
|
||||||
|
docker.image("karopa/ium:31").inside {
|
||||||
|
stage('Test') {
|
||||||
|
checkout([$class: 'GitSCM', branches: [[name: '*/mlflow']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s434765/ium_434765']]])
|
||||||
|
copyArtifacts fingerprintArtifacts: true, projectName: 's437622-training/master/', selector: buildParameter("BUILD_SELECTOR")
|
||||||
|
sh '''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
chmod 777 mlflow_partner.sh
|
||||||
|
rm -r model
|
||||||
|
./mlflow_partner.sh | tee output.txt
|
||||||
|
'''
|
||||||
|
archiveArtifacts 'output.txt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -16,7 +16,7 @@ node {
|
|||||||
|
|
||||||
}
|
}
|
||||||
stage('Clone repo') {
|
stage('Clone repo') {
|
||||||
/* try {*/ docker.image("karopa/ium:31").inside {
|
/* try {*/ docker.image("karopa/ium:32").inside {
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
checkout([$class: 'GitSCM', branches: [[name: '*/mlflow']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s434765/ium_434765']]])
|
checkout([$class: 'GitSCM', branches: [[name: '*/mlflow']], 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")
|
||||||
@ -25,7 +25,6 @@ node {
|
|||||||
chmod 777 neural_network.sh
|
chmod 777 neural_network.sh
|
||||||
rm -r model
|
rm -r model
|
||||||
./neural_network.sh $EPOCHS | tee output.txt
|
./neural_network.sh $EPOCHS | tee output.txt
|
||||||
mlflow run . -e main
|
|
||||||
'''
|
'''
|
||||||
archiveArtifacts 'output.txt'
|
archiveArtifacts 'output.txt'
|
||||||
archiveArtifacts 'model/**/*.*'
|
archiveArtifacts 'model/**/*.*'
|
||||||
|
4
mlflow_partner.py
Normal file
4
mlflow_partner.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
from mlflow import keras
|
||||||
|
|
||||||
|
model = keras.load_model('saved_model.pb')
|
||||||
|
predict = model.predict([13, 1, 1500, 1500])
|
@ -20,6 +20,7 @@ mlflow.set_experiment("s434765")
|
|||||||
warnings.filterwarnings("ignore")
|
warnings.filterwarnings("ignore")
|
||||||
np.random.seed(40)
|
np.random.seed(40)
|
||||||
|
|
||||||
|
|
||||||
def normalize_data(data):
|
def normalize_data(data):
|
||||||
return (data - np.min(data)) / (np.max(data) - np.min(data))
|
return (data - np.min(data)) / (np.max(data) - np.min(data))
|
||||||
|
|
||||||
@ -73,4 +74,7 @@ with mlflow.start_run() as run:
|
|||||||
"channel_title", "views", "likes", "dislikes",
|
"channel_title", "views", "likes", "dislikes",
|
||||||
"comment_count"]).dropna()
|
"comment_count"]).dropna()
|
||||||
X_test = data.loc[:, data.columns == "views"].astype(int)
|
X_test = data.loc[:, data.columns == "views"].astype(int)
|
||||||
mlflow.keras.save_model(model, "model", registered_model_name="model", signature=signature, input_example=X_test)
|
mlflow.keras.log_model(model, "youtube_model", registered_model_name="youtube_model", input_example=X_test,
|
||||||
|
signature=signature)
|
||||||
|
mlflow.keras.save_model(model, "youtube_model", registered_model_name="youtube_model", signature=signature,
|
||||||
|
input_example=X_test)
|
||||||
|
Loading…
Reference in New Issue
Block a user