Skip to main content

Visualize experiments tables and figures.

Project description

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.

GitHub Repo

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

expviz-0.0.4.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

expviz-0.0.4-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file expviz-0.0.4.tar.gz.

File metadata

  • Download URL: expviz-0.0.4.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for expviz-0.0.4.tar.gz
Algorithm Hash digest
SHA256 37435f1a5e66820db45a44e103d5b9a4ee423a5b2a88c3cf79597a79c8a4ed9b
MD5 bd3996917b1290712afcfc153cc2b957
BLAKE2b-256 16389f92a22da69e2aae2a546881bc75b616ad5580160457cb6ae999ccd51980

See more details on using hashes here.

File details

Details for the file expviz-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: expviz-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for expviz-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f47c6a7139c80a90828a4f5e1e74ed7599e891ac292173a57b3bc4e3c05d6c53
MD5 756a37857b830511b696a87acab9f6ee
BLAKE2b-256 2a06fb6545002ff4906bf8ece05acc61f2adec47d14a264f6cdd7933eed0b81a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page