Skip to main content

Machine Learning lab programs for BCSL607 - NIE Mysuru (KNN, Linear/Polynomial Regression, Decision Tree, K-Means, Naive Bayes)

Project description

bcsl607_ml — Machine Learning Lab Library

Subject: BCSL607 — Machine Learning
Department: CS&E, National Institute of Engineering, Mysuru

A clean Python package containing all 7 lab programs, each importable and runnable independently.


📁 Folder Structure

bcsl607_ml/
├── __init__.py
└── labs/
    ├── __init__.py
    ├── lab1_knn_basic.py           # Lab 1 - KNN (k=3)
    ├── lab2_knn_multi_k.py         # Lab 2 - KNN (k=1,2,3,4,5,20,30)
    ├── lab3_linear_regression.py   # Lab 3 - Linear Regression
    ├── lab4_polynomial_regression.py # Lab 4 - Polynomial Regression
    ├── lab5_decision_tree.py       # Lab 5 - Decision Tree
    ├── lab6_kmeans_clustering.py   # Lab 6 - K-Means Clustering
    └── lab7_naive_bayes.py         # Lab 7 - Naive Bayes

⚡ Installation

No installation needed. Just place the bcsl607_ml/ folder in your project directory.

Install dependencies:

pip install numpy matplotlib scikit-learn pandas

🚀 Usage

Run a specific lab

from bcsl607_ml.labs import lab1_knn_basic
lab1_knn_basic.run()

Run all labs (except Lab 7)

import bcsl607_ml
bcsl607_ml.run_all()

Lab 7 — Naive Bayes (needs CSV)

from bcsl607_ml.labs import lab7_naive_bayes
lab7_naive_bayes.run("path/to/diabetes_data.csv")

Download dataset from: https://www.kaggle.com/datasets/himanshunakrani/naive-bayes-classificationdata


🧪 Lab Summary

Lab Topic Algorithm Dataset
1 KNN Basic KNeighborsClassifier (k=3) Random 100 points
2 KNN Multi-k KNeighborsClassifier Random 100 points
3 Linear Regression LinearRegression Synthetic
4 Polynomial Regression PolynomialFeatures + LR Synthetic
5 Decision Tree DecisionTreeClassifier Breast Cancer
6 K-Means Clustering KMeans + PCA Breast Cancer
7 Naive Bayes GaussianNB Diabetes CSV

📦 Dependencies

  • numpy
  • matplotlib
  • scikit-learn
  • pandas

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bcsl607_ml-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bcsl607_ml-1.0.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file bcsl607_ml-1.0.0.tar.gz.

File metadata

  • Download URL: bcsl607_ml-1.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for bcsl607_ml-1.0.0.tar.gz
Algorithm Hash digest
SHA256 357df978e934b31985aa457514eaab23cfa7e46724b8e4c3e968c8e414cf17cf
MD5 685a0f361349b159db6a4be95413b900
BLAKE2b-256 b3f789c12b38dbc16da710fe02ff4ef1a57c0ab64db3584d9e18d01052457e68

See more details on using hashes here.

File details

Details for the file bcsl607_ml-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bcsl607_ml-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for bcsl607_ml-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c42afe11f69b78a6a6a196385a8be8da67d59d890a1791f996be634a6c6250b
MD5 a90c40f6ada64854da670e66e0916059
BLAKE2b-256 96aa137b74b5ef8d79053ae59886d51a62ad77bd3b978804023e45ce45121bbb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page