8000 fix#1126: Benchmarking Suites export to LaTeX by samplecatalina · Pull Request #1398 · openml/openml-python · GitHub
[go: up one dir, main page]

Skip to content

fix#1126: Benchmarking Suites export to LaTeX #1398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from

Conversation

samplecatalina
Copy link
Contributor

Reference Issue

Fixes #1126

What does this PR implement/fix? Explain your changes.

  1. Added a to_latex method to the OpenMLDataset class that:
  • Uses pandas 2.0's LaTeX export functionality
  • Supports multi-page tables using the longtable package
  • Allows customization of columns, caption, and label
  • Can write output to a file or return as a string
  • Makes jinja2 dependency optional (only needed if using custom templates)
  1. Added comprehensive tests that verify:
  • Basic LaTeX export functionality
  • Column filtering
  • Caption and label support
  • File output functionality
  1. Updated requirements to ensure pandas 2.0+ is available

How should this PR be tested?

A to_to_latex() has been added to tests/test_datasets/latex.py

Any other comments?

This function could be tested locally with this snippet below. Although it is not exactly benchmarking suites as in the discussion of issue #1126, it indicates this to_latex function is a working solution.

import openml

# Get a dataset
dataset = openml.datasets.get_dataset(1)  # Replace with your dataset ID

# Export to LaTeX
latex = dataset.to_latex(
    caption="Dataset Information",
    label="tab:dataset",
    columns=["Name", "Creator", "Description"]  # Optional: specify columns
)

# Or write directly to a file
dataset.to_latex(output_file="dataset.tex")

samplecatalina and others added 8 commits April 19, 2025 22:51
Copy link
Collaborator
@PGijsbers PGijsbers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to contribute! ❤️ Unfortunately, this PR does not address the linked issue. You added a function to create a latex table based on a dataset, whereas the issue was about a benchmarking suite. At this time, I do not think that we should provide support for latex tables for datasets -- such a feature hasn't ever been requested and I've also not seen any similar tables in papers.

I'll close this PR for that reason, but we would be happy to help you get started on another issue (even #1126) :)

@@ -0,0 +1 @@
pandas>=2.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requirements are specified in pyproject.toml

@PGijsbers PGijsbers closed this Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Exporting Benchmarking Suites to LaTeX
2 participants
0