Detect buggy vs clean Python code snippets using machine learning.
This project includes:
- 🧩 Dataset on Kaggle
- 🤖 Trained Model on Hugging Face
- 📓 Training Notebook for reproducibility
Kaggle Dataset:
👉 Python Code Snippets for Bug Detection
The dataset contains Python functions labeled as:
0→ Clean code1→ Buggy code
Hugging Face Model:
👉 jagritiS/python-bug-detector
You can load the model in Python:
import joblib
model = joblib.load("bug_detector_model.pkl")
vectorizer = joblib.load("bug_vectorizer.pkl")
code = "def divide(a,b): return a/b"
X = vectorizer.transform([code])
print(model.predict(X)) # Output: [0] or [1]Kaggle Notebook: 👉 Bug Detection Model using Python Code Snippets
The notebook demonstrates:
-
Data loading and visualization
-
Model training (Logistic Regression)
-
Evaluation metrics and confusion matrix
-
Python
-
Scikit-learn
-
Pandas
-
Matplotlib
-
Joblib
Jagriti Srivastava
⭐ If you like this project, please give it a star and follow my Kaggle profile!