ExpKit
ExpKit is a flexible experiment management framework for machine learning projects, providing easy storage, retrieval, and evaluation of experimental results.
Features
- Multiple storage backends (Disk, Zip, Memory, Mongo)
- Caching support with ROCache
- Flexible metadata management
- Batch processing of inputs/outputs
- Evaluation metrics computation
- Query interface for experiment retrieval
Installation
pip install expkit-core
Quick Start
Creating an Experiment
from expkit import Exp, DiskStorage
# Configure experiment metadata
meta = {
"steps": 1000,
"temperature": 0.7,
"n": 5,
"model_path": "path/to/model",
"batch_size": 32,
}
# Create experiment with disk storage
experiment = Exp(
storage=DiskStorage(save_path, "rw"),
meta=meta
)
Adding Data
# Add input/output instances
experiment.add_instances(
inputs=["input1", "input2", "input3"],
outputs=["output1", "output2", "output3"]
)
# Add evaluation scores
experiment.add_eval("accuracy", [0.85, 0.92, 0.88])
Loading and Querying Experiments
from expkit import ZipStorage, ExpSetup
# Initialize storage
storage = ZipStorage(base_dir="path/to/outputs", mode="r")
# Create experiment setup
setup = ExpSetup(storage=storage)
# Query experiments
results = setup.query({
"split":"test",
})
Working with Results
# Access experiment metadata
model_path = exp.get("model_path")
# Get instances
data = exp.instances()
# Get evaluation results
values = exp.get_eval(key)
Storage Backends
ExpKit supports multiple storage backends:
- DiskStorage: Stores experiments as files on disk
- ZipStorage: Stores experiments in zip archives
- MongoStorage: Stores experiments in mongo server
- MemoryStorage: Keeps experiments in memory
- ROCache: Caching layer that can wrap other storage backends
Evaluation Operations
You can define custom evaluation operations:
setup = ExpSetup(
storage=storage,
ops={
"mean-reward-1": EvalTotalMean(
entry_key="scores",
eval_key=eval_key,
n=1
)
}
)
# Run evaluation operations
setup.run_ops()
# Access results
first_exp_reward = setup[0].get("mean-reward-1")
# Transform experiments
mapped_results = setup.map(lambda exp: {
"reward": exp.get("mean-reward-1"),
"model": exp.get("model_path")
})
# Filter experiments
filtered = setup.filter(lambda exp: exp.get("temperature") > 0.5)
# Sort experiments
sorted_exps = setup.sort("temperature") # ascending order
Contributing
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
Metadata
Release files for expkit-core 1.0.7
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 |
|---|---|---|---|---|
| expkit_core-1.0.7.tar.gz | 22.2 kB | Without provenance | Details for expkit_core-1.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| expkit_core-1.0.7-py3-none-any.whl | Python 3 | none | any | Details for expkit_core-1.0.7-py3-none-any.whl |
Total release size: 53.9 kB
Release files / expkit_core-1.0.7.tar.gz
| Download URL | expkit_core-1.0.7.tar.gz |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8455ca6c698e542d80013d7a1df7c7026707757663f6e6d173a1e44820185200
|
|
BLAKE2b-256 checksum How to use checksums |
ae7d91f9a8f8a5d4b3764bd0697479212616754b0a35859f08ff062ed11488c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.15
|
Release files / expkit_core-1.0.7-py3-none-any.whl
| Download URL | expkit_core-1.0.7-py3-none-any.whl |
|---|---|
| Size | 31.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d879b9de3a96569b363bccb00ed45bf3457b34483b46a1c0cd07932bd5d700d3
|
|
BLAKE2b-256 checksum How to use checksums |
ed411ecb7957e4f5d6f720da84129b0a36e8f4b1ec14a9dc56d76d4e97ff045b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.15
|
Security for expkit-core 1.0.7
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.