Registry / ai-ml / trainstation

trainstation

JSON →
library1.2pypypi✓ verified 84d ago

Trainstation is a lightweight Python library designed for convenient training and evaluation of linear models. It acts as a simplified wrapper around `scikit-learn`'s linear models, streamlining common workflows. As of version 1.2, it focuses on ease of use for basic linear regression tasks, offering a straightforward API. It has an active release cadence, with minor enhancements and bug fixes.

pip install trainstation
INSTALL
IMPORT
SIG · TRAINSTATION
T
trainstation
ai-mlpythonv1.2
Install
9.8s avg
Import
Disk
280MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 9.8s · import 0.000s · 270MB
280MB installed
● package 280MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CrossValidationEstimator
from trainstation import CrossValidationEstimator
from trainstation import LinearModel
EnsembleOptimizer
from trainstation import EnsembleOptimizer
Optimizer
from trainstation import Optimizer

This quickstart demonstrates how to initialize `LinearModel`, fit it to training data, make predictions, and evaluate its performance using `sklearn`'s `make_regression` dataset. It covers the core workflow for using `trainstation`.

from trainstation import LinearModel from sklearn.datasets import make_regression from sklearn.model_selection import train_test_split # Generate synthetic data X, y = make_regression(n_samples=1000, n_features=10, random_state=42) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) # Initialize and train the model model = LinearModel() model.fit(X_train, y_train) # Make predictions and evaluate predictions = model.predict(X_test) score = model.evaluate(X_test, y_test) print(f"Model score: {score:.4f}")
Debug
Known issues
gotchaAccessing underlying `scikit-learn` model attributes (e.g., `coef_`, `intercept_`) directly on the `LinearModel` instance will fail.
fix
Use `model.model.coef_` or `model.model.intercept_` to access attributes of the wrapped `sklearn` estimator. The `model.model` attribute provides direct access to the `sklearn` object.
affects: All versions up to 1.2
gotcha`trainstation` provides a simplified API and does not directly expose all advanced `scikit-learn` parameters or specific linear model types (e.g., Ridge, Lasso) by default. It's primarily a wrapper for `sklearn.linear_model.LinearRegression`.
fix
For fine-grained control, specific regularization, or other `sklearn.linear_model` classes, directly import and use the desired estimator from `scikit-learn`. You can also pass an `sklearn` model class to `LinearModel(model_class=...)`.
affects: All versions up to 1.2
gotchaData preprocessing steps like handling missing values (NaNs) or feature scaling (e.g., StandardScaler) are not automated by `trainstation`. Input data is expected to be clean and scaled if necessary.
fix
Ensure your input `X` and `y` data are preprocessed (e.g., using `numpy.nan_to_num` or `sklearn.preprocessing.StandardScaler` and `sklearn.impute.SimpleImputer`) before passing them to `model.fit()`.
affects: All versions up to 1.2
Upgrade
Version history
1.2latest on PyPI · released Jul 30, 2025
Audit
Dependencies
scikit-learnrequiredCore dependency for linear model implementations, required >=1.0.
numpyrequiredFundamental package for numerical operations and array handling.
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
trainstation — pip install trainstation · libregistry