Skip to content

Vinylango25/Active-Learning-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Active Learning API (Django + CatBoost)

This is a Django-based backend for an Active Learning system using CatBoost. The system:

  • Queries the most informative instances for labeling.
  • Allows users to label instances via the frontend.
  • Trains a CatBoost model once enough labels are collected.

🚀 Features

  • Django REST API for querying & submitting labels
  • Active Learning for iterative model improvement
  • CatBoost Classifier for anomaly detection
  • SQLite Database for storing labeled/unlabeled data

🏗️ Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/yourusername/active-learning-backend.git
cd active-learning-backend

2️⃣ Set Up Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Apply Database Migrations

python manage.py migrate

5️⃣ Load Initial Data (If Needed)

python manage.py shell
exec(open('labeling/load_data.py').read())

6️⃣ Run the Server

python manage.py runserver

Access the API at: http://127.0.0.1:8000/

🔗 API Endpoints

Method Endpoint Description
GET /api/get_uncertain_instances/ Retrieve unlabeled instances
POST /api/submit_labels/ Submit labels for instances
POST /api/train_model/ Train the CatBoost model

📝 Notes

  • The API requires at least 10 labeled instances before training.
  • The trained CatBoost model is cached for future predictions.

📌 Author

Developed by Langat Vincent 🚀

📜 License

This project is licensed under the MIT License.


📤 Push to GitHub

git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/yourusername/active-learning-backend.git
git push -u origin main

Let me know if you need any modifications! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages