Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI AI Package Classifier

โปรเจกต์นี้ใช้ข้อมูลสถิติ PyPI AI packages มาสร้างโมเดล Machine Learning เพื่อทำนายว่า package นั้นเป็น LLM era package หรือเปล่า


โครงสร้างโปรเจกต์

├── data/
│   └── raw/
│       └── pypi_ai_packages.csv   ← ข้อมูลดิบ
├── src/
│   ├── data/
│   │   └── load_data.py           ← โหลดและ deduplicate ข้อมูล
│   ├── features/
│   │   └── build_features.py      ← เลือก features + normalize
│   ├── models/
│   │   └── train.py               ← train + evaluate โมเดล
│   └── utils/
│       └── visualize.py           ← plot Confusion Matrix + Feature Importance
├── main.py                        ← รันทั้งหมดจากที่เดียว
├── requirments.txt
└── Readme.md

ติดตั้ง

pip install -r requirments.txt

วิธีรัน

python main.py

ML Pipeline

CSV  →  load_data()  →  build_features()  →  train_model()  →  plot_results()
ขั้นตอน ไฟล์ ทำอะไร
Load load_data.py อ่าน CSV, เอา 1 row ต่อ package
Features build_features.py เลือก column + StandardScaler
Train train.py แบ่ง train/test, สอน RandomForest
Visualize visualize.py plot Confusion Matrix + Feature Importance

Features ที่ใช้ทำนาย

Feature ความหมาย
dependency_count จำนวน dependency ของ package
total_versions จำนวน version ที่เคย release
age_days อายุของ package (วัน)
avg_daily_downloads ค่าเฉลี่ย download ต่อวัน
total_downloads download ทั้งหมด
download_momentum_pct % การเติบโตของ download

โมเดลที่ใช้

Random Forest Classifier

  • สร้างต้นไม้ตัดสินใจ 100 ต้น แล้วโหวตผล
  • ทนต่อ outlier และ feature ที่ไม่ได้ scale เท่ากัน
  • คำนวณ Feature Importance ได้ทันที

ผลลัพธ์

  • Accuracy: 100% บน test set 60 packages
  • Feature ที่สำคัญที่สุด: age_days — package ยุค LLM จะอายุน้อยกว่าา

alt text


แนวคิด ML ที่ใช้

  • Classification — ทำนาย label (LLM era / Old era)
  • StandardScaler — Normalize ให้ทุก feature มี mean=0, std=1
  • train_test_split — แบ่ง 80/20 พร้อม stratify
  • Confusion Matrix — ดูว่าทำนายถูก/ผิดตรงไหน
  • Feature Importance — ดูว่า feature ไหนมีผลมากที่สุด

TestTraining-PyPI-AI-ML-Packages-Daily-Downloads-2025-2026-Dataset

About

Training ML skill

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages