You are on page 1of 2

ML High Scorer Assignment: Basic Implementation of a Neural Network in Python

Objective: To implement a simple feedforward neural network for a binary classification task
using Python and NumPy.
Instructions:
1. Data Generation:
Generate synthetic data for a binary classification task. You can use libraries like NumPy to
create random data points.
Create two features (X1 and X2) and a binary target variable (y) based on some logical or
mathematical conditions. Ensure that the data is separable for a binary classification task.
2. Data Splitting:
Split the generated data into training and testing sets. Use an 80-20 split ratio (80% for
training, 20% for testing).
3. Neural Network Implementation:
• Implement a basic feedforward neural network using NumPy.
• The neural network should have the following components:
• Input layer with the appropriate number of input features.
• One hidden layer with at least 2 neurons and a ReLU activation function.
• Output layer with a sigmoid activation function for binary classification.
• Use random initialization for the weights and biases of the neural network.
4. Training:
• Train the neural network using the training data. You can use gradient descent or any
other optimization algorithm of your choice.
• Implement the forward and backward propagation steps for training.
• Monitor the training loss and accuracy during training.
5. Testing and Evaluation:
• Use the trained neural network to make predictions on the testing data.
• Calculate and report the accuracy, precision, recall, and F1-score for the classification
task.
6. Visualization (Optional):
If you're comfortable with visualization libraries like Matplotlib, you can visualize the
decision boundary created by your trained neural network.
7. Documentation:
Provide clear documentation of your code, including comments explaining each section of
the code.
Write a brief report summarizing the results, the performance of your neural network, and
any insights you gained from the assignment.
8. Submission:
• Submit your Python code along with the synthetic data you generated.
• Include the report summarizing your findings and results.
9. Grading:
Your assignment will be graded based on the completeness of the implementation, the
accuracy of your neural network, the quality of the documentation, and the clarity of the
report.
Note: You can use libraries like NumPy for array operations, but do not use deep learning
frameworks like TensorFlow or PyTorch for this basic implementation. The goal is to
understand the core concepts of neural networks.

You might also like