even better version of 08

This commit is contained in:
Dominik Strzako 2021-05-16 15:19:28 +02:00
parent b2447b18df
commit 3955e7ac20
9 changed files with 32 additions and 7 deletions

View File

@ -14,13 +14,13 @@ import mlflow
with mlflow.start_run():
batch_param = 16 #int(sys.argv[1]) if len(sys.argv) > 1 else 16
epoch_param = 15 #int(sys.argv[2]) if len(sys.argv) > 2 else 15
batch_param = int(sys.argv[1]) if len(sys.argv) > 1 else 16
epoch_param = int(sys.argv[2]) if len(sys.argv) > 2 else 15
mlflow.log_param("batch_size", batch_param)
mlflow.log_param("epochs", epoch_param)
wine=pd.read_csv('train.csv')
wine=pd.read_csv('winequality-red.csv')
y = wine['quality']
x = wine.drop('quality', axis=1)
@ -44,6 +44,8 @@ with mlflow.start_run():
scale = StandardScaler()
scaled_x = scale.fit_transform(x)
x_train, x_test, y_train, y_test = train_test_split(scaled_x,yenc , test_size=0.2,train_size=0.8, random_state=21)
NeuralModel = Sequential([
Dense(128, activation='relu', input_shape=(14,)),
Dense(32, activation='relu'),
@ -57,13 +59,14 @@ with mlflow.start_run():
NeuralModel.compile(optimizer=rms, loss='binary_crossentropy', metrics=['accuracy'])
NeuralModel.fit(scaled_x, yenc, batch_size= batch_param, epochs = epoch_param) #verbose = 1
NeuralModel.fit(x_train, y_train, batch_size= batch_param, epochs = epoch_param) #verbose = 1
#TO TYLKO NA POTRZEBY ZADANIA
y_pred = NeuralModel.predict(scaled_x)
y_pred = NeuralModel.predict(x_test)
y_pred = np.around(y_pred, decimals=0)
results = accuracy_score(yenc,y_pred)
results = accuracy_score(y_test,y_pred)
print(f"accuracy: {results}")
mlflow.log_metric("Accuracy", results)

View File

@ -0,0 +1,15 @@
artifact_uri: file:///C:/Users/domstr2/Desktop/Git%20Repositories/ium_434788/mlruns/0/28466abc585446d78254527964ff8aaa/artifacts
end_time: 1621171137099
entry_point_name: ''
experiment_id: '0'
lifecycle_stage: active
name: ''
run_id: 28466abc585446d78254527964ff8aaa
run_uuid: 28466abc585446d78254527964ff8aaa
source_name: ''
source_type: 4
source_version: ''
start_time: 1621171134077
status: 3
tags: []
user_id: domstr2

View File

@ -0,0 +1 @@
1621171137096 1.0 0

View File

@ -0,0 +1 @@
16

View File

@ -0,0 +1 @@
16

View File

@ -0,0 +1 @@
b2447b18df29bc57f4a9ee2ac3f6d53a6f4f8ab8

View File

@ -0,0 +1 @@
Zadanie_08_MLflow.py

View File

@ -0,0 +1 @@
LOCAL

View File

@ -0,0 +1 @@
domstr2