diff --git a/Jenkins_eval b/Jenkins_eval new file mode 100644 index 0000000..4f29a84 --- /dev/null +++ b/Jenkins_eval @@ -0,0 +1,42 @@ +pipeline { + agent { + dockerfile true + } + parameters { + buildSelector(defaultSelector: lastSuccessful(), description: 'Use latest build training', name: 'BUILD_SELECTOR_TRAINING'), + gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'branchName', type: 'PT_BRANCH', + + } + stages { + stage("Copy artifacts"){ + steps { + copyArtifacts fingerprintArtifacts: true, projectName: 's434704-training/${params.branchName}', selector: buildParameter('BUILD_SELECTOR') + copyArtifacts fingerprintArtifacts: true, projectName: 's434704-evaluation', selector: buildParameter(lastSuccessful(), optional: true) + copyArtifacts fingerprintArtifacts: true, projectName: 's434704-create-dataset', selector: buildParameter(lastSuccessful()) + } + } + stage("Run evaluation"){ + steps { + sh "python3 evaluation.py" + } + } + stage('Archive single metrics') { + steps{ + archiveArtifacts 'single_metrics.txt' + } + } + stage('Save metrics to bulk file & create chart') { + steps{ + sh "if [ -f "single_metrics.txt" ]; "${env.BUILD_ID} ${cat single_metrics.txt}" >> bulk_metrics.txt fi" + archiveArtifacts 'bulk_metrics.txt' + sh "python3 create_chart.py" + archiveArtifacts 'chart.png' + } + } + } + post { + always { + mail body: "EVALUATION - ${currentBuild.currentResult}", subject: 's434704', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + } + } +} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 318dfcb..6c9f70a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,7 +28,7 @@ stages { post { success { build job: 's434704-training/master', parameters: [ - string(name: 'options', value: "-shuffle=true") + string(name: 'options', value: "verpose=0 epochs=100") ], wait: false } } diff --git a/Jenkinsfile_train b/Jenkinsfile_train index d835ce4..26b73c5 100644 --- a/Jenkinsfile_train +++ b/Jenkinsfile_train @@ -3,6 +3,7 @@ pipeline { dockerfile true } parameters { + gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH' string(name: 'options', description: 'Trainig script options') buildSelector(defaultSelector: lastSuccessful(), description: 'Use latest build', name: 'BUILD_SELECTOR') } @@ -25,7 +26,12 @@ pipeline { } post { always { - mail body: "${currentBuild.currentResult}", subject: 's434704', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + mail body: "TRAINING - ${currentBuild.currentResult}", subject: 's434704', to: '26ab8f35.uam.onmicrosoft.com@emea.teams.ms' + } + success { + build job: 's434704-evaluation/master', parameters: [ + string(name: 'branchName', value: "${params.BRANCH}") + ], wait: false } } } \ No newline at end of file diff --git a/create_chart.py b/create_chart.py new file mode 100644 index 0000000..6e9bfa3 --- /dev/null +++ b/create_chart.py @@ -0,0 +1,20 @@ +import sys +import os.path + +import matplotlib +from matplotlib import pyplot as plt + +x = [] +y = [] + +if os.path.exists('bulk_metrics.txt'): + with open('bulk_metrics.txt') as file: + for line in file.readlines(): + single_x, single_y = line.split(" ") + x.append(single_x) + y.append(single_y) + +plt.plot(x, y) +plt.xlabel('Jobs') +plt.ylabel('RMSE') +plt.savefig('chart.png') diff --git a/evaluation.py b/evaluation.py new file mode 100644 index 0000000..8e13373 --- /dev/null +++ b/evaluation.py @@ -0,0 +1,28 @@ +import sys +import pandas as pd +import numpy as np +import tensorflow as tf +import os.path + +from tensorflow import keras +from tensorflow.keras import layers +from tensorflow.keras.layers.experimental import preprocessing + +# Wczytanie danych +test_data = pd.read_csv("./MoviesOnStreamingPlatforms_updated.test") + +columns_to_use = ['Year', 'Runtime', 'Netflix'] +test_X = tf.convert_to_tensor(test_data[columns_to_use]) +test_Y = tf.convert_to_tensor(test_data[["IMDb"]]) + +model = tf.keras.models.load_model('linear_regression.h5') + +scores = model.evaluate(x=test_X, + y=test_Y) + +with open('single_metrics.txt', 'w') as file: + for idx, score in enumerate(scores): + if idx == 0: + file.write("Recall: " + str(score) + "\n") + if idx == 1: + file.write("RMSE: " + str(score) + "\n") diff --git a/linear_regression.h5 b/linear_regression.h5 new file mode 100644 index 0000000..e15841a Binary files /dev/null and b/linear_regression.h5 differ diff --git a/linear_regression/keras_metadata.pb b/linear_regression/keras_metadata.pb deleted file mode 100644 index a412059..0000000 --- a/linear_regression/keras_metadata.pb +++ /dev/null @@ -1,8 +0,0 @@ - -+root"_tf_keras_sequential*+{"name": "sequential", "trainable": true, "expects_training_arg": true, "dtype": "float32", "batch_input_shape": null, "must_restore_from_config": false, "class_name": "Sequential", "config": {"name": "sequential", "layers": [{"class_name": "InputLayer", "config": {"batch_input_shape": {"class_name": "__tuple__", "items": [null, 3]}, "dtype": "float32", "sparse": false, "ragged": false, "name": "input_1"}}, {"class_name": "Normalization", "config": {"name": "normalization", "trainable": true, "batch_input_shape": {"class_name": "__tuple__", "items": [null, 3]}, "dtype": "float32", "axis": {"class_name": "__tuple__", "items": [-1]}}}, {"class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 30, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 10, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "dtype": "float32", "units": 25, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Dense", "config": {"name": "dense_3", "trainable": true, "dtype": "float32", "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}]}, "shared_object_id": 14, "build_input_shape": {"class_name": "TensorShape", "items": [null, 3]}, "is_graph_network": true, "save_spec": {"class_name": "TypeSpec", "type_spec": "tf.TensorSpec", "serialized": [{"class_name": "TensorShape", "items": [null, 3]}, "float32", "input_1"]}, "keras_version": "2.5.0", "backend": "tensorflow", "model_config": {"class_name": "Sequential", "config": {"name": "sequential", "layers": [{"class_name": "InputLayer", "config": {"batch_input_shape": {"class_name": "__tuple__", "items": [null, 3]}, "dtype": "float32", "sparse": false, "ragged": false, "name": "input_1"}, "shared_object_id": 0}, {"class_name": "Normalization", "config": {"name": "normalization", "trainable": true, "batch_input_shape": {"class_name": "__tuple__", "items": [null, 3]}, "dtype": "float32", "axis": {"class_name": "__tuple__", "items": [-1]}}, "shared_object_id": 1}, {"class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 30, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 2}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 3}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 4}, {"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 10, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 5}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 6}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 7}, {"class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "dtype": "float32", "units": 25, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 8}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 9}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 10}, {"class_name": "Dense", "config": {"name": "dense_3", "trainable": true, "dtype": "float32", "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 11}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 12}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 13}]}}, "training_config": {"loss": "mean_absolute_error", "metrics": null, "weighted_metrics": null, "loss_weights": null, "optimizer_config": {"class_name": "Adam", "config": {"name": "Adam", "learning_rate": 0.0010000000474974513, "decay": 0.0, "beta_1": 0.8999999761581421, "beta_2": 0.9990000128746033, "epsilon": 1e-07, "amsgrad": false}}}}2 -root.layer_with_weights-0"_tf_keras_layer*{"name": "normalization", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": {"class_name": "__tuple__", "items": [null, 3]}, "stateful": true, "must_restore_from_config": true, "class_name": "Normalization", "config": {"name": "normalization", "trainable": true, "batch_input_shape": {"class_name": "__tuple__", "items": [null, 3]}, "dtype": "float32", "axis": {"class_name": "__tuple__", "items": [-1]}}, "shared_object_id": 1, "build_input_shape": [null, 3]}2 -root.layer_with_weights-1"_tf_keras_layer*{"name": "dense", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "Dense", "config": {"name": "dense", "trainable": true, "dtype": "float32", "units": 30, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 2}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 3}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 4, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 3}}, "shared_object_id": 15}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 3]}}2 -root.layer_with_weights-2"_tf_keras_layer*{"name": "dense_1", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "dtype": "float32", "units": 10, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 5}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 6}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 7, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 30}}, "shared_object_id": 16}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 30]}}2 -root.layer_with_weights-3"_tf_keras_layer*{"name": "dense_2", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "dtype": "float32", "units": 25, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 8}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 9}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 10, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 10}}, "shared_object_id": 17}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 10]}}2 -root.layer_with_weights-4"_tf_keras_layer*{"name": "dense_3", "trainable": true, "expects_training_arg": false, "dtype": "float32", "batch_input_shape": null, "stateful": false, "must_restore_from_config": false, "class_name": "Dense", "config": {"name": "dense_3", "trainable": true, "dtype": "float32", "units": 1, "activation": "linear", "use_bias": true, "kernel_initializer": {"class_name": "GlorotUniform", "config": {"seed": null}, "shared_object_id": 11}, "bias_initializer": {"class_name": "Zeros", "config": {}, "shared_object_id": 12}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}, "shared_object_id": 13, "input_spec": {"class_name": "InputSpec", "config": {"dtype": null, "shape": null, "ndim": null, "max_ndim": null, "min_ndim": 2, "axes": {"-1": 25}}, "shared_object_id": 18}, "build_input_shape": {"class_name": "TensorShape", "items": [null, 25]}}2 -Jroot.keras_api.metrics.0"_tf_keras_metric*{"class_name": "Mean", "name": "loss", "dtype": "float32", "config": {"name": "loss", "dtype": "float32"}, "shared_object_id": 19}2 \ No newline at end of file diff --git a/linear_regression/saved_model.pb b/linear_regression/saved_model.pb deleted file mode 100644 index 375bc46..0000000 Binary files a/linear_regression/saved_model.pb and /dev/null differ diff --git a/linear_regression/variables/variables.data-00000-of-00001 b/linear_regression/variables/variables.data-00000-of-00001 deleted file mode 100644 index 1de6d51..0000000 Binary files a/linear_regression/variables/variables.data-00000-of-00001 and /dev/null differ diff --git a/linear_regression/variables/variables.index b/linear_regression/variables/variables.index deleted file mode 100644 index b913306..0000000 Binary files a/linear_regression/variables/variables.index and /dev/null differ diff --git a/requirements.txt b/requirements.txt index 9c2f7b9..37bf8a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ astunparse==1.6.3 cachetools==4.2.1 certifi==2020.12.5 chardet==4.0.0 +cycler==0.10.0 flatbuffers==1.12 gast==0.4.0 google-auth==1.29.0 @@ -15,14 +16,18 @@ joblib==1.0.1 kaggle==1.5.12 keras-nightly==2.5.0.dev2021032900 Keras-Preprocessing==1.1.2 +kiwisolver==1.3.1 Markdown==3.3.4 +matplotlib==3.4.2 numpy==1.19.5 oauthlib==3.1.0 opt-einsum==3.3.0 pandas==1.2.4 +Pillow==8.2.0 protobuf==3.15.8 pyasn1==0.4.8 pyasn1-modules==0.2.8 +pyparsing==2.4.7 python-dateutil==2.8.1 python-slugify==4.0.1 pytz==2021.1 diff --git a/results.txt b/results.txt deleted file mode 100644 index 9a9dc10..0000000 --- a/results.txt +++ /dev/null @@ -1,331 +0,0 @@ -0.5936598 -0.5849244 -0.76666903 -0.67934513 -0.64723533 -0.70146203 -0.6212848 -0.69352806 -0.71430266 -0.6349592 -0.6037227 -0.62602526 -0.716088 -0.6527825 -0.61927134 -0.6208715 -0.5705818 -0.5874928 -0.6404664 -0.58791584 -0.67543894 -0.62167656 -0.6206067 -0.64806134 -0.5552458 -0.75341594 -0.6072247 -0.6813532 -0.58791584 -0.60726017 -0.6250376 -0.62341076 -0.5916721 -0.73439735 -0.70303845 -0.6799106 -0.6091962 -0.61927134 -0.8370657 -0.61847275 -0.62586755 -0.68109375 -0.5506313 -0.54138035 -0.59432256 -0.5910602 -0.5725273 -0.61110884 -0.6139354 -0.698549 -0.6325473 -0.6033801 -0.63960016 -0.6930497 -0.6141507 -0.690398 -0.6700437 -0.54408246 -0.54744244 -0.67295927 -0.5979732 -0.67771566 -0.6260898 -0.6237586 -0.6182915 -0.5431411 -0.6237045 -0.56352425 -0.5980723 -0.7263526 -0.61543685 -0.6306595 -0.6136954 -0.6077196 -0.54555225 -0.6265953 -0.6129655 -0.6964393 -0.5952996 -0.76597196 -0.612132 -0.7141346 -0.61887026 -0.62167656 -0.78501934 -0.5870993 -0.622163 -0.7269425 -0.6047483 -0.738512 -0.62428063 -0.5981832 -0.6053737 -0.57737106 -0.6236219 -0.66317254 -0.57937706 -0.7312876 -0.6494799 -0.63968897 -0.5651109 -0.6759594 -0.5775144 -0.5936598 -0.63960016 -0.58682525 -0.71019185 -0.56100094 -0.67674595 -0.6096024 -0.69002897 -0.6200595 -0.57937706 -0.7399035 -0.6408503 -0.6944639 -0.61505663 -0.65129274 -0.62243 -0.60202354 -0.58697325 -0.6366977 -0.6581801 -0.5887744 -0.64327353 -0.5775144 -0.600708 -0.7870045 -0.66495174 -0.73288137 -0.6411598 -0.5922716 -0.82116383 -0.6830768 -0.5775144 -0.5493086 -0.60465336 -0.71464497 -0.63086146 -0.8296491 -0.6182472 -0.5995659 -0.6235519 -0.55489665 -0.6356955 -0.57629323 -0.6342664 -0.64431417 -0.60523593 -0.65745866 -0.684063 -0.7090692 -0.551341 -0.6960265 -0.6134735 -0.6319828 -0.69399494 -0.6586382 -0.6184454 -0.579377 -0.5624325 -0.6291094 -0.5526188 -0.6200053 -0.67691404 -0.64806134 -0.71236795 -0.5982099 -0.7223163 -0.70254266 -0.5769756 -0.6886634 -0.5427406 -0.6079933 -0.69164056 -0.7077326 -0.719109 -0.66267097 -0.579265 -0.69516224 -0.5506313 -0.61759067 -0.62851924 -0.5809279 -0.7018177 -0.7282298 -0.6892376 -0.72701484 -0.5552458 -0.62603444 -0.6191902 -0.64947087 -0.5757011 -0.61934066 -0.6420203 -0.68608767 -0.6914434 -0.5648086 -0.5936598 -0.62404615 -0.58697325 -0.68826014 -0.5743765 -0.62311804 -0.5673747 -0.6645754 -0.6006698 -0.6139312 -0.605672 -0.61527056 -0.61543274 -0.6497899 -0.6445152 -0.6175213 -0.613054 -0.63025105 -0.66208804 -0.56561863 -0.60712475 -0.5769756 -0.6977379 -0.7078162 -0.6081246 -0.6097158 -0.6237586 -0.5988606 -0.6206067 -0.6527825 -0.66423184 -0.6055651 -0.6602301 -0.68199044 -0.5838982 -0.6191426 -0.5835939 -0.5699177 -0.59172297 -0.61360157 -0.5893885 -0.6019349 -0.6636439 -0.6308284 -0.61177546 -0.60210186 -0.6817741 -0.78398675 -0.6113895 -0.6719309 -0.600708 -0.7056101 -0.6404664 -0.57761484 -0.5705818 -0.64431417 -0.6320444 -0.7149821 -0.66350126 -0.6117868 -0.6053978 -0.65883034 -0.6160903 -0.62467444 -0.6141507 -0.56460583 -0.6075608 -0.71549106 -0.59031665 -0.5947179 -0.5578261 -0.68199044 -0.6732133 -0.58061934 -0.75385326 -0.63099474 -0.55258214 -0.6357683 -0.6386257 -0.6683411 -0.617758 -0.8129497 -0.6143774 -0.61251193 -0.67745715 -0.6147938 -0.7365375 -0.6236495 -0.6806918 -0.6894972 -0.6269105 -0.6205633 -0.66388756 -0.6088129 -0.6154119 -0.62330747 -0.62925434 -0.6778992 -0.5844303 -0.6399225 -0.6335639 -0.66535574 -0.54796815 -0.6119701 -0.61533546 -0.72435665 -0.69239396 -0.70170265 -0.6722494 -0.69742507 -0.6009209 -0.615307 -0.6636749 -0.5761081 -0.6136954 -0.57523835 -0.6359734 -0.60489464 -0.6540913 -0.7366513 -0.58649015 -0.6129386 -0.5581885 -0.6212848 -0.5769756 -0.61741394 -0.57121605 -0.6268614 -0.6249659 -0.6359734 -0.660387 -0.7373885 -0.7026211 diff --git a/training.py b/training.py index 2c722d6..1cf28f9 100644 --- a/training.py +++ b/training.py @@ -11,7 +11,9 @@ from tensorflow.keras.layers.experimental import preprocessing arguments = sys.argv[1:] -activation_func = [command.split('=')[1] for command in arguments if command.split('=')[0] == '--activation_func'] +verbose = [command.split('=')[1] for command in arguments if command.split('=')[0] == 'verbose'] +epochs = [command.split('=')[1] for command in arguments if command.split('=')[0] == 'epochs'] + pd.set_option("display.max_columns", None) @@ -32,15 +34,18 @@ else: model = keras.Sequential([ keras.Input(shape=(len(columns_to_use),)), normalizer, - layers.Dense(30, activation='relu' if len(activation_func) == 0 else activation_func[0]), - layers.Dense(10, activation='relu' if len(activation_func) == 0 else activation_func[0]), - layers.Dense(25, activation='relu' if len(activation_func) == 0 else activation_func[0]), + layers.Dense(30, activation='relu'), + layers.Dense(10, activation='relu'), + layers.Dense(25, activation='relu'), layers.Dense(1) ]) model.compile(loss='mean_absolute_error', - optimizer=tf.keras.optimizers.Adam(0.001)) + optimizer=tf.keras.optimizers.Adam(0.001), + metrics=[tf.keras.metrics.RootMeanSquaredError()]) - model.fit(train_X, train_Y, verbose=0, epochs=100) + verbose = 0 if len(verbose) == 0 else verbose[0] + epochs = 100 if len(epochs) == 0 else epochs[0] + model.fit(train_X, train_Y, verbose=verbose, epochs=epochs) - model.save('linear_regression') \ No newline at end of file + model.save('linear_regression.h5') \ No newline at end of file