archive model
This commit is contained in:
parent
fb163e5653
commit
7743059eb6
2
.gitignore
vendored
2
.gitignore
vendored
@ -65,4 +65,4 @@ dev.csv
|
||||
.venv/
|
||||
model.h5
|
||||
evaluation.png
|
||||
mlruns/*
|
||||
mlruns*
|
@ -10,3 +10,4 @@ COPY ["Zadanie 1.py", "."]
|
||||
COPY ["stats.py", "."]
|
||||
COPY ["train.py", "."]
|
||||
COPY ["evaluate.py", "."]
|
||||
COPY ["MLProject", "."]
|
@ -1,6 +1,6 @@
|
||||
pipeline {
|
||||
agent {
|
||||
docker { image 'adnovac/ium_s434760:1.2' }
|
||||
docker { image 'adnovac/ium_s434760:3' }
|
||||
}
|
||||
parameters{
|
||||
buildSelector(
|
||||
@ -39,6 +39,7 @@ pipeline {
|
||||
stage('archive artifacts') {
|
||||
steps {
|
||||
archiveArtifacts 'model.h5'
|
||||
archiveArtifacts 'fifa_overall/**/*'
|
||||
}
|
||||
}
|
||||
stage('send email') {
|
||||
|
10
MLProject
10
MLProject
@ -1,11 +1,11 @@
|
||||
name: Fifa Players
|
||||
name: fifa_players
|
||||
|
||||
docker_env:
|
||||
image: docker.io/adnovac/ium_s434760:2.0
|
||||
image: adnovac/ium_s434760
|
||||
|
||||
entry_points:
|
||||
train:
|
||||
parameters:
|
||||
batch_size: {type: int, default: 15}
|
||||
epochs: {type: int, default: 16}
|
||||
command: "python train.py {batch_size} {epochs}"
|
||||
evaluate:
|
||||
command: "python evaluate.py"
|
||||
command: "python3.8 train.py {batch_size} {epochs}"
|
20
fifa_overall/MLmodel
Normal file
20
fifa_overall/MLmodel
Normal file
@ -0,0 +1,20 @@
|
||||
flavors:
|
||||
keras:
|
||||
data: data
|
||||
keras_module: tensorflow.keras
|
||||
keras_version: 2.4.0
|
||||
save_format: tf
|
||||
python_function:
|
||||
data: data
|
||||
env: conda.yaml
|
||||
loader_module: mlflow.keras
|
||||
python_version: 3.8.10
|
||||
saved_input_example_info:
|
||||
artifact_path: input_example.json
|
||||
pandas_orient: split
|
||||
type: dataframe
|
||||
signature:
|
||||
inputs: '[{"type": "tensor", "tensor-spec": {"dtype": "float64", "shape": [-1, 4]}}]'
|
||||
outputs: '[{"type": "tensor", "tensor-spec": {"dtype": "float32", "shape": [-1,
|
||||
1]}}]'
|
||||
utc_time_created: '2021-05-23 19:48:30.385262'
|
10
fifa_overall/conda.yaml
Normal file
10
fifa_overall/conda.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
channels:
|
||||
- defaults
|
||||
- conda-forge
|
||||
dependencies:
|
||||
- python=3.8.10
|
||||
- pip
|
||||
- pip:
|
||||
- mlflow
|
||||
- tensorflow==2.4.1
|
||||
name: mlflow-env
|
BIN
fifa_overall/data/model/saved_model.pb
Normal file
BIN
fifa_overall/data/model/saved_model.pb
Normal file
Binary file not shown.
BIN
fifa_overall/data/model/variables/variables.data-00000-of-00001
Normal file
BIN
fifa_overall/data/model/variables/variables.data-00000-of-00001
Normal file
Binary file not shown.
BIN
fifa_overall/data/model/variables/variables.index
Normal file
BIN
fifa_overall/data/model/variables/variables.index
Normal file
Binary file not shown.
1
fifa_overall/input_example.json
Normal file
1
fifa_overall/input_example.json
Normal file
@ -0,0 +1 @@
|
||||
{"columns": ["Age", "Nationality", "Position", "Club"], "data": [[0.38, 0.175, 1, 0.91846154]]}
|
9
train.py
9
train.py
@ -37,5 +37,12 @@ history = model.fit(
|
||||
batch_size=batch_size,
|
||||
epochs=epochs,
|
||||
)
|
||||
|
||||
model.save(model_name)
|
||||
signature = mlflow.models.signature.infer_signature(X, model.predict(X))
|
||||
input_example = {
|
||||
"Age": 0.38,
|
||||
"Nationality": 0.175,
|
||||
"Position": 1,
|
||||
"Club" :0.91846154
|
||||
}
|
||||
mlflow.keras.save_model(model, "fifa_overall", signature=signature, input_example = input_example)
|
Loading…
Reference in New Issue
Block a user