From 101b46639c380bd70731b067a7dc8a2d7c3102f7 Mon Sep 17 00:00:00 2001 From: Jerzy Kwiatkowski Date: Thu, 22 Jun 2023 11:32:48 +0200 Subject: [PATCH] Zaktualizuj 'main.py' --- main.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index 31df1b7..1628f00 100644 --- a/main.py +++ b/main.py @@ -14,23 +14,17 @@ data_train = shuffled_data[:n] data_test = shuffled_data[n:] X_train = data_train.iloc[:, 1:-1].values -print(X_train) y_train = data_train.iloc[:, -1].values lab = preprocessing.LabelEncoder() y_transformed = lab.fit_transform(y_train) X_test = data_test.iloc[:, 1:-1].values -# y_test = data_test.iloc[:, 1:].values - -# svr = SVR() -# svr.fit(X_train, y_train) -# print(svr.score(X_train, y_train)) -# print(svr.score(X_test, y_test)) classifier = RandomForestClassifier() classifier.fit(X_train, y_transformed) y_pred = classifier.predict(X_test) for i, prediction in enumerate(y_pred): - print(f"Rekord {i+1}: collapse={prediction}") \ No newline at end of file + print(data_test.iloc[i, 0] + ": ") + print(prediction) \ No newline at end of file