Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Evaluating the Perceptron | Neural Network from Scratch
Introduction to Neural Networks
course content

Conteúdo do Curso

Introduction to Neural Networks

Introduction to Neural Networks

1. Concept of Neural Network
2. Neural Network from Scratch
3. Conclusion

book
Challenge: Evaluating the Perceptron

To evaluate the previously created perceptron, you will use a dataset containing two input features and two distinct classes (0 and 1):

This dataset is balanced, with 500 samples from class 1 and 500 samples from class 0. Therefore, accuracy is a sufficient metric for evaluation in this case, which can be calculated using the accuracy_score() function:

y_true represents the actual labels, while y_pred represents the predicted labels.

The dataset is stored in perceptron.py as two NumPy arrays: X (input features) and y (corresponding labels), so they will be simply imported. This file also contains model, which is the instance of the Perceptron class you previously created.

Tarefa

Swipe to start coding

Obtain predictions from the trained model and evaluate its performance:

  1. Split the dataset into training (80%) and testing (20%) sets.
  2. Train the model for 10 epochs with a learning rate of 0.01.
  3. Obtain predictions for all examples in the test set.
  4. Calculate the accuracy by comparing the predicted labels with the actual test labels.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 12
toggle bottom row

book
Challenge: Evaluating the Perceptron

To evaluate the previously created perceptron, you will use a dataset containing two input features and two distinct classes (0 and 1):

This dataset is balanced, with 500 samples from class 1 and 500 samples from class 0. Therefore, accuracy is a sufficient metric for evaluation in this case, which can be calculated using the accuracy_score() function:

y_true represents the actual labels, while y_pred represents the predicted labels.

The dataset is stored in perceptron.py as two NumPy arrays: X (input features) and y (corresponding labels), so they will be simply imported. This file also contains model, which is the instance of the Perceptron class you previously created.

Tarefa

Swipe to start coding

Obtain predictions from the trained model and evaluate its performance:

  1. Split the dataset into training (80%) and testing (20%) sets.
  2. Train the model for 10 epochs with a learning rate of 0.01.
  3. Obtain predictions for all examples in the test set.
  4. Calculate the accuracy by comparing the predicted labels with the actual test labels.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 12
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt