Metadata-Version: 2.4
Name: seraml
Version: 1.0.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Summary: Machine learning library — Sera Framework (Rust core). Drop-in Scikit-learn replacement, 2–686× faster.
Keywords: machine-learning,rust,scikit-learn,gradient-boosting,random-forest,svm,clustering,pca
Author-email: feur25 <contact@seraplot.dev>
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Bug Tracker, https://github.com/feur25/sera/issues
Project-URL: Documentation, https://feur25.github.io/sera/ml/index.html
Project-URL: Homepage, https://feur25.github.io/sera/ml/index.html
Project-URL: Repository, https://github.com/feur25/sera

# SeraML

**Machine learning library built on the Sera Framework** — a low-level Rust core shared with SeraPlot and the upcoming SeraDFrame.

SeraML is a drop-in replacement for Scikit-learn, 2–686× faster, with a single `pip install` and zero C/Fortran dependencies.

```python
pip install seraml
```

## Quick example

```python
from seraml.linear_model import LinearRegression
from seraml.model_selection import train_test_split
from seraml.metrics import r2_score

X = [[1], [2], [3], [4], [5]]
y = [2.1, 4.0, 5.9, 8.1, 10.0]

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

model = LinearRegression()
model.fit(X_train, y_train)
score = r2_score(y_test, model.predict(X_test))
print(f"R² = {score:.4f}")
```

## Scikit-learn compatibility

SeraML mirrors the Scikit-learn API — `.fit()`, `.predict()`, `.transform()`, `.score()`. Pipelines work the same way.

## Submodules

| Module | Contents |
|---|---|
| `seraml.linear_model` | `LinearRegression`, `Ridge`, `Lasso`, `ElasticNet`, `LogisticRegression`, `SGDClassifier`, `SGDRegressor`, `RidgeClassifier` |
| `seraml.tree` | `DecisionTreeClassifier`, `DecisionTreeRegressor` |
| `seraml.ensemble` | `RandomForestClassifier`, `RandomForestRegressor`, `GradientBoostingClassifier`, `GradientBoostingRegressor`, `AdaBoostClassifier`, `AdaBoostRegressor` |
| `seraml.cluster` | `KMeans`, `DBSCAN` |
| `seraml.neighbors` | `KNeighborsClassifier`, `KNeighborsRegressor`, `NearestCentroid` |
| `seraml.naive_bayes` | `GaussianNB`, `MultinomialNB`, `BernoulliNB` |
| `seraml.svm` | `LinearSVC`, `LinearSVR` |
| `seraml.preprocessing` | `StandardScaler`, `MinMaxScaler`, `RobustScaler`, `MaxAbsScaler`, `Normalizer`, `LabelEncoder`, `OneHotEncoder`, `OrdinalEncoder`, `SimpleImputer`, `PolynomialFeatures`, `KBinsDiscretizer`, `PowerTransformer`, `QuantileTransformer` |
| `seraml.decomposition` | `PCA`, `TruncatedSVD` |
| `seraml.model_selection` | `GridSearchCV`, `RandomizedSearchCV`, `HalvingGridSearchCV`, `HalvingRandomSearchCV`, `StratifiedKFold`, `train_test_split`, `cross_val_score` |
| `seraml.metrics` | Full classification, regression, clustering metric suite |

## The Sera Framework

SeraML is one of three products built on **Sera** — a low-level Rust framework:

- **SeraPlot** — 60+ chart types, zero dependencies ([pypi.org/project/seraplot](https://pypi.org/project/seraplot))
- **SeraML** — drop-in Scikit-learn replacement (this package)
- **SeraDFrame** — Pandas/Polars alternative (Q4 2027)

The Rust core provides CPU/GPU optimisation, memory arenas, parallel threads (rayon), and a compile-time macro registry — natively inherited by every method.

## License

MIT

