Abstract
Traditional machine learning models typically require data to be flattened into one-dimensional feature vectors. This vectorization process often destroys the intrinsic structural relationships between features, such as spatial proximity in images or co-occurrence in text. We introduce Bat (Bayesian Tensor classifier), a novel semi-naive Bayesian method that operates directly on data in its natural tensor format. By utilizing the tensor structure to define feature dependencies, Bat effectively reduces classification bias. Evaluation on 21 datasets involving graph and text data shows that Bat consistently outperforms standard vector-based learners like Naive Bayes and Support Vector Machines.
Introduction: The Vectorization Trap
In standard machine learning workflows, data instances are represented as flat lists of numbers. While this simplification facilitates the use of a wide array of algorithms, it assumes that the arrangement of features is irrelevant. For instance, in document classification, a vector might count the occurrences of "Apple" and "iPhone" but fails to capture their proximity within the same paragraph unless an exponentially large feature space is created.
The authors argue that representing data as tensors—multi-dimensional arrays—allows for the natural preservation of these interactions. However, most existing classifiers necessitate flattening, which negates the benefits of the tensor representation.
Methods: The Bat Algorithm
The proposed Bayesian Tensor classifier (Bat) is a generative model designed to handle $n$-mode tensors.
Tensorial Representation
Instead of a vector, data is structured as a tensor. In a 2-mode tensor (a matrix), diagonal elements typically represent the frequency of individual features, while off-diagonal elements represent interactions or co-occurrences.
Relaxing Independence
Standard Naive Bayes assumes all features are independent given the class. Bat relaxes this assumption by assigning "parent" features based on the tensor's geometry. An entry in a tensor is considered dependent on other entries sharing the same dimension (e.g., the same row or column).
The algorithm estimates joint likelihood by considering these structural dependencies. It employs Mutual Information to weight the importance of parent features, ensuring that only relevant dependencies influence the classification. Crucially, Bat maintains computational efficiency; its complexity is linear with respect to the number of modes ($O(2mt)$ for 2-mode tensors), making it significantly faster than other semi-naive methods like AODE for high-dimensional data.
Experimental Evaluation
The researchers evaluated Bat on two complex data types:
- Graph Data: 12 datasets including chemical compounds (AID series and PTC), where tensors captured relationships between frequent subgraphs.
- Text Documents: 9 datasets (OHSUMED, Reuters-21578, TREC) where tensors represented word co-occurrences within paragraphs.
Key Insights and Results
- Structure as a Prior: The physical structure of a tensor serves as a roadmap for feature dependencies, eliminating the need for exhaustive searches for related features.
- Bias-Variance Tradeoff: By acknowledging dependencies, Bat reduces systematic error (bias) compared to Naive Bayes. Although this may slightly increase variance, the overall predictive performance (AUC-PR) is superior.
- Destructive Linearization: The study demonstrates that flattening a tensor before classification leads to inferior results, even when using powerful models like Random Forests.
Bat outperformed Naive Bayes, AODE, SVMs, and Random Forests across the majority of the 21 datasets. Statistical tests confirmed that the tensor representation provides a significant performance boost ($p < 10^{-4}$). In document classification tasks, Bat achieved significantly higher AUC-PR than standard Naive Bayes, particularly in sparse, high-dimensional environments.
Conclusion
Bat provides a robust framework for learning from structured data without the information loss associated with vectorization. Future work will explore extending Bat to higher-order tensors for image and video analysis, where multi-dimensional structures are the natural data format.
Summary updated