Skip to main content

Pure Kernel Regression: noise-free, explainable tabular regression via high-purity feature windows

Project description

PKR‑Regression

Ultra‑light, transparent and noise‑proof regression library


🚀 Why PKR‑Regression?

Pain Point Classic ML PKR
Hyper‑parameters ❌ Yes ✅ No (3‑4 flags)
Black‑box outputs ❌ Yes ✅ Rule‑based explanation
Sensitive to noise ✅ Middle zone muted by median
Training time Long / tuning Seconds

In short: “Keep the crystal‑clear signal, ignore the rest.”


🔍 4‑Step Method

  1. Pole Labeling
    Sort target y.
    • Bottom 33 % → label 0
    • Top 33 % → label 1
  2. Cell Scanning
    Build tiny cells for every 1‑, 2‑, 3‑feature combo (fixed width / exact category).
  3. Valuable Kernel Selection
    • ≥ 90 % same label
    • ≥ 10 rows
      ⇒ kernel value = mean of that cell.
  4. Prediction
    • Test row hits ≥1 valuable kernel → average(kernel_values)
    • Hits none → global median.

Optional flags: --bins 5 (five quantiles), --max-dim 1/2/3, --gpu for fast parallel scan.


⚡ Quick Start

pip install pkr-regression

pkr \
  --train train.csv \
  --test  test.csv \
  --target Listening_Time_minutes \
  --output submission.csv

Outputs: submission.csv (Kaggle‑ready) + kernels.txt (selected cells)


📊 Kernel Example

Kernel Rule Prediction
Podcast = Comedy Corner & Length 0‑0.5 6.4 min
Podcast = Innovators & Length 0.5‑1.0 91.7 min

A test row intersecting the first rule returns 6.4; the second rule → 91.7.


💡 FAQ

Q: Overfitting risk?
A: No – noisy cells (< 90 % majority or < 10 rows) are discarded automatically.

Q: Big data?
A: 1M+ rows train in minutes on one core; --gpu accelerates further.


Make your model explainable with PKR‑Regression — try it & share feedback!

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pk_regression-0.0.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pk_regression-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pk_regression-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for pk_regression-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be191ad54a4508738c1f33dfb642c3d611024f7ae7b824ae2f28bf931436b44e
MD5 9cabf475ac301d6ba4321db0ed968bfd
BLAKE2b-256 128101cbb8687aa40639cac4da0393991c808d79a9fb38356becde8a7d006da8

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