Skip to Main Content
Машинное обучение с PyTorch и Scikit-Learn
book

Машинное обучение с PyTorch и Scikit-Learn

by Sebastian Raschka, Yuxi (Hayden) Liu, Vahid Mirjalili
May 2024
Beginner to intermediate content levelBeginner to intermediate
688 pages
26h
Russian
Foliant
Content preview from Машинное обучение с PyTorch и Scikit-Learn
394 Глава 12
Заметьте, что w
0
это смещение (точка пересечения оси y, что означает x
0
= 1). В ка-
честве более конкретного примера возьмем модель для двумерной точки данных x,
и пусть модель имеет следующие весовые коэффициенты, назначенные вектору w:
>>> import numpy as np
>>> X = np.array([1, 1.4, 2.5]) ## пер вое значение должно быть 1
>>> w = np.array([0.4, 0.3, 0.5])
>>> def net_input(X, w):
... return np.dot(X, w)
>>> def logistic(z):
... return 1.0 / (1.0 + np.exp(-z))
>>> def logistic_activation(X, w):
... z = net_input(X, w)
... return logistic(z)
>>> print(f'P(y=1|x) = {logistic_activation(X, w):.3f}')
P(y=1|x) = 0.888
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

CompTIA Network+ -- Vorbereitung auf die Prüfung N10-009

CompTIA Network+ -- Vorbereitung auf die Prüfung N10-009

Markus Kammermann

Publisher Resources

ISBN: 9786011100342