A flexible experiment logging library for research and machine learning projects
Project description
Loggex
Loggex helps you track your research experiments across multiple scripts by providing a central log file to record which script produced what results with which configuration.
Features
- Track experiment runs in CSV, JSON, or Excel format
- Load and add to your experiment log from any script
- Automatic timestamp tracking for each run
- Simple querying and filtering capabilities
- Quick summary reports of your experiments
Installation
pip install loggex
Quick Start
Creating a New Log
from loggex import Project
# Create a new experiment log (defaults to CSV format)
project = Project.new(
name="sentiment_experiments",
path="logs",
columns=["experiment", "script", "model", "lr", "bs", "max_len", "f1_score", "results_file"]
)
# Log an experiment run
project.add(
experiment="bert_base",
script="train_bert.py",
model="bert-base-uncased",
lr=2e-5,
bs=16,
max_len=128,
f1_score=0.91,
results_file="results/bert_base_full.csv"
)
Adding Results from Another Script
from loggex import Project
# Load the existing log
project = Project.load("sentiment_experiments", path="logs")
# Add results from this script
project.add(
experiment="bert_large",
script="train_bert_improved.py",
model="bert-large-uncased",
lr=3e-5,
bs=8,
max_len=256,
f1_score=0.94,
results_file="results/bert_large_full.csv"
)
# View latest runs
project.tail()
Analyzing Your Experiments
# Generate a summary report
project.report()
# Filter experiments
best_runs = project.filter("f1_score > 0.92")
print(best_runs)
# Remove failed runs
project.remove("f1_score < 0.5")
# Export filtered results
project.export(
format='excel', # 'csv', 'json', or 'excel'
query="model == 'bert-base-uncased'",
path="analysis/bert_base_results.xlsx"
)
Using Different Formats
By default, Loggex uses CSV files, but you can choose other formats:
# Create a new log in Excel format
project = Project.new(
name="mnist_experiments",
path="logs",
columns=["experiment", "script", "accuracy"],
format='excel' # 'csv', 'json', or 'excel'
)
Documentation
The Project class supports:
- Creating new logs (
new()) - Loading existing logs (
load()) - Adding log entries (
add()) with automatic timestamp tracking - Printing all logs (
print()) - Viewing latest entries (
tail(n=5)) - Removing entries (
remove(query)) - Generating detailed reports (
report()) - Exporting filtered results (
export(format, query, path))
See in-line docstrings in the source code for complete usage details.
License
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 loggex-0.1.0.tar.gz.
File metadata
- Download URL: loggex-0.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
096f5272bcbaf9cbe0c7883b3488538a133d4c499220c24400dd0f7ea726c7ca
|
|
| MD5 |
077ba735fbbe917272fc4c66fba61349
|
|
| BLAKE2b-256 |
28031e4e2bcd677589fd0b4c481b0cc0c8685a2e3a174c2b9ae5e60683fa7a38
|
File details
Details for the file loggex-0.1.0-py3-none-any.whl.
File metadata
- Download URL: loggex-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.8.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f52ed2e715d2532ca584a1a302f6621d5d09da51c78a9d2a96caae14e7e25d1
|
|
| MD5 |
136ab7f3c11ac6d840c7cfbefe0e7672
|
|
| BLAKE2b-256 |
e653f59d47d40097cace8c4e6ec61f8e385bd05c1d5e6132b29f2c71dc2c73e7
|