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
muslpy 3.10–3.910 runs
build_error
glibcpy 3.10–3.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.fixUse `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`.fixFor 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.fixEnsure 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.