Загрузка страницы

Create A Neural Network That Classifies Diabetes Risk In 15 Lines of Python

Learn about neural network models, and build a neural network in 15 lines of Python with Keras to predict health risks.
Join the community on Discord: https://discordapp.com/invite/QZd3aaN
EDIT 1/13/2019 : Yo guys! I've made a few mistakes in my explanation here, and have the corrections and reasoning behind them at the bottom of the description, please check them out. Thanks as always for your support!

► 1:1 Mentorship: https://goo.gl/P3PgC2
► Subscribe To My New Artificial Intelligence Newsletter! https://goo.gl/qz1xeZ

Dataset: http://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/pima-indians-diabetes.data
About the Dataset: https://archive.ics.uci.edu/ml/datasets/pima+indians+diabetes
Keras Docs: https://keras.io/
Code: https://github.com/jg-fisher/diabetesNeuralNetwork

-- Highly recommended for theoretical and applied ML --
Deep Learning: https://amzn.to/2LomU4y
Hands on Machine Learning: https://amzn.to/2JSxhIv

Your invitation to our new Slack group: https://goo.gl/dbpgZR

Thanks for watching guys, hope you enjoyed. Be sure to leave any comments or questions below, and thumbs up and subscribe if you enjoyed this video!

___________________________________________________________________

IMPORTANT - I did not split the data into train and test segments. This is necessary in order to assess how well your model generalizes. The training set is the data that your models fits, or optimizes its parameters in order to approximate the mapping between the input vectors X and output (distribution of probabilities in this case Y). The test set data that the model has not seen, and is used to evaluate the performance of the model for its use.

In order to do this a function from the sklearn module can be used called train_test_split.

Add the following lines of code:

from sklearn.model_selection import train_test_split

# after X and Y have been read from the csv
x_train, y_train, x_test, y_test = train_test_split(X, Y, test_size=.5, random_state=5)

# change model.fit to the following
model.fit(x_train, y_train, epochs=1000, batch_size=10, validation_data=(x_test, y_test)

IMPORTANT - epochs are composed of batches, which are each subsets of the data distribution. Over the course of 1 epoch, each batch is forward propagated through the network to get the predictions, and backpropagation is applied to update the network parameters (weights and biases) given the loss, or how far off those predictions were from our targets Y.

Видео Create A Neural Network That Classifies Diabetes Risk In 15 Lines of Python канала John G. Fisher
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
20 января 2018 г. 15:31:29
00:22:59
Яндекс.Метрика