Custom Prediction Library
A Python library for:
- Simplified model creation using Scikit-learn.
- Automated hyperparameter tuning with Optuna and Bayesian Optimization.
- Time series forecasting using Exponential Smoothing.
- Interactive visualisation with Bokeh.
Installation
Install via pip:
pip install custom_prediction_lib
Features
- Model Factory: Create classification and regression models with minimal setup.
- Hyperparameter Tuning: Includes GridSearch, RandomizedSearch, and advanced tuning with Optuna.
- Time Series: Exponential smoothing for forecasting.
- Visualisation: Interactive plots for predictions and forecasts.
Usage
Example 1: Model Factory
from custom_prediction_lib.model_creation import ModelFactory
# Create a Random Forest classifier
model = ModelFactory.create_model(
task="classification",
model_type="random_forest",
n_estimators=100
)
Example 2: Hyperparameter Tuning
from custom_prediction_lib.tuning import HyperparameterTuner
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import make_classification
X, y = make_classification(n_samples=500, n_features=10, random_state=42)
model = RandomForestClassifier(random_state=42)
param_distributions = {
"n_estimators": (50, 200),
"max_depth": (5, 20),
}
best_model, best_params = HyperparameterTuner.optuna_search(
model, X, y, param_distributions, n_trials=30, visualise=True
)
Example 3: Time Series Forecasting
from custom_prediction_lib.time_series import ExponentialSmoothingModel
# Example time series data
data = [100, 120, 130, 125, 135, 140, 145]
# Fit and forecast using exponential smoothing
model = ExponentialSmoothingModel(trend="add", seasonal="mul", seasonal_periods=4)
model.fit(data)
forecast = model.forecast(steps=3)
model.plot(data, forecast_steps=3)
License
This project is licensed under the MIT License.
Metadata
Release files for custom-prediction-library 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| custom_prediction_library-0.3.1.tar.gz | 4.6 kB | Without provenance | Details for custom_prediction_library-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| custom_prediction_library-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for custom_prediction_library-0.3.1-py3-none-any.whl |
Total release size: 10.7 kB
Release files / custom_prediction_library-0.3.1.tar.gz
| Download URL | custom_prediction_library-0.3.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d24b6117056f4112f8bb0296c0fba218ae0dc216e0e70f322aacc0ae5a9f843
|
|
BLAKE2b-256 checksum How to use checksums |
be111bc910d3a3b82cbedf130196e63b8d61426bc08ade2022e699d36776d04a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Release files / custom_prediction_library-0.3.1-py3-none-any.whl
| Download URL | custom_prediction_library-0.3.1-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3cff2cf574626031d85eacdaba8867163eec532d322b5c345314fe6d465754d
|
|
BLAKE2b-256 checksum How to use checksums |
0641ff844b0a3fb1778093a629318c2c1a4fb67145c4fa1371df9f82206024c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Security for custom-prediction-library 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.