Добавили все файлы
This commit is contained in:
parent
32546cb5a3
commit
37171c7c64
4
.gitignore
vendored
4
.gitignore
vendored
@ -159,4 +159,6 @@ cython_debug/
|
||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
.idea
|
||||
.ipynb_checkpoints
|
||||
.venv
|
||||
|
||||
74
4lb/Untitled.ipynb
Normal file
74
4lb/Untitled.ipynb
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"id": "ffe61264-7fe9-49b2-b124-765ca3ebf76c",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
" precision recall f1-score support\n",
|
||||
"\n",
|
||||
" 0 1.00 1.00 1.00 12\n",
|
||||
" 1 1.00 0.86 0.92 7\n",
|
||||
" 2 0.92 1.00 0.96 11\n",
|
||||
"\n",
|
||||
" accuracy 0.97 30\n",
|
||||
" macro avg 0.97 0.95 0.96 30\n",
|
||||
"weighted avg 0.97 0.97 0.97 30\n",
|
||||
"\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from sklearn.datasets import load_iris\n",
|
||||
"from sklearn.model_selection import train_test_split\n",
|
||||
"from sklearn.neural_network import MLPClassifier\n",
|
||||
"from sklearn.metrics import classification_report\n",
|
||||
"\n",
|
||||
"# Загрузка и разбиение данных\n",
|
||||
"X, y = load_iris(return_X_y=True)\n",
|
||||
"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n",
|
||||
"\n",
|
||||
"# Модель MLP — многослойный перцептрон\n",
|
||||
"clf = MLPClassifier(hidden_layer_sizes=(10,), activation='relu', max_iter=2500)\n",
|
||||
"clf.fit(X_train, y_train)\n",
|
||||
"\n",
|
||||
"# Отчёт о точности\n",
|
||||
"print(classification_report(y_test, clf.predict(X_test)))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "ffb7a4d8-733b-4421-a91d-2cc73dc46b97",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.14.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
278
4lb/Untitled1.ipynb
Normal file
278
4lb/Untitled1.ipynb
Normal file
File diff suppressed because one or more lines are too long
143
4lb/Untitled2.ipynb
Normal file
143
4lb/Untitled2.ipynb
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user