Experiments Visualization Toolkit (ExpViz)
Welcome to the Experiments Visualization Toolkit (ExpViz), a Python-based solution designed to facilitate the handling and visualization of experiment results, particularly those stored in JSON format. Whether your results are stored in files or represented as JSON-like dictionaries, ExpViz is here to streamline your data visualization process.
Features
- Read Results: Directly input JSON-like dictionaries or read experiment results from JSON files in a specified directory.
- Convert to DataFrame: Elegantly transform nested dictionaries into customizable Pandas DataFrames.
- Table Rendering: Convert DataFrames to LaTeX and Markdown tables for seamless integration into documents and web pages.
- Jupyter Display: Render and showcase DataFrames interactively within Jupyter notebooks.
Installation
# Clone the repository
git clone https://github.com/fuzihaofzh/expviz.git
# Navigate to the cloned repository
cd expviz
# (Optional) Install any dependencies listed in requirements.txt
pip install -r requirements.txt
Usage
1. Reading Results
# Directly using a JSON-like dictionary
data_dict = {
"exp1": {"Score1": 10.1, "Score2": 20},
"exp2": {"Score1": 30, "Score2": None}
}
results = read_results(data_dict=data_dict)
# Alternatively, using the base URL and experiment names
baseurl = "path/to/experiment/results"
expnames = ["experiment1", "experiment2"] # or {"exp1": "experiment1", "exp2": "experiment2"}
results = read_results(baseurl, expnames, filename="eval.json")
2. Converting to DataFrame
# Format and convert the results to a DataFrame
df = dict_to_dataframe(results, fmt='{:,.3g}', transpose=False)
print(df)
3. Rendering as LaTeX or Markdown
# Convert the DataFrame to a LaTeX table
latex_table = to_latex(results, fmt='{:,.3g}', transpose=False)
print(latex_table)
# Convert the DataFrame to a Markdown table
markdown_table = to_markdown(results, fmt='{:,.3g}', transpose=False)
print(markdown_table)
4. Displaying in Jupyter
# Visualize the DataFrame in a Jupyter notebook
show(results, fmt='{:,.3g}', transpose=False)
Examples
-
Using JSON-like Dictionary
data_dict = { "exp1": {"Score1": 10.1, "Score2": 20}, "exp2": {"Score1": 30, "Score2": None} } results = read_results(data_dict=data_dict)
-
Using a List of Experiments
results = read_results("path/to/results", ["experiment1", "experiment2"])
-
Using a Dictionary of Experiments
results = read_results("path/to/results", {"exp1": "experiment1", "exp2": "experiment2"})
-
Visualizing in Jupyter Notebook
show(results)
-
Rendering as Markdown
md_table = to_markdown(results) print(md_table)
Contributing
Contributions are warmly welcomed! For information on how to contribute, please refer to our contributing guidelines.
License
ExpViz is under the MIT License. For more details, check out the LICENSE.md file in our GitHub repository.
Release files for expviz 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| expviz-0.0.4.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| expviz-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.8 kB
Release files / expviz-0.0.4.tar.gz
| Download URL | expviz-0.0.4.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37435f1a5e66820db45a44e103d5b9a4ee423a5b2a88c3cf79597a79c8a4ed9b
|
|
BLAKE2b-256 checksum How to use checksums |
16389f92a22da69e2aae2a546881bc75b616ad5580160457cb6ae999ccd51980
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Release files / expviz-0.0.4-py3-none-any.whl
| Download URL | expviz-0.0.4-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f47c6a7139c80a90828a4f5e1e74ed7599e891ac292173a57b3bc4e3c05d6c53
|
|
BLAKE2b-256 checksum How to use checksums |
2a06fb6545002ff4906bf8ece05acc61f2adec47d14a264f6cdd7933eed0b81a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|