From fece83fa1a4b09aa3b06a5bea598fcce705136df Mon Sep 17 00:00:00 2001
From: Ctrl-Tim <73001228+Ctrl-Tim@users.noreply.github.com>
Date: Sun, 10 Dec 2023 15:35:33 +0400
Subject: [PATCH] commit 2
---
.idea/workspace.xml | 101 ++++++++++++++++++++++++++--------
istyukov_timofey_lab1/lab1.py | 20 ++-----
2 files changed, 84 insertions(+), 37 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5f23f7a..4bd0d1c 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,9 @@
-
-
-
+
+
@@ -43,29 +42,50 @@
- {
- "keyToString": {
- "RunOnceActivity.OpenProjectViewOnStart": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "WebServerToolWindowFactoryState": "false",
- "git-widget-placeholder": "senkin__alexander__lab__1",
- "last_opened_file_path": "D:/ulstukek/Course4/IIS/labs",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "reference.settings.ide.settings.new.ui",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -132,13 +152,19 @@
+
+
+
+
+
+
+
-
@@ -153,6 +179,14 @@
+
+ 1702203771661
+
+
+
+ 1702203771661
+
+
@@ -173,6 +207,13 @@
+
+
+
+
+
+
+
@@ -180,8 +221,24 @@
+
+
+
+
+
+
+
-
-
+
+
+
\ No newline at end of file
diff --git a/istyukov_timofey_lab1/lab1.py b/istyukov_timofey_lab1/lab1.py
index d9c7f23..9c00a83 100644
--- a/istyukov_timofey_lab1/lab1.py
+++ b/istyukov_timofey_lab1/lab1.py
@@ -9,12 +9,11 @@
import numpy as np
from sklearn.datasets import make_classification
from sklearn.linear_model import LinearRegression, Perceptron, Ridge
-from matplotlib import pyplot as plt
-from matplotlib.colors import ListedColormap
from sklearn.model_selection import train_test_split
-from sklearn.metrics import mean_absolute_error, mean_squared_error, accuracy_score, balanced_accuracy_score
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import PolynomialFeatures
+from matplotlib import pyplot as plt
+from matplotlib.colors import ListedColormap
@@ -48,10 +47,7 @@ def my_linear_regression(X_train, X_test, y_train, y_test):
# вывод в консоль
print()
print('===> Линейная регрессия <===')
- print('Оценка точности:')
- print('MAE:', mean_absolute_error(y_test, y_pred))
- print('MSE:', mean_squared_error(y_test, y_pred))
- print()
+ print('Оценка точности: ', lin_reg_model.score(X_train, y_train))
# вывод в график
plt.title('Линейная регрессия')
@@ -71,10 +67,7 @@ def my_perceptron(X_train, X_test, y_train, y_test):
# вывод в консоль
print()
print('===> Персептрон <===')
- print('Оценка точности:')
- print('По тренировочным данным: ', perceptron_model.score(X_train, y_train))
- print('По тестовым данным: ', accuracy_score(y_test, y_pred))
- print()
+ print('Оценка точности: ', perceptron_model.score(X_train, y_train))
# вывод в график
plt.title('Персептрон')
@@ -94,10 +87,7 @@ def my_poly_ridge(X_train, X_test, y_train, y_test):
# вывод в консоль
print()
print('===> Гребневая полиномиальная регрессия <===')
- print('Оценка точности:')
- print('MAE:', mean_absolute_error(y_test, y_pred))
- print('MSE:', mean_squared_error(y_test, y_pred))
- print()
+ print('Оценка точности: ', poly_rige_model.score(X_train, y_train))
# вывод в график
plt.title('Гребневая полиномиальная регрессия')