even better version of 08
This commit is contained in:
parent
b2447b18df
commit
3955e7ac20
@ -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)
|
15
mlruns/0/28466abc585446d78254527964ff8aaa/meta.yaml
Normal file
15
mlruns/0/28466abc585446d78254527964ff8aaa/meta.yaml
Normal 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
|
@ -0,0 +1 @@
|
||||
1621171137096 1.0 0
|
@ -0,0 +1 @@
|
||||
16
|
1
mlruns/0/28466abc585446d78254527964ff8aaa/params/epochs
Normal file
1
mlruns/0/28466abc585446d78254527964ff8aaa/params/epochs
Normal file
@ -0,0 +1 @@
|
||||
16
|
@ -0,0 +1 @@
|
||||
b2447b18df29bc57f4a9ee2ac3f6d53a6f4f8ab8
|
@ -0,0 +1 @@
|
||||
Zadanie_08_MLflow.py
|
@ -0,0 +1 @@
|
||||
LOCAL
|
@ -0,0 +1 @@
|
||||
domstr2
|
Loading…
Reference in New Issue
Block a user