Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SPPAM
✓ import sppam
✗ from sppam import SPPAM
Train an SPPAM classifier on imbalanced synthetic data and evaluate AUC.
from sppam import SPPAM
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
X, y = make_classification(n_samples=200, weights=[0.9, 0.1], random_state=42)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
clf = SPPAM()
clf.fit(X_train, y_train)
score = clf.score(X_test, y_test)
print(f'AUC: {score:.3f}')
Debug
Known issues
gotchaThe SPPAM classifier expects binary labels in {0,1} or {-1,1}. Using continuous or multi-class labels will lead to errors or incorrect results.fixEnsure target is binary and properly encoded: y = (y == 1).astype(int) or use LabelEncoder.
affects: all
breakingVersion 0.1.0 changed the default hyperparameters (lambda_reg, learning_rate) from previous alpha releases. Older code relying on defaults may behave differently.fixExplicitly set parameters if migrating from earlier versions. Check release notes for defaults.
affects: <0.1.0 to 0.1.0+
gotchaThe fit() method does not shuffle the data automatically. If data is ordered, performance may degrade. Manual shuffling is recommended.fixShuffle data before calling fit: X, y = shuffle(X, y, random_state=0).
affects: all
Audit
Dependencies
numpyrequiredRequired for array operations and matrix computations.
scipyrequiredUsed for optimization routines and linear algebra.
scikit-learnoptionalProvides train-test split utilities and metric functions.