TL;DR
This paper introduces KG4Vis, a novel approach that uses knowledge graphs to recommend effective data visualizations. By learning relationships between data features and visualization design choices, KG4Vis provides not only accurate recommendations but also explainable rules, addressing the "black-box" problem of many ML-based methods and the manual effort of rule-based systems.
What Problem Does This Paper Address?
Creating effective data visualizations can be challenging, especially for users without a background in data visualization or familiarity with complex tools like D3 or R. Existing automated visualization recommendation systems fall into two main categories: rule-based systems, which require extensive manual effort from experts to define rules, and machine learning (ML)-based systems, which often act as "black boxes," making it difficult for users to understand why a particular visualization is recommended. This lack of explainability hinders user trust and adoption. KG4Vis aims to bridge this gap by providing a system that automatically learns visualization rules and offers transparent, understandable explanations for its recommendations.
Methods
KG4Vis employs a knowledge graph (KG) to model the complex mapping between data and effective visualizations. The core of the method involves:
- Feature Extraction: Data features from existing dataset-visualization pairs are extracted. These include characteristics of data columns (e.g., data type, statistical properties like distribution and outliers) and visualization design choices (e.g., visualization type like bar, line, scatter, and axis assignments).
- Knowledge Graph Construction: A KG is built with three types of entities: data features, data columns, and visualization design choices. Relations between these entities capture how data maps to visualizations (e.g., "a data column is visually encoded by a specific visualization type"). Continuous data features are discretized into intervals to be represented as entities.
- Embedding Learning: A TransE-based embedding technique (specifically, TransE-adv with self-adversarial negative sampling) is used to learn low-dimensional vector representations for entities and relations in the KG. These embeddings intrinsically capture the "rules" of effective visualization design.
- Embedding-based Inference: For a new dataset, KG4Vis uses the learned embeddings to infer visualization design choices. This involves generating rules of the form "data feature → visualization design choice" and aggregating their scores to determine the most suitable visualization type and axis assignments for each data column. The system also generates semantically meaningful rules to explain the recommendations.
Datasets
The primary dataset used for training and evaluation is the VizML corpus. This corpus contains approximately 120,000 dataset-visualization pairs, generated using Plotly. The authors followed VizML's strategy of sampling one dataset per user to create their evaluation corpus, resulting in a final dataset of 88,548 dataset-visualization pairs and 309,335 data columns.
Key Insights and Ideas
- Knowledge Graphs as a Bridge: The paper demonstrates that KGs can effectively bridge the gap between the structured nature of data and the nuanced, often implicit, rules of effective data visualization design.
- Explainability Without Manual Rules: By learning embeddings from data, KG4Vis bypasses the need for tedious manual rule specification while still providing interpretable rules for recommendations. This is a significant advantage over traditional rule-based systems.
- Discretization for Continuous Features: Representing continuous data features as discrete intervals within a KG is a practical approach to handle their complexity and integrate them into the graph structure.
- Surprising Rules for Box Plots: The system generated rules for box plots that were not immediately intuitive but were validated by experts, such as "values are not evenly distributed → box plot" and "the entropy of values is large → box plot." This highlights the potential of data-driven approaches to uncover less obvious visualization principles.
Key Results
- Quantitative Evaluation: KG4Vis, using TransE-adv, outperformed baseline models (TransE and RotatE) in both visualization type inference (measured by Mean Rank - MR, and Hits@2) and axis inference (measured by accuracy). For visualization type inference, TransE-adv achieved an MR of 1.9718 and Hits@2 of 0.7445.
- Qualitative Evaluation (Expert Interviews):
- Experts rated the generated rules highly, with comments like "some rules are inspiring" and "straightforward and easy to understand."
- Recommended visualizations received an average score of 3.7944 out of 5, indicating high quality and usefulness.
- The system performed particularly well for bar, histogram, line, and scatter plots, with slightly lower performance for box and heatmap plots.
- Rule Comparison: Generated rules showed alignment with empirical rules from prior studies, such as "bar charts are suitable for identifying clusters" and "scatter plots should be used to find anomalies."
Limitations and Future Work
- Limited Visualization Design Choices: The current KG4Vis primarily considers visualization types and axis assignments. More advanced design choices like chart ratio and color usage are not yet incorporated, partly due to the limitations of the training corpus.
- Corpus Dependence: The quality and coverage of the learned rules are dependent on the dataset-visualization corpus used. Issues with specific visualization grammars or limited visualization types in the corpus can affect generalization.
- Feature Complexity: Some data features used (e.g., moments of distribution) might not be immediately intuitive to general users, potentially hindering rule interpretability.
- Expert Interviews Scale: The expert interviews involved 12 participants, which, while providing valuable feedback, could be expanded for broader validation.
Future Work: The authors suggest exploring ways to incorporate cross-column features more effectively, integrating user requirements and specific tasks for personalized recommendations, and extending the KG-based approach to other visualization types like infographics.
Summary updated