A custom prediction library with automated hyperparameter tuning, training utilities, exponential smoothing, and visualisation.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file custom_prediction_library-0.3.1.tar.gz.
File metadata
- Download URL: custom_prediction_library-0.3.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d24b6117056f4112f8bb0296c0fba218ae0dc216e0e70f322aacc0ae5a9f843
|
|
| MD5 |
dcd52d5029028dc7a71d0a192295a23d
|
|
| BLAKE2b-256 |
be111bc910d3a3b82cbedf130196e63b8d61426bc08ade2022e699d36776d04a
|
File details
Details for the file custom_prediction_library-0.3.1-py3-none-any.whl.
File metadata
- Download URL: custom_prediction_library-0.3.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3cff2cf574626031d85eacdaba8867163eec532d322b5c345314fe6d465754d
|
|
| MD5 |
857d0cd660735c5bbe3382d98580e247
|
|
| BLAKE2b-256 |
0641ff844b0a3fb1778093a629318c2c1a4fb67145c4fa1371df9f82206024c8
|