Изменил(а) на 'labworks/LW4/readme.md'

main
ZheleznovAO 3 недель назад
Родитель 7ec90ec522
Сommit 726e16279d

@ -184,6 +184,7 @@ model.add(layers.Dense(1, activation='sigmoid'))
model.summary()
```
```
/usr/local/lib/python3.12/dist-packages/keras/src/layers/core/embedding.py:97: UserWarning: Argument `input_length` is deprecated. Just remove it.
warnings.warn(
/usr/local/lib/python3.12/dist-packages/keras/src/layers/core/embedding.py:100: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
@ -203,6 +204,7 @@ Model: "sequential"
Total params: 184,897 (722.25 KB)
Trainable params: 184,897 (722.25 KB)
Non-trainable params: 0 (0.00 B)
```
```python
# компилируем и обучаем модель
batch_size = 64
@ -242,6 +244,7 @@ y_pred = [1 if y_score[i,0]>=0.5 else 0 for i in range(len(y_score))]
from sklearn.metrics import classification_report
print(classification_report(y_test, y_pred, labels = [0, 1], target_names=['Negative', 'Positive']))
```
```
782/782 ━━━━━━━━━━━━━━━━━━━━ 8s 10ms/step
precision recall f1-score support
@ -251,6 +254,7 @@ print(classification_report(y_test, y_pred, labels = [0, 1], target_names=['Nega
accuracy 0.86 25000
macro avg 0.86 0.86 0.86 25000
weighted avg 0.86 0.86 0.86 25000
```
```python
#построение ROC-кривой и AUC ROC
from sklearn.metrics import roc_curve, auc

Загрузка…
Отмена
Сохранить