TL;DR
This paper introduces ShapeSearch, a novel system for finding patterns in trendlines (line charts). It addresses the limitations of existing tools by offering flexible search mechanisms (sketch, natural language, regex) and an expressive query algebra that supports approximate matching, enabling users to find complex or underspecified patterns efficiently.
What Problem Does This Paper Address?
Domain experts, from biologists to financial analysts, routinely examine trendlines to understand data. However, existing visual analytics tools are often rigid and inflexible, requiring users to specify exact patterns, which is impractical when patterns are approximate, underspecified, or complex. Manual exploration is tedious, and while some tools offer pattern search, they often require heavy precomputation or are limited in expressiveness. This paper tackles the challenge of enabling flexible, efficient, and scalable shape-based exploration of trendlines for domain experts.
Methods
ShapeSearch introduces a novel ShapeQuery algebra with primitives and operators to express a wide range of trendline patterns, including fuzzy matching. This algebra is supported by three user-friendly query specification mechanisms:
- Sketching: Users can draw a desired shape.
- Natural Language (NL): Users can describe patterns in plain English.
- Regular Expressions (Regex): Users can construct precise queries for complex combinations.
A sophisticated parser translates NL and sketch queries into the ShapeQuery algebra. To execute these queries efficiently, ShapeSearch employs a query-aware execution engine with:
- Dynamic Programming (DP): For optimal segmentation of fuzzy queries, though computationally expensive.
- Pattern-Aware Bottom-up Approach (SegmentTree): An approximate but significantly faster algorithm that leverages locally optimal points (LOPs) and a bottom-up merging strategy.
- Pruning Optimization: To filter out low-scoring trendlines early, further improving efficiency.
- Push-Down Optimizations: To optimize queries with location constraints.
Datasets
The paper mentions using several datasets for case studies and evaluations:
- Genomics data: Used for a case study and to collect natural language queries.
- Astronomy, battery science, and finance data: Mentioned as domains motivating the system.
- UCI repository datasets: Five real-world datasets (Weather, Worms, 50Words, Real Estate, Haptics) were used for performance evaluation.
- Mouse gene dataset: Used in the genomics case study.
- Dow Jones stock dataset: Used in the user study.
A corpus of approximately 250 natural language queries was collected via Amazon Mechanical Turk (mturk) to characterize trendline patterns and train the NL parser.
Key Insights and Ideas
- Fuzzy matching is crucial: Domain experts often deal with approximate patterns, not exact ones. ShapeSearch's ability to handle "fuzzy" queries is a key differentiator.
- Expressiveness through a minimal algebra: A well-designed algebra with a few primitives and operators can capture a rich variety of complex patterns, making the system flexible.
- Bridging the gap between sketch and language: Offering multiple input methods (sketch, NL, regex) caters to different user preferences and task complexities, allowing users to choose the most suitable approach.
- Efficiency through approximation and pruning: Exact optimal solutions for fuzzy queries are computationally prohibitive. Approximate algorithms like SegmentTree, combined with pruning, achieve a good balance between speed and accuracy.
- Pattern-aware segmentation is key: Instead of treating all points equally, focusing on points where patterns change drastically leads to more efficient and effective segmentation.
Key Results
- Runtime Improvements: ShapeSearch's SegmentTree algorithm offers a 2x to 40x speedup compared to DP for fuzzy queries, and is about 10x faster than DTW. Pruning further boosts performance by 10-30%. Push-down optimizations significantly reduce runtime for non-fuzzy queries, sometimes by more than 50%.
- Accuracy: The SegmentTree algorithm achieves comparable accuracy to DP, with deviations in top-k visualizations being minimal (e.g., never off by more than 2 trendlines in top 20).
- User Study: ShapeSearch (NL and Regex) achieved higher accuracy (87%) and less completion time (30-40% less)* compared to baseline sketch-based tools (Zenvisage, Qetch) for most tasks. Participants preferred a combination of mechanisms, highlighting the value of ShapeSearch's multi-modal approach.
- NL Parser: The CRF model for NL translation achieved an F1 score of 81% on a 5-fold cross-validation.
Limitations and Future Work
- Sketching for Exact Matches: For tasks requiring precise shape matching, ShapeSearch's current implementation (without sketch-based fuzzy matching details in the main text) performed worse than dedicated sketch-based tools. The authors suggest integrating visual widgets to leverage ShapeSearch primitives within baseline tools.
- Complexity of Patterns: While the algebra is expressive, extremely complex patterns might still be challenging to formulate.
- User Preferences: While NL and Regex were generally well-received, some users found them difficult to learn initially.
- Future Work Suggestions: Participants suggested supporting more mathematical patterns, automatic regex validation/correction, query/trendline recommendations, and visual widgets for tweaking scoring. The authors also mention the potential for further optimizations and extensibility.
Summary updated