Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
15 views2 pages

Numpy ML Project

This project demonstrates predicting student pass/fail outcomes using a rule-based model implemented with NumPy in Google Colab. It involves creating a dataset, calculating average marks, and classifying students as pass or fail based on a defined rule. The project also includes accuracy analysis of predictions against the actual outcomes.

Uploaded by

Uday Gumre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Numpy ML Project

This project demonstrates predicting student pass/fail outcomes using a rule-based model implemented with NumPy in Google Colab. It involves creating a dataset, calculating average marks, and classifying students as pass or fail based on a defined rule. The project also includes accuracy analysis of predictions against the actual outcomes.

Uploaded by

Uday Gumre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Machine Learning Project using NumPy in Google Colab

Project Overview

Project Title: Predict Student Pass/Fail Using Rule-Based Model

This project demonstrates how to use NumPy for a basic machine learning-like task in Google Colab.

The goal is to predict whether a student passes or fails based on their average marks in subjects.

This is done without any ML libraries-only using NumPy.

Steps covered in this project:

1. Import NumPy

2. Create a dataset using NumPy arrays

3. Calculate average marks

4. Use a rule to classify Pass/Fail

5. Make predictions and calculate accuracy

Complete Python Code

# Step 1: Import Libraries

import numpy as np

# Step 2: Create a Dataset

# Simulate dataset: rows = students, columns = [Maths, Science, English]

marks = np.array([

[65, 70, 72],

[45, 50, 40],

[90, 88, 95],

[30, 25, 40],

[55, 60, 58],

[80, 85, 82]

])
Machine Learning Project using NumPy in Google Colab

# Print dataset

print("Marks of students:\n", marks)

# Step 3: Define the Passing Rule

# Define passing rule: average >= 50

average_marks = np.mean(marks, axis=1)

print("\nAverage Marks:", average_marks)

# Rule-based label generation

# If avg >= 50, Pass (1), else Fail (0)

pass_fail = np.where(average_marks >= 50, 1, 0)

print("Pass/Fail Labels:", pass_fail)

# Step 4: Analyze Accuracy (Optional Manual Prediction)

# Example model prediction using a new rule: pass if Maths >= 50

predictions = np.where(marks[:, 0] >= 50, 1, 0)

# Check accuracy

accuracy = np.mean(predictions == pass_fail) * 100

print("Prediction Accuracy: ", accuracy, "%")

You might also like