# Automated Recommendation of Aggregate Visualizations for Crowdfunding Data
## 2 Materials and Methods
### The LoanVis Visualization Recommendation System
#### 2.2.1 Recommending Insightful Visualizations
For example, in Figure 1(a), each \(a_{i}\) is a country, whereas each \(f_{i}\) is the amount of loans disbursed to that country \(a_{i}\) for projects related to the entertainment sector. Finally, \(V\) is scaled by the sum of aggregate values \(U=\sum\limits_{p=1}^{l}f_{p}\), leading to the probability distribution \(P[V]\), which is computed as:  
\[P[V]=<\frac{f_{1}}{U},\frac{f_{2}}{U},\ldots,\frac{f_{l}}{U}> \tag{1}\]  
For an arbitrary view \(V_{i}\) (i.e., a specific combination of \(V=(A,M,F)\)), given the probability distributions of its target and comparison views (i.e., \(P[V_{i}(R)]\) and \(P[V_{i}(D)]\)), the deviation \(S(V_{i})\) is computed as the _distance_ between those probability distributions. Formally, for a given distance function _dist_ (e.g., Euclidean distance, Earth Mover's distance, etc. ), \(S(V_{i})\) is computed as:  
\[S(V_{i})=dist(P[V_{i}(R)],P[V_{i}(D)]) \tag{2}\]  
In this work, we adopt _Euclidean_ distance as our distance function. Hence, the deviation-based metric for a view \(V_{i}\) is computed as:  
\[dist(P[V_{i}(R)],P[V_{i}(D)])=\sum\limits_{x=1}^{l}\sqrt{(P[V_{i}(R)]_{x}-P[ V_{i}(D)]_{x})^{2}}\]  
Consequently, the deviation \(S(V_{i})\) of each possible view \(V_{i}\) is computed, and the \(k\) views with the highest deviation are recommended (i.e., _top-k_), as shown in Figure 1.  
**Illustrative Example:** Consider a data analyst trying to gain insights into the loans disbursement to projects in the Entertainment sector. Particularly, the analyst poses an exploratory query:  
\(Q\): SELECT * FROM loans WHERE sector = Entertainment;  
Clearly, the query \(Q\) above will return all the information about all the loans related to the Entertainment sector. Such information include different dimensions (e.g., country, repayment interval, gender, etc. ), and different measures (e.g., loan amount, funded amount, lender count, etc.). Hence, the analyst can manually try creating different visualizations based on the different combinations of dimension and measure attributes, hoping that some of those visualizations would reveal interesting insights. Alternatively, using our proposed LoanVis system, those insightful visualizations are quickly and automatically recommended to the analyst. In particular, LoanVis applies different SQL aggregate functions (i.e., \(\mathbb{F}\)) on the views resulting from all the possible pairwise combinations of dimensions and measures (i.e., \(\mathbb{A}\) and \(\mathbb{M}\)), then the most interesting views are presented to the analyst (please see Figure 1). That is, the top-k views/visualizations with the highest deviation-based utility score, based on the user's setting for the value of \(k\). \(V_{c}\): SELECT country, SUM (loan amount) FROM loans GROUP BY country;  
To help understand that recommendation, we combine the target view \(V_{t}\) and comparison view \(V_{c}\) in Figure 3, which reveals some very interesting observations regarding the disparity of loan distribution over the different sectors across different countries. As Figures 1(b) and 3 show, countries such as the Philippines, Kenya, Peru, Rwanda, Uganda, Colombia, Pakistan, Lebanon, Mexico, and Samoa are the ones that received the biggest share of total loans (summed over all the different sectors). However, when it comes to the specific loans to the entertainment sector, it is the United States of America that received most of the loans in that sector, at roughly $800,000. In fact, examining Figure 3 shows that the entertainment sector loans constitute about 2.67% of the total USA loans, whereas in the Philippines, that percentage drops to only 0.1%. That is, while projects related to the entertainment sector constitute a significant percentage in the USA, they are of lesser significance in other countries, where most loans are related to other sectors (e.g., agriculture, etc. ).