Source-linked AI summary

KG4Vis: A Knowledge Graph-Based Approach for Visualization Recommendation

Haotian Li, Yong Wang, Songheng Zhang, Yangqiu Song, Huamin Qu

arXiv:2107.12548v3cs.HC

TL;DR

Rule-based visualization recommenders require manual rule specifications, while machine-learning approaches can be difficult to interpret. KG4Vis learns a knowledge graph from dataset–visualization pairs and uses its embeddings to recommend visualizations with explainable rules; the reported evaluations demonstrate its effectiveness.

  • Problem

    Rule-based recommenders require manual visualization-rule specifications, while machine-learning approaches can behave as black boxes that are difficult to explain.

    Source: §1 · pp. 1–2
  • Method

    KG4Vis builds a knowledge graph of data features, data columns, and visualization choices, then learns TransE-based embeddings from dataset–visualization pairs to infer recommendations and rules.

    Source: §1 · p. 2
  • Results

    The authors report that quantitative comparisons, case studies, and expert interviews demonstrate KG4Vis’s effectiveness and explainability.

    Source: §1 · p. 2
  • Takeaways & Limitations

    The generated rules let users trace why a visualization is recommended and understand visualization principles.

    Source: §1 · p. 2

    KG4Vis mainly considers chart type and x-/y-axis placement, omitting more advanced choices such as chart aspect ratio and color usage.

    Source: §6.2 · p. 9

Abstract

from arXiv · show

Visualization recommendation or automatic visualization generation can significantly lower the barriers for general users to rapidly create effective data visualizations, especially for those users without a background in data visualizations. However, existing rule-based approaches require tedious manual specifications of visualization rules by visualization experts. Other machine learning-based approaches often work like black-box and are difficult to understand why a specific visualization is recommended, limiting the wider adoption of these approaches. This paper fills the gap by presenting KG4Vis, a knowledge graph (KG)-based approach for visualization recommendation. It does not require manual specifications of visualization rules and can also guarantee good explainability. Specifically, we propose a framework for building knowledge graphs, consisting of three types of entities (i.e., data features, data columns and visualization design choices) and the relations between them, to model the mapping rules between data and effective visualizations. A TransE-based embedding technique is employed to learn the embeddings of both entities and relations of the knowledge graph from existing dataset-visualization pairs. Such embeddings intrinsically model the desirable visualization rules. Then, given a new dataset, effective visualizations can be inferred from the knowledge graph with semantically meaningful rules. We conducted extensive evaluations to assess the proposed approach, including quantitative comparisons, case studies and expert interviews. The results demonstrate the effectiveness of our approach.

1 INTRODUCTION

The paper targets visualization recommendation that avoids expert-written rules while making recommendations understandable, addressing rule-based systems’ manual-rule burden and ML models’ black-box explanations. KG4Vis learns visualization rules from dataset–visualization pairs in a knowledge graph and evaluates its recommendations through model comparisons, examples, and expert interviews.

1 INTRODUCTION

  • Rule-based systems require expert-specified rules that are costly to compile and may not generalize across datasets or visualization choices.As input dimensions grow, recommendation combinations can proliferate.Source: §1 · pp. 1–2
  • ML-based recommenders learn from examples without manual rule specifications, but their black-box behavior makes recommendations difficult to explain and can affect user trust.Data2Vis is described as using an LSTM-based neural translation model trained on a Vega-Lite corpus.Source: §1 · p. 2
  • The authors frame their goal as recommendations that need no manual rule specifications while remaining explainable to general visualization users.They characterize this as a non-trivial task that has received little research attention.Source: §1 · p. 2
  • KG4Vis models visualization recommendations with a knowledge graph whose learned rules can be traced to explain recommendations, without manual rule specifications.The graph links data features, data columns, and visualization design choices; TransE learns entity and relation embeddings from dataset–visualization pairs.Source: §1 · p. 2
  • The evaluation compares knowledge-graph models’ recommendation accuracy, interviews 12 visualization experts, and showcases recommendation rules and visualizations.The interviews assess whether the rules and recommendations are meaningful to human users.Source: §1 · p. 2

2 RELATED WORK

Prior visualization recommenders include manually specified rule systems and machine-learning approaches that learn from data but can be difficult to interpret. KG4Vis uses knowledge-graph embeddings to model entity relationships and support explainable recommendations.

2.1 Visualization Recommendation

  • Rule-based visualization recommenders use manually specified rules, whose thorough construction and later updates can require substantial effort.Examples include APT, SAGE, Show Me, and Voyager2.Source: §2.1 · p. 2
  • ML-based recommenders learn or rank visualizations from data, but deep-learning models can make their recommendations hard to interpret.The cited approaches include systems that augment expert rules and neural networks that infer visual encodings from dataset features.Source: §2.1 · p. 2

2.2 Knowledge Graph-based Recommendation

  • Knowledge graphs represent entities and their relations, enabling recommendation methods to model latent relationships and explain results through graph structure.The paper places KG-based methods into embedding-based, path-based, and unified categories.Source: §2.2 · p. 2
  • KG4Vis follows an embedding-based approach, learning entity and relation embeddings and making recommendations from them.The paper applies an improved TransE method to learn these vectors.Source: §2.2 · p. 2, §2.3 · p. 3

2.3 Knowledge Graph Embedding

  • Translational knowledge-graph embeddings represent relations as translations between entity vectors; other approaches use tensor decomposition or neural models.The paper cites TransE as a representative translational model.Source: §2.3 · p. 3

3 BACKGROUND: TRANSE

TransE represents a relation between entities as a translation from a head entity toward a tail entity. It scores triplets and uses a margin-based ranking loss to distinguish training triplets from negative ones during embedding learning.

3 BACKGROUND: TRANSE

  • TransE represents a knowledge-graph relation as a translation from a head-entity embedding to a tail-entity embedding.The paper applies this representation to data features, visualization designs, and their relations.Source: §3 · p. 3
  • A triplet scoring function measures the plausibility of a head–relation–tail combination, with larger scores indicating more plausible triplets.The distance can use either L1 or L2 distance.Source: §3 · p. 3
  • TransE trains embeddings with a margin-based ranking loss that separates training-triplet scores from negative-triplet scores.Negative triplets are formed by randomly replacing a head or tail entity, and gradient descent minimizes the loss.Source: §3 · p. 3

4 METHOD

KG4Vis extracts data features and visualization choices from dataset–visualization pairs, builds a knowledge graph, learns embeddings, and infers choices for new datasets. Its inference aggregates feature-to-choice rules and applies post-processing to assemble valid visualizations.

4 METHOD

  • KG4Vis has four modules: feature extraction, knowledge-graph construction, embedding learning, and embedding-based inference.The pipeline extracts features and design choices from dataset–visualization pairs, then builds a graph and learns embeddings before inference.Source: §4 · p. 3

4.1 Data Features and Visualization Design Choices

  • The method extracts 81 column features—50 continuous and 31 categorical—covering data types, value statistics, and column names.It limits recommendations to six 2-D chart types and x- or y-axis assignments.Source: §4.1 · p. 3

4.2 Knowledge Graph Construction

  • The knowledge graph links data features to data columns and columns to visualization design choices; continuous features are discretized into interval entities using MDLP.MDLP can use visualization type as an additional criterion and automatically determine the number of intervals.Source: §4.2 · pp. 3–4
  • Triplets extracted from dataset–visualization pairs connect each column’s features to the column and the column to its visual design choices.Combining these triplets across columns forms the knowledge graph used for recommendation.Source: §4.2 · p. 4

4.3 Embedding Learning

  • TransE embeddings support later inference and explicit rule generation, while self-adversarial negative sampling weights negative examples by their estimated truth under current embeddings.The embedding-learning procedure samples training triplets, generates negatives, assigns weights, calculates loss, and optimizes embeddings.Source: §4.3 · p. 4

4.4 Inference with Embeddings

  • Inference translates a feature embedding through a data-column relation and a target visualization relation, yielding scored feature-to-design-choice rules.Scores for applicable rules are aggregated, and the highest-scoring choice is selected; post-processing then enforces valid visualizations under the chosen grammar.Source: §4.4 · p. 5

5 EVALUATION

The evaluation combines embedding-model comparisons, case studies, expert interviews, and comparisons with empirical visualization guidelines. Results favor TransE-adv, while qualitative findings show both useful learned rules and limitations tied to corpus characteristics and datasets with ambiguous visualization preferences.

5.1 Evaluation Setup

  • The evaluation corpus contains 88,548 dataset-visualization pairs across six chart types, with a 70% training split and five-fold cross-validation.The source is VizML; preprocessing includes quantile clipping and MDLP discretization, with the interval settings chosen to balance performance and interpretability.Source: §5.1 · p. 5, §5.2 · p. 6

5.2 Quantitative Evaluation

  • TransE-adv outperforms the other embedding models on both visualization-type inference and axis inference.The evaluation compares TransE-adv with TransE and RotatE; Table 2 reports the results.Source: Table 2 · p. 6, §5.2 · p. 6

5.3.1 Case Study

  • Case studies show scatter rules for numerical pairs and detected outliers, while box-plot rules favor uneven distributions and high-entropy values.The box-plot rules were described as unexpected but reasonable because such plots help reveal data distributions.Source: §5.3.1 · p. 6
  • Line-chart rules reflect monotonic time columns and multi-column datasets, while bar-chart rules favor categorical, often unique or unsorted values.The case studies conclude that learned rules can reveal implicit mappings from data features to visualization choices.Source: §5.3.1 · pp. 6–7

5.3.2 Expert Interviews

  • Twelve visualization researchers evaluated rules, recommendations, and preferred chart types across three interview tasks involving 30 rules and 30 datasets.Experts scored rules and recommended visualizations, then selected their preferred chart types; the recommendation task considered chart type and axis arrangement, not other design choices.Source: §5.3.2 · p. 7
  • Experts appreciated the generated rules, and recommended visualizations received an average final score of 3.7944, with box plots and heatmaps relatively weaker.Low-scoring rules often relied on column names that reflected Plotly grammar or defaults, raising doubts about generalization beyond Plotly-derived datasets.Source: §5.3.2 · p. 7, Table 3 · p. 7
  • Recommendations may be ambiguous when datasets lack dominant features; incorporating user preferences and analysis tasks is left for future work.For one low-rated heatmap case, experts disagreed on the best chart type, with top-two selection entropy values above their respective averages.Source: §5.3.2 · pp. 7–8

5.3.3 Comparison between Generated and Empirical Rules

  • Generated entropy, column-count, and outlier rules align with empirical guidelines for bar charts, line charts, and scatter plots.The entropy comparison favors bar charts at low entropy, scatter as entropy rises, and line charts at higher entropy; outliers favor scatter among the compared types.Source: §5.3.3 · p. 8, Figure 8 · p. 8

6 DISCUSSION

The discussion explains how KG construction and embedding choices shape visualization recommendations, and weighs their explainability and extensibility against corpus, design-choice, and evaluation limitations.

6.1.1 Knowledge Graph for Visualizations

  • MDLP discretizes continuous features using their distributions and correspondence with visualization types, outperforming KMeans, which considers each feature’s distribution alone.The authors chose MDLP while noting that other advanced discretization techniques remain open to exploration.Source: §6.1.1 · p. 8
  • KG4Vis adopts TransE-adv after considering TransE, TransE-adv, and RotatE; these models offer lower complexity and intuitive relation modeling than TransR and RESCAL.The authors say translation or rotation in embedding space can help users interpret embeddings and generated rules.Source: §6.1.1 · pp. 8–9

6.1.2 Data-driven Visualization Recommendation

  • KG4Vis depends on dataset–visualization pairs, so corpus-specific grammars and limited visualization types constrain data-driven recommendation; diverse, high-quality corpora could help.The paper identifies these drawbacks in corpora including VizML and Vega-Lite.Source: §6.1.2 · p. 9
  • Recommendation rules can confuse users when features are unfamiliar or conditions are numerous, while single-condition rules are clearer but may capture data characteristics less fully.The proposed approach aggregates valid one-condition rules to support understandable rules alongside effective recommendations.Source: §6.1.2 · p. 9
  • KG4Vis derives rules automatically from a corpus and recommends visualizations in an average of 0.07 seconds per dataset, but performs slightly below VizML’s neural network (visualization type MR 1.7755).The authors suggest its weaker modeling of nonlinear relations between data features and design choices may explain the performance difference.Source: §6.1.2 · p. 9

6.2 Limitations

  • KG4Vis mainly models chart types and axis arrangement, not advanced choices such as color or chart ratio; adding features and choices increases triplets and expected training time.The current corpus often uses Plotly’s default color scale rather than explicitly specifying colors.Source: §6.2 · p. 9
  • The evaluation’s expert interviews included only 12 visualization experts because judging generated rules requires visualization-design knowledge.The authors say this task is not suited to MTurk workers who may lack that expertise.Source: §6.2 · p. 9

7 CONCLUSION AND FUTURE WORK

KG4Vis uses a knowledge graph to recommend visualizations from dataset–visualization pairs and provide rules that help users understand recommendations. The authors report evaluations of its effectiveness and propose several directions for extending the approach.

7 CONCLUSION AND FUTURE WORK

  • KG4Vis extracts data features, builds a graph linking data features, data columns, and visualization design choices, learns embeddings with TransE-adv, and infers visualizations and explanatory rules for new datasets.The paper describes feature extraction, graph construction, embedding learning, and embedding-based inference as its four key modules.Source: §7 · p. 9
  • The authors evaluate KG4Vis through case studies, expert interviews, and comparisons between generated rules and empirical rules from a prior study.They characterize the evaluations as demonstrating the approach’s effectiveness.Source: §7 · p. 9
  • Future work will explore cross-column features without increased computational demands, personalization to user requirements, and recommendations for visualizations such as infographics.Source: §7 · p. 9
Loading 2107.12548v3…