# Patent

## Title
Systems and methods for generating models of a dataset for a data visualization

## Abstract

A method of generating a statistical model for a dataset operates at a computer system having one or more processors and memory. The memory stores one or more programs configured for execution by the one or more processors. The process receives a visual specification. The visual specification defines a graphical representation of a portion of the dataset. The visual specification includes a first field and a second field of the dataset. The method determines a set of data properties for each of the first and second fields. The process then generates a statistical model of a mathematical relationship between the first and second fields based on the data properties of the first and second fields and data values associated with the first and second fields in the dataset. The process displays the graphical representation and the statistical model superimposed on the graphical representation.

## Background
RELATED APPLICATIONS
This application is a continuation of U.S. patent application Ser. No. 13/211,048, filed Aug. 16, 2011, which is a continuation of U.S. patent application Ser. No. 11/787,761, filed Apr. 17, 2007, now U.S. Pat. No. 7,999,809, which claims priority to U.S. Provisional Patent Application No. 60/793,701, filed on Apr. 19, 2006, which are all hereby incorporated by reference in their entireties.


FIELD OF THE INVENTION
This invention relates generally to computer systems and methods for data visualization. The invention relates specifically to computer systems and methods for automatically generating and displaying data models derived from a multi-dimensional dataset.
BACKGROUND OF THE INVENTION
Multi-dimensional, large-scale datasets are found in diverse subjects, including gene expression data for uncovering the link between the human genome and the various proteins for which it codes; demographic and consumer profiling data for capturing underlying sociological and economic trends; sales and marketing data for huge numbers of products in vast and ever-changing marketplaces; and environmental data for understanding phenomena such as pollution, meteorological changes and resource impact issues.
One challenge for many users dealing with these datasets is how to extract the meaning from the data they contain: to discover structure, find patterns, and derive causal relationships. Very often, the sheer size and complexity of these datasets make it impossible for an analyst to directly glean any meaning from the data without employing some additional operations, such as regression, clustering, summarization, dependency modeling, and classification.
FIG. 1 is a prior art screenshot displaying a portion of a commercial dataset related to the sales and marketing activities of a soft drink company using Microsoft Excel. This dataset has dozens of data fields with different data types. For example, the data type of the “Date” field is time; the data type of the data fields like “Market”, “State”, and “Market Size” is text; and the data type of the data fields like “Sales”, “Profit”, and “Margin” is numeric value. There are many important information items embedded in the raw data; e.g., the most popular product in a state within a specific time period or the least profitable product from the marketing's perspective. But it is quite difficult to access any of them directly from the raw data.
In this regard, data visualization and statistical modeling are powerful tools for helping analysts to explore large datasets. Data visualization can represent a dataset or a portion of the dataset to meet an analyst's interest. For example, the analyst can gain insight into the company's marketing effort from a curve representing the relationship between the “Sales” and the “Marketing” data fields. In many instances, the mere visualization of raw data is not enough. Statistical modeling is often invoked to generate an analytical or numerical model from raw data. Statistical models can be used to predict values, e.g., through interpolation or extrapolation. Statistical models can also be used to test between alternative hypotheses. Hypothesis tests are widely used to confirm findings. In particular, the analyst can easily discover the trends of the market from visualizing the model. From analyzing the visualized model, the analyst can make informed business decisions.
A widely used type of statistical model is a linear model. Linear models relate a response variable to various quantitative and categorical factors using linear coefficients. A specific example of a linear model is linear regression where a y value is predicted from an x value. A special case of linear models is analysis of variance (ANOVA). In analysis of variance, mean values are predicted using factors. For example, the mean response to a drug may depend on the sex and age of the patient.
The conventional manner of generating and visualizing models from multi-dimensional datasets often requires a significant human-computer interaction. To do so, a user must be familiar with the characteristics of the dataset and must also provide detailed computer instructions to generate the models and visualizations. In many situations, a user may have to repeat the process several times to arrive at a satisfactory model. This is extremely inconvenient when a user deals with a large dataset having tens or even hundreds of data fields. The user may have to waste hours of time in order to uncover any significant trends embedded in the dataset.
Consequently, there is a strong need for improved methods and graphical user interfaces for generating and visualizing models.
SUMMARY OF THE INVENTION
The present invention provides improved methods for generating and visualizing models from a multi-dimensional dataset.
A first aspect of the invention provides a computer implemented method of automatically generating models from a dataset, comprising: providing a description of a view of a dataset that includes multiple fields associated with the dataset; determining a set of properties for each of the multiple fields; and automatically translating the description into one or more models based on the respective properties of the multiple fields and a set of predefined heuristics.
A second aspect of the invention provides a computer implemented method of automatically generating models from a dataset, comprising: allowing a user to provide a description that includes at least two sets of fields associated with a dataset; determining a set of properties for each of the two sets of fields; and automatically generating zero or more models based on the properties of the two sets of fields and a set of predefined heuristics.
A third aspect of the invention provides a computer system, comprising: a main memory; a processor; and at least one program stored in the main memory and executed by the processor, the at least one program further including: instructions for providing a description of a view of a dataset that includes multiple fields associated with the dataset; instructions for determining a set of properties for each of the multiple fields; and instructions for automatically translating the description into one or more models based on the respective properties of the multiple fields and a set of predefined heuristics.
A fourth aspect of the invention provides a computer program product for use in conjunction with a computer system, comprising: a computer readable storage medium and a computer program mechanism embedded therein, wherein the computer program mechanism includes: instructions for providing a description of a view of a dataset that includes multiple fields associated with the dataset; instructions for determining a set of properties for each of the multiple fields; and instructions for automatically translating the description into one or more models based on the respective properties of the multiple fields and a set of predefined heuristics.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a prior art screenshot displaying a portion of a commercial dataset related to the sales and marketing activities of a soft drink company using Microsoft Excel.
FIG. 2 is a block diagram illustrating a computer system that facilitates the visualization of a dataset in accordance with some embodiments of the present invention.
FIG. 3A is a flowchart illustrating a process of loading a dataset into the computer system in accordance with some embodiments of the present invention.
FIG. 3B is an exemplary screenshot displaying the dataset loaded into the computer system in accordance with some embodiments of the present invention.
FIG. 4A is a flowchart illustrating a process of displaying a view of the dataset in accordance with some embodiments of the present invention.
FIG. 4B is an exemplary screenshot displaying a view of the dataset in accordance with some embodiments of the present invention.
FIG. 5A is a flowchart illustrating a process of generating and displaying a model of the dataset in accordance with some embodiments of the present invention.
FIG. 5B is an exemplary screenshot of a view and its associated model of the dataset in accordance with some embodiments of the present invention.
FIGS. 6A through 6Q are exemplary screenshots of different views of the dataset in accordance with some embodiments of the present invention.



Like reference numerals refer to corresponding parts throughout the several views of the drawings.
DETAILED DESCRIPTION OF THE INVENTION
The present invention provides methods, computer program products, and computer systems for automatically generating and displaying models derived from a multi-dimensional dataset. In a typical embodiment, the present invention builds and displays a view of the dataset based on a user specification of the view. Based on the user specification, the present invention calculates parameters of one or more model formulas associated with the dataset. The model formulas are automatically presented to the user together with the view of the dataset.
The present invention operates on a set of tuples, commonly referred to as a multi-dimensional dataset. As one skilled in the art will realize, the dataset can be a relational database, a multi-dimensional database, a semantic abstraction of a relational database, or an aggregated or unaggregated subset of a relational database, multi-dimensional database, or semantic abstraction. Fields are categorizations of data in a dataset. A tuple is an entry of data (such as a record) in the dataset, specified by properties from fields in the dataset. A search query across the dataset returns one or more tuples.
A view is a visual representation of a dataset or a transformation of that dataset. Text tables, bar charts, line graphs, and scatter plots are all examples of types of views. Views contain marks that represent one or more tuples of a dataset. In other words, marks are visual representations of tuples in a view. A mark is typically associated with a type of graphical display. Some examples of views and their associated marks are as follows:














View Type
Associated Mark









Table
Text



Scatter Plot
Shape



Bar Chart
Bar



Gantt Plot
Bar



Line Graph
Line Segment



Circle Graph
Circle










FIG. 2 is a block diagram illustrating a computer system that facilitates the visualization of a dataset in accordance with some embodiments of the present invention. The system 100 includes a memory 102, CPU 180, user interface 184, storage unit 194, disk controller 192, and a bus 182 that “enables communication along” all of the system's elements. The system 100 may also have a network interface card (NIC) 196 to enable communication with other systems on a different network. The memory 102 stores an operating system 104, and a file system 106, as well as various modules related to the present invention. Additionally, the memory 102 may also store a multi-dimensional dataset 140, which contains tuples. The system 100 may also be connected to database 150 where a dataset may be retrieved and stored in the memory 102. The memory 102 also stores computer program mechanisms that are necessary to some embodiments of the present invention.
FIG. 3A is a flowchart illustrating a process of loading a multi-dimensional dataset into a computer system in accordance with some embodiments of the present invention. At step 310, the computer system receives a multi-dimensional dataset. This dataset is specified by a user through a graphical user interface to the computer system. In some embodiments, the dataset stored on the same computer system. The computer system can access the dataset through the disk controller. In some other embodiments, the dataset is located in a remote database connected to the computer system through a network. The computer system can retrieve the dataset from the database by submitting queries to the database.
At step 315, the computer system generates one or more properties for each field of the dataset. One of the properties is a field type. Generally speaking, the fields of a dataset have one of two field types, “categorical” or “quantitative”. A categorical field is one whose domain is an enumerable set of values. For example, the “State” field in the spreadsheet of FIG. 1 is a categorical field. The “State” field has only 50 possible values because there are only 50 states in the United States. Different values like “California”, “Colorado”, and “Florida” correspond to different geographical regions. For convenience, these values are often displayed in alphabetical order. In contrast, the “Date” field takes on a set of enumerable values in terms of year, quarter, or month, etc. Unlike the “State” field, the values corresponding to the “Date” field have a quantitative interpretation. For example, April, 2006 is obviously after March, 2006, but before May, 2006. In other words, the values corresponding to the “Date” field are ordinal.
In contrast, the value of a quantitative field is always ordinal, which may be continuous or discrete. For example, the “Sales” field in the spreadsheet has values such as “441”, “681”, and “382.” Although they are not displayed in an increasing or decreasing order in the table, the value “441” is clearly larger than the value “382” and smaller than the value “681.” Moreover, the possible value of a quantitative field is usually continuous, not discrete. For example, the value of the “Sales” field can be any real number from zero to infinity. As will become apparent below, this dichotomy of fields into categorical and quantitative types is important when the computer system subsequently generates models for the dataset in accordance with the present invention.
At step 320, based on the properties associated with different fields, the computer system partitions all the fields into two classes, “dimension” and “measure.” A field in the dimension class is one to which some aggregate operations (e.g., sum or average) have not been applied. On the other hand, a field in the measure class is one whose values can be summed or averaged and produce a meaningful result. For example, the sum (or average) of the values in the “Sales” field provides the total (or average) sales revenue within a specified time period.
Although quantitative fields are often in the measure class and categorical fields are usually in the dimension class, there are exceptions. For example, the fields related to the longitude and latitude of a geographical location are quantitative fields since their values are continuous. But there is no reasonable interpretation of the sum of the values in these fields.
The class affiliation of a field often provides hints on what type of role the field plays in the description of a view of the dataset. For example, the “Sales” field is in the measure class. Its value depends upon the value in the “State” field, the value in the “Product” field and the value in the “Date” field. Different products sold in different states at different times may have different sales revenues. In contrast, the “State” field is in the dimension class. Its value is not apparently dependent upon any other field's value. But in some embodiments, there can be a relationship between one categorical field (e.g., “Product”) and another one (e.g., “Product Type”) although this relationship is hard to describe using a mathematical formula. This difference between the dimension class and the measure class is used by the computer system when generating model formulas from the dataset.
At step 325, the computer system displays the dimension and measure classes of fields. The fields in the dimension class are usually categorical fields to which some aggregate operations (e.g., sum or average) are not applicable. The fields in the measure class are often quantitative fields whose values can be summed or averaged together. For example, the sum (or average) of the values in the “Sales” field provides the total (or average) sales revenue. The two classes of fields are used by a user subsequently to formulate different descriptions of the dataset. Based on the descriptions, the computer system generates and displays different views of the dataset. These descriptions are also used for generating models corresponding to the different views.
FIG. 3B is an exemplary screenshot displaying the dataset after it is loaded into the computer system in accordance with some embodiments of the present invention. On the left of the screenshot are two classes of fields, the “Dimensions” class 330 and the “Measures” class 335. In this example, all the fields in the class 330 are categorical fields such as “Date”, “Market”, “State”, etc. All the fields in the class 335 are quantitative fields such as “Budget Margin”, “Inventory”, “Sales”, etc. To the right of the two classes is a region for a user to generate a description of a desired view of the dataset and the view itself.
FIG. 4A is a flowchart illustrating a process of displaying a view of the dataset based on a user-provided description in accordance with some embodiments of the present invention. As shown in FIG. 3B, the two classes of fields are displayed to a user of the computer system. In order to visualize the dataset, the user needs to provide a description of a view of the dataset. This description usually corresponds to the user's specific interest in a particular aspect of the dataset.
For example, presume that a user is interested in visualizing the total sales revenues for different states. A conventional approach to this problem requires that the user express his or her interest as a simple query using the structured query language (SQL):















SELECT State, SUM(Sales)



FROM Dataset



GROUP BY State;










The text result of executing the SQL query against the dataset is shown in the table below. A significant problem with this conventional approach is that a user must know how to express the user's interests using SQL.














State
SUM(Sales)



















California
310278



Colorado
151505



Connecticut
80953



Florida
119936



Illinois
223079



Iowa
175755



Louisiana
73747



Massachusetts
96949



Missouri
79414



Nevada
190453



New Hampshire
47792



New Mexico
50668



New York
223809



Ohio
109006



Oklahoma
88487



Oregon
130802



Texas
119079



Utah
112610



Washington
123825



Wisconsin
106087










Of course, this problem is more challenging as in many cases, a business-wise intuitive user's interest/hypothesis may correspond to a very complicated SQL query. Therefore, users with little or no SQL knowledge find it difficult to explore datasets using SQL queries. They have a strong need to express their interests in a way that is understood by both the users themselves and the computer system.
FIG. 4B is an exemplary screenshot displaying a description and a view of the dataset in accordance with some embodiments of the present invention. At step 410, instead of an SQL query, a user characterizes his or her interest using a description corresponding to a view of the dataset. Using the same example, the user is interested in visualizing the total sales revenues for different states. Therefore, the description should include the “State” and “Sales” fields of the dataset. Intuitively, this interest can be formulated into a 2-D diagram. The horizontal axis of the 2-D diagram corresponds to the value in the “State” field of the dataset. The vertical axis corresponds to the sum of the value in the “Sales” field of the dataset and the total sales revenues for different states can be represented using a bar chart. In other words, the description associates the “State” and “Sales” fields with the horizontal and vertical axes of the 2-D diagram, respectively.
At step 415, the computer system displays each field in the description in a specific field container. Accordingly, the “State” field is displayed in a “Columns” field container 430 and the “SUM(Sales)” field is displayed in a “Rows” field container 435. At step 420, the computer system determines a set of properties for each field in the description. The computer system uses the properties of the different fields to configure the view associated with the description. In this example, since the “SUM(Sales)” field is a quantitative field from the measure class, the description, by default, automatically instructs the computer system to calculate the sum of the values in the “SUM(Sales)” field, each sum corresponding to one state. The “State” field is a categorical field from the dimension class. There is no need to automatically aggregate the values in this field. The properties of the different fields in a description are also used by the computer system to generate one or more model formulas for the data view associated with the description. Based on their respective properties, the computer system determines which fields are the independent variables of the model formulas, which are the dependent variables and which should be considered as additional factors. In some embodiments, the computer system makes these decisions using a set of heuristics/rules. A more detailed discussion of these heuristics is provided below in connection with FIGS. 6A through 6Q.
At step 425, the computer system displays a view of the dataset based on the description. As shown in FIG. 4B, the resulting bar chart 440 is a graphical visualization of the table listing the total sales revenues for different states in the alphabetical order. As illustrated in this example, the State field in the Columns field container 430 determines the column position (x-position) for each bar. The SUM(Sales) field in the Rows field container 435 determines the height of each bar (i.e., the row position or y-position).
After a simple glance at the view, the user can easily tell that California has the largest total sales revenue and New Hampshire has the lowest within a specified time period (from 2002 to 2003). The total sales revenue of a particular state encompasses the sales of all different types of products at the state during the two years. A more detailed description of visualizing a dataset based on a user-provided description can be found in U.S. patent application Ser. No. 11/223,658, “Computer Systems and Methods for Automatically Viewing Multidimensional Databases”, which is incorporated herewith in its entirety for reference.
Very often, a user's interest is much more complicated than the one discussed above and involves more than two fields. This user interest may have to be translated into a multi-dimensional view of the dataset. To support this multi-dimensional view, the computer system provides more than two field containers to host different fields. For example, the user may be interested in visualizing the total sales revenues for different states for different years (e.g., 2002 and 2003). This requirement inevitably involves the “Date” field. To do so, the user can augment the current description by dropping the “Date” field into the “Pages” field container 445. By default, the computer system separates sales data associated with Year 2002 from sales data associated with Year 2003. For each year, the computer system generates a separate bar chart. The user can view each individual bar chart to see the sales records for different states for each year. FIG. 4B depicts additional encoding field containers such as the “Text” 450, the “Color” 455, and the “Size” 460. A more detailed discussion of these field containers is provided below in connection with FIGS. 6A through 6Q.
In some embodiments, visualization of a dataset as shown in FIG. 4B is not enough. For example, a user may be interested in making forecasts from the existing data. Making a prediction from known information is a modeling process. Such a process generates an analytical formula for the dataset or a subset. For convenience, the two terms, model and analytical formula (or formula), are used interchangeably in this specification. An analytical formula usually has multiple parameters and the values of the parameters are determined from the existing data values in the dataset using tools such as statistical modeling. Statistical modeling is a well-known method for simplifying descriptions or interpretations of data using statistical models. The statistical models are constructed from some mathematically or numerically defined relationships. A more detailed description of statistical modeling can be found in “Statistical Models in S” (edited by John M. Chambers and Trevor J. Hastie), Chapman & Hall/CRC (1991), which is incorporated herewith in its entirety for reference.
FIG. 5A is a flowchart illustrating a process of generating and displaying a model of the dataset in accordance with some embodiments of the present invention. At step 510, the computer system receives an instruction from the user to translate the description into a model formula for the current data view on display. After getting the instruction at step 515, the computer system determines if it is possible to translate the description into any model formula. The computer system makes this determination by examining the properties of the fields involved in the current view and their respective properties in the view.
Sometimes, it may be impossible or meaningless to derive a model formula from a description. The description shown in FIG. 4B is such an example. As noted above, the description has two fields, “Sales” and “State.” Although the bar chart organizes the states in the alphabetical order, the “State” field is a categorical field and its values are not ordinal per se. For example, it is impossible to predict the total sales revenue at a state not listed in the table, e.g., Alaska, from the existing data. The total sales revenue at Philadelphia may be correlated with its population size. But it has nothing to do with the state name “Philadelphia.” As a result, the computer system terminates the process by skipping steps 520 and 525.
In many other cases, it is possible to translate a description into an analytical model formula that makes business sense. FIG. 5B depicts another description and its associated view. In this example, it is the “Budget Sales” field, not the “State” field, in the “Columns” field container 530, and the “Sales” column remains in the “Rows” field container 535. Each circle represents a data point whose column position (x-position) is specified by the Budget Sales field in the Columns field container 530 and whose row position (y-position) is specified by the Sales field in the Rows field container 535. A correlation of the values in the two fields indicates the accuracy of the prediction of the sales revenue from the budget sales revenue.
In some embodiments, the description is not generated by a user dragging and dropping different fields into respective field containers. Rather, the user may generate a text string, e.g., using extensible markup language (XML). The text string includes instructions of associating different fields with respective field containers. The computer system generates the models by interpreting the text string.
At step 520, the computer system calculates the parameters of a model formula simulating the correlation of the two fields. Ideally, the actual sales revenue should be equal to the budget sales revenue. In this example, the computer system simulates this linear relationship with a model formula:

y=ax+b, 

where x represents the budget sales revenue and y represents the actual sales revenue, and a and b are coefficients that can be determined from the dataset using statistical methods.

Using the corresponding values in the dataset, the computer system calculates the parameters a and b. As a result, they are, respectively,

a=0.945,

b=77.1.

Clearly, the actual sales revenue is about 95% of the budget sales revenue. In other words, the predicted value is slightly higher than the actual outcome. As step 525, the computer system displays the graph 540 of the simulated relationship, y=0.945x+77.1, on top of the view of the dataset. A more details discussion of the process of generating various analytical models from a dataset is provided below.
The computer system used to perform these embodiments of the present invention is shown in FIG. 2. In particular, the field receiver 108 performs step 410 by receiving fields selected by the user. The resulting view selector 110 performs step 420 and selects a resulting view. The dataset displayer 112 performs step 425 and displays the dataset according to the resulting view.
According to one embodiment of the invention, the resulting view selector 110 selects the resulting view by choosing rule(s) for the user selected fields. This is accomplished by the rule chooser 114. The rule applier 116 then applies the rule(s) to determine the resulting view's view type. In another embodiment of the invention, before the rule chooser 114 chooses rule(s), the view determiner 118 determines whether there is any view corresponding to the user selected fields or the description. In yet another embodiment of the invention, the dataset is displayed in when the mark chooser 126 chooses a mark for the resulting view, and the dataset renderer 128 renders the dataset according to the mark.
As noted above, there may be some inherent relationships between different fields of a description. For example, the fields in the “Row” container may be dependent upon the fields in the “Column” container. This relationship is often embedded in the dataset or a subset thereof. Sometimes, the relationship may have an analytical expression. The analytical expression and its graphical counterpart provide a user with more insight into the dataset. Accordingly, the computer system can generate model formulas simulating the relationships between different fields of the description using the underlying dataset. On the other hand, not every relationship between a column field and a row field of the description has an analytical expression that makes sense to the user. The description shown in FIG. 4B is one of the examples. In some other embodiments, the computer system may assign a quantitative interpretation (e.g., a digital value) to each state shown in the figure and then generate an analytical expression accordingly from different states.
The present invention describes a set of heuristics. This set of heuristics is used for interpreting various descriptions of datasets. In particular, when a user provides a description of a dataset to the computer system, the computer system applies the set of heuristics to the description and selects appropriate fields from the description to generate different model formulas for the selected fields. These heuristic-based model formulas may reveal the inherent relationships between the different fields of the description and therefore give the user more insight into the dataset.
In some embodiments, a generic model formula can be expressed in the following format:

y=M1opM2op . . . opMNopf(x),

where the terms x and y are the independent and response variables of the formula, and some of the parameters M1, M2, . . . , MN are the factors of the formula. The operator op determines whether the two operands on both sides of the operator interact. The expression f(x) may take on one of many known model types including linear, polynomial, exponential, logarithmic, transcendental, and other mathematical functions. Each model type has one or more coefficients. These coefficients are determined by the computer system using data selected from a dataset. The variables and factors correspond to different fields in a user-provided description of a view of the dataset. The data values associated with the independent and response variables are directly involved in the computation of the coefficients.

The generic expression of the coefficients of a model can be expressed as follows:

y=Dc, 

where y is a vector containing the values of the response variable, D is a design matrix, and c is the set of coefficients of the model to be generated. The elements of the design matrix D depend on the values of the factors and the independent variables. The solution to coefficient set c can be expressed as:

c=(DTD)−1DTy, 

where DT is the transpose of the matrix D and (DTD)−1 is the inverse of the square matrix (DTD).

For illustrative purposes, assume that the computer system simulates the relationship between the independent variable x and the response variable y using a quadratic equation. It will be apparent to one skilled in the art that the methodology discussed below can be easily applied to other types of models.
In particular, this quadratic equation can be expressed as:

y=M(ax2+bx+c),

where a, b, c are the coefficients of the quadratic equation and M is a categorical factor that has three possible values u, v, and w. In this example, every categorical value u, v, or w is associated with a unique set of coefficients ai, bi, and ci or

(M=u) ̃(a1,b1,c1),

(M=v) ̃(a2,b2,c2),

(M=w) ̃(a3,b3,c3).

The table below lists the N tuples derived from the dataset, which will be used to determined the three sets of coefficients ai, bi, and ci:

















y
M = u
M = v
M = w
x









y1
1
0
0
x1



y2
0
1
0
x2



. . .
. . .
. . .
. . .
. . .



yN
0
0
1
xN










Based on the N tuples, the generic expression of the coefficients can be expressed as:




  
    [
    
      
        
          
            y
            1
          
        
      
      
        
          
            y
            2
          
        
      
      
        
          ⋮
        
      
      
        
          
            y
            N
          
        
      
    
    ]
  
  =
  
    
      [
      
        
          
            
              x
              1
              2
            
          
          
            0
          
          
            0
          
          
            
              x
              1
            
          
          
            0
          
          
            0
          
          
            1
          
          
            0
          
          
            0
          
        
        
          
            0
          
          
            
              x
              2
              2
            
          
          
            0
          
          
            0
          
          
            
              x
              2
            
          
          
            0
          
          
            0
          
          
            1
          
          
            0
          
        
        
          
            ...
          
          
            ...
          
          
            ...
          
          
            ...
          
          
            ...
          
          
            ...
          
          
            ...
          
          
            ...
          
          
            ...
          
        
        
          
            0
          
          
            0
          
          
            
              x
              N
              2
            
          
          
            0
          
          
            0
          
          
            
              x
              N
            
          
          
            0
          
          
            0
          
          
            1
          
        
      
      ]
    
    ⁡
    
      [
      
        
          
            
              a
              1
            
          
        
        
          
            
              a
              2
            
          
        
        
          
            
              a
              3
            
          
        
        
          
            
              b
              1
            
          
        
        
          
            
              b
              2
            
          
        
        
          
            
              b
              3
            
          
        
        
          
            
              c
              1
            
          
        
        
          
            
              c
              2
            
          
        
        
          
            
              c
              3
            
          
        
      
      ]
    
  




As noted above, the user provides a description of the view by dragging and dropping fields from the two classes into different field containers. The computer system then automatically transforms this description into model formulas. A key part of this transformation process is deciding which fields become the categorical factors in the model formulas and which fields become the independent and response variables.
The principle of transforming a user-provided description into a model formula is to select two fields from the description, which may be potentially related, as the independent and response variables of the model formula, respectively, and treat the remaining categorical fields in the description as factors of the model formula. This transformation should match the user's expectation of examining whether and how the responsible variable field is dependent upon the independent variable field and whether and how the different factors affect this dependency relationship.
In some embodiments, this general criterion can be fine tuned into a set of heuristics as follows:

    
    
        Rule One: Determination of the response and independent variables:
        
            If there is only one quantitative field in either the row or column field containers, it is the response variable of the formula.
            If there are quantitative fields in both the row and column field containers, the quantitative field from the dimension class is the independent variable and the remaining quantitative field is the response variable.
            
                If both the quantitative fields are from the dimension class, the quantitative field in the row field container is the response variable.
                If neither of the quantitative fields is from the dimension class, the quantitative field in the row field container is the response variable.
            
            
            The field chosen as the independent variable must have a quantitative interpretation.
        
        
        Rule Two: Categorical fields in the row, column, and pages field containers are factors in the model formula if they are not the independent variables of the model formula.
        Rule Three: Categorical fields in any encoding field containers are factors in the model formula if there are more than one data points corresponding to each value in the categorical fields.
        Rule Four: If there are multiple quantitative fields in the row or column field containers, the computer system generates multiple model formulas.
        Rule Five: Quantitative fields in any encoding field containers are not factors in the model formula.
        Rule Six: Missing values from the domain of a categorical independent variable of a model formula are added.
    
    


FIGS. 6A through 6Q are exemplary screenshots of different views of the dataset. The computer system generates these views and their associated model formulas, in part, by applying one or more of the aforementioned heuristics to the respective descriptions of the views.
FIG. 6A depicts a description of the dataset. The description involves three fields of the dataset. In particular, the “MONTH(Date)” field 601 is in the column field container, the “SUM(Profit)” field 603 is in the row field container and the “Product Type” field 605 is in the color field container. According to Rule Three, the “Product Type” field 605 is a categorical factor because there are more than one data points corresponding to each individual product type. Note that the “MONTH(Date)” field 601 is a categorical field, although it has a quantitative interpretation. Therefore, according to Rule One, the “SUM(Profit)” field 603 is the response variable because it is the only quantitative field in either the row or the column field container. Although the “MONTH(Date)” field 601 is a categorical field, it is the independent variable because it has a quantitative interpretation.
There is a small window 607 at the lower-left corner of FIG. 6A. The window 607 includes the color legend representing different product types with different colors. The graphical region of FIG. 6A contains four curves of different colors, curve 609 for Coffee, curve 611 for Espresso, curve 613 for Smoothie and curve 615 for Tea. Because the “MONTH(Date)” field on the horizontal axis is the independent variable and the “SUM(Profit)” field on the vertical axis in the response variable, the computer system automatically plots the curves in the left-right orientation.
Since there are independent and response variables in the description according to the heuristics, the computer system can generate a model formula in response to the user instructions. FIG. 6A depicts four dashed lines of different colors corresponding to the model formula. In particular, the dashed line 609-1 predicts the linear trend of the total profit vs. the month for Coffee. Since the “Product Type” field is a categorical factor having four members, “Coffee”, “Espresso”, “Smoothie”, and “Tea”, the computer generates a single model formula for the four product types. In some embodiments, the one model formula is replaced with four sub-model formulas, one for each product type.
FIG. 6B is a screenshot of a text-based view of the dataset corresponding to the graphical curves shown in FIG. 6A. The “MONTH(Date)” field 601 remains in the column field container. But the “Product Type” field 605 now occupies the row field container and the “SUM(Profit)” field 603 moves the text field container. The text-based table is divided into three regions 602, 604 and 606. The region 602 contains the 12 months in the “Date” field, each month occupying one column. The region 604 contains the four product types in the “Product Type” field. The region 606 contains the total profits of different product types at different months. For example, the total profits of Coffee at the 12 months are listed in the top row in the region 606. This row of data values corresponds to the curve 609 shown in FIG. 6A.
FIG. 6C depicts another description of the dataset. This description is similar to the one shown in FIG. 6A except that the “MONTH(Date)” field 601 is in the row field container and the “SUM(Profit)” field 603 is in the column field container. According to Rule Three, the “Product Type” field 605 remains to be a categorical factor. According to Rule One, the “SUM(Profit)” field 603 is the response variable because it is the only quantitative field in either the row or the column field container and the “MONTH(Date)” field 601 is the independent variable because it has a quantitative interpretation.
Because of the switch of the “MONTH(Date)” field 601 and the “SUM(Profit)” field 603, the vertical axis in FIG. 6C corresponds to the independent variable and the horizontal axis is associated with the response variable. The computer system automatically plots the four curves in a top-bottom orientation. As a result, the curves in the graphical region of FIG. 6C are rotated by 90°. Similarly, the four dashed lines of different colors corresponding to the model formula are also rotated by 90°. FIG. 6D is a screenshot of a text-based view of the dataset corresponding to the graphical curves shown in FIG. 6C. The 12 months in the region 602 are now displayed as 12 different rows. The four product types in the region 604 are now displayed as four different columns. The data in the region 606 are also rotated by 90° such that the total profits of Coffee at the 12 months are listed in the leftmost column in the region 606. This column of data values corresponds to the rightmost curve shown in FIG. 6C.
Clearly, in either example, there is no need for the user to expressly specify the two fields. Nor does the user have to instruct the computer system which fields are the respective independent and response variables. The computer system automatically figures them out by applying the relevant heuristics to the respective descriptions.
FIG. 6E depicts another description of the dataset. In this example, the “Profit” field is in the column field container, the “Budget Profit” field is in the row field container, and the “Market” field is in the color field container. According to Rule One, since both the “Profit” and “Budget Profit” fields are quantitative fields and neither is from the dimension class, the “Budget Profit” field is the response variable and the “Profit” field is the independent variable of the model formula. According to Rule Three, the “Market” field is a factor of the model formula since there are more than one data point for each market. Accordingly, the computer system generates one model formula or four sub-model formulas, one for each market. The slopes of the four colored lines indicate the accuracy of the profit predictions for the four respective geographical regions.
FIG. 6F is a screenshot of the same view after the “Profit” and “Budget Profit” fields are aggregated. Due to the summation, the computer system plots one small circle using a respective color for each geographical region. According to Rule Three, the aggregation of the “Profit” and “Budget Profit” fields renders the “Market” field no longer to be a categorical factor of the model formula because there is only one data point for each market. As a result, the computer system only generates one model formula using the remaining four data samples in the view.
FIG. 6G is a screenshot illustrating multiple views of the dataset corresponding to a single description. As shown in FIG. 6G, the column field container includes two fields, “Product Type” and “Profit”, and the row field container includes one field, “Budget Profit.” According to Rule Two, the “Product Type” field is a factor of the model formula because it is not the independent variable of the model formula. According to Rule One, the “Profit” field is the independent variable and the “Budget Profit” field is the response variable. The computer system generates four model formulas and displays them side by side in the alphabetical order along with their respective data views.
Similarly, the “Product Type” field is moved from the column field container to the row container in FIG. 6H. According to Rule Two, the field is still treated as a factor. The computer system generates four model formulas, one for each product type, and displays them from top to bottom in the alphabetical order along with their respective data views.
As shown in FIGS. 6I and 6J, the “Product Type” field is moved to the pages field container. According to Rule Two, this field is still treated as a factor of the model formula. The computer system, in response, generates the same four model formulas, one for each product type. The user can visualize the views of different product types separately using the dropdown menu 620. For example, the view and model formula in FIG. 6I correspond to coffee. The view and model formula in FIG. 6J correspond to tea.
FIG. 6K depicts a view of the dataset according to a description. The description includes two quantitative fields, “Profit” and “Marketing”, in the column field container and one quantitative field, “Sales”, in the row field container. According to Rule Four, the computer system generates two model formulas, “Sales” vs. “Profit” and “Sales” vs. “Marketing.” In the description associated with FIG. 6L, the two quantitative fields, “Profit” and “Marketing”, are moved to the row field container and the one quantitative field, “Sales”, is move to the row field container. The computer system, accordingly, generates two model formulas, “Profit” vs. “Sales” and “Marketing” vs. “Sales.” If there are M quantitative fields in the column and N quantitative fields in the row field containers, the computer system will generate M by N model formulas.
FIG. 6M is a screenshot of a view including a quantitative field, “Inventory” 630, in the color field container. According to Rule Five, a quantitative field in any encoding field container is not treated as a categorical factor. Therefore, the computer system generates a single model formula for the view of the dataset. A small window 635 in the screenshot includes a color spectrum, different color values in the spectrum corresponding to different inventory values. The computer system plots different circles using different color values based upon the inventory values associated with the circles.
Statistical modeling can not only predict the trend of two correlating fields but also provide values missing from a dataset. FIG. 6N depicts a curve 640 illustrating the total sales revenue as a function of the month. However, a close look at the horizontal axis reveals that the total sales revenues associated with May, June and July are missing from the curve 640. According to Rule Six, the computer system generates a model formula using the remaining data shown in the figure. FIG. 6O depicts a diagram including a line 643 representing the model formula. The diagram includes not only the existing data shown in FIG. 6N but also the three months 645 that are missing in FIG. 6N.
Given a dataset and a user-provided description of a view of the dataset, the computer system can generate different types of model formulas including linear, polynomial, exponential, logarithmic, transcendental and other mathematical functions. In most occasions, a model formula based on the linear regression gives the user a reasonable insight into the dataset. But in some cases, the user may be interested in simulating the data using a more complex model.
FIGS. 6P and 6Q depict two types of model formulas, respectively. The linear relationship shown in FIG. 6P indicates that there is a growing trend for the total sales revenue throughout the whole year. But the 5-degree polynomial in FIG. 6Q captures the up and down of the total sales revenue within the year. On the face, the polynomial seems to a closer fit of the actual data than the linear trend. However, this does not guarantee that the polynomial can provide the user with more insight into the dataset.
In some embodiments, the computer system automatically generates multiple model formulas for the same dataset. The multiple model formulas may correspond to different model types and/or have different degrees of freedom or different numbers of parameters for the same model type. Next, the computer system automatically selects one or several of the multiple model formulas that have fewer parameters, but still provide a good fit of the dataset according to one or more predefined criteria (e.g., in a visualization sense). Sometimes, this selection process may need some level of user guidance. In this case, the computer system provides an interface for a user to offer input, e.g., by excluding some model types from the selection process. As a result, model formulas that uses simpler models, but fit nearly as well as more complicated models, are chosen to represent the dataset. A simpler model formula makes it easier for the user to make informed predictions from the available data.
In some other embodiments, a user does not need to expressly provide a description of a view of the dataset. Rather, the user just selects a set of fields that the user is interested in. Based on the user-selected fields of interest, the computer system automatically creates one or more descriptions, each description including a subset of the selected fields of interest. As noted above, each field of a description should be associated with one of the multiple field containers. In order to find the most appropriate field containers for each field of interest, the computer system determines the properties of the fields of interest and calculates the dependencies between different fields based on their respective properties. After taking into account of various information items including the properties, the dependencies between fields, the field types and classes and the categorical field cardinalities, the computer system selects one or more descriptions that provide best views of the dataset. In some embodiments, the computer system also generates the model formulas associated with the descriptions and analyzes these model formulas to select the view(s) in which the model formulas fit the dataset or a subset of the dataset particularly well.
As noted above, the generation of model formulas is essentially statistical modeling. Therefore, in some embodiments, the computer system not only generates and displays the model formulas but also provide a set of statistical measures associated with the model formulas and the dataset. For example, one statistical measure is the residual between a model formula and the source data used for estimating the model formula. When a user drops this statistical measure into the color field container, the computer system can color the source data according to their respective residual values, i.e., the distance between the source data and the model formulas. One skilled in the art will understand that there are many possible statistical measures include residual, residual squared, P-value, slope (only available for linear fitting), and model formula predicted values, etc.
The present invention not only accepts datasets and databases as inputs, it also accepts views as inputs. A view can be used to represent a set of fields. For example, rules or operators can take into account the current view to generate a new view that is related to the current view. Also, as one skilled in the art will realize, many other rules are possible, including ones for generating multi-dimensional model formulas like y=f(x1, x2, . . . , xN).
The present invention can be implemented as a computer program product that comprises a computer program mechanism embedded in a computer readable storage medium. For instance, the computer program product could contain the program modules shown in FIG. 2. These program modules may be stored on a CD-ROM, magnetic disk storage product, or any other computer readable data or program storage product. The software modules in the computer program product can also be distributed electronically, via the Internet or otherwise, by transmission of a computer data signal (in which the software modules are embedded) on a carrier wave.
Many modifications and variations of this invention can be made without departing from its spirit and scope, as will be apparent to those skilled in the art. The specific embodiments described herein are offered by way of example only, and the invention is to be limited only by the terms of the appended claims, along with the full scope of equivalents to which such claims are entitled.
All references cited herein are incorporated herein by reference in their entirety and for all purposes to the same extent as if each individual publication or patent or patent application was specifically and individually indicated to be incorporated by reference in its entirety for all purposes.

## Claims

1. A method, comprising:
at a computer system having one or more processors and memory storing one or more programs configured for execution by the one or more processors:
providing a graphical user interface for a user to specify characteristics of a data visualization;
receiving, through the provided user interface, user selection of a plurality of fields from a dataset and user association of each field in the plurality of fields with a respective field container in the user interface, wherein the plurality of fields includes a first field and a second field of the dataset, and each field container corresponds to a data visualization characteristic;
determining a set of data properties for each of the first and second fields;
generating a statistical model of a mathematical relationship between the first and second fields based on the data properties of the first and second fields and data values associated with the first and second fields in the dataset, wherein the mathematical relationship expresses one of the first and second fields as a response variable that is a function of the other of the first and second fields based on the determined set of data properties for the first and second fields; and
displaying the data visualization in the user interface according to the user associations of the plurality of fields with the field containers and displaying a graphical representation of the statistical model superimposed on the data visualization.

2. The method of claim 1, wherein the determined set of data properties of each of the first and second fields includes a field type selected from the group consisting of categorical and quantitative.

3. The method of claim 1, wherein the determined set of data properties of each of the first and second fields includes a field class selected from the group consisting of dimension and measure.

4. The method of claim 1, wherein the first field is associated with a field container that specifies row position in the data visualization and the second field is associated with a field container that specifies column position in the data visualization.

5. The method of claim 4, wherein the user designates one or more fields, including the first field, to specify row position in the data visualization, and the user designates one or more fields, including the second field, to specify column position in the data visualization.

6. The method of claim 1, wherein the determined set of data properties of each of the first and second fields includes a field type selected from the group consisting of categorical and quantitative.

7. The method of claim 6, wherein the first field is selected as the response variable when the first field is the only quantitative field in the plurality of fields associated with a field container that specifies row position or column position in the data visualization.

8. The method of claim 6, wherein the determined set of data properties of each of the first and second fields includes a field class selected from the group consisting of dimension and measure, and wherein the first field is selected as the response variable when the first and second fields are both quantitative fields associated with field containers that specify row position or column position in the data visualization and the field class data property of the second field is dimension.

9. The method of claim 6, wherein the determined set of data properties of each of the first and second fields includes a field class selected from the group consisting of dimension and measure, and wherein the first field is selected as the response variable when the first and second fields are both quantitative fields associated with field containers that specify row position or column position in the data visualization and the field class data property of the first field is the same as the field class property of the second field.

10. The method of claim 6, wherein the plurality of fields includes a third field associated with a field container that specifies row position or column position in the data visualization, the method further comprising generating one or more additional statistical models based on the third field.

11. The method of claim 10, wherein the third field has a categorical field type, and wherein the generated one or more additional statistical models include a respective model corresponding to each respective distinct data value of the third field.

12. The method of claim 6, wherein the plurality of fields includes a fourth field associated with a field container that specifies a data mark encoding for the data visualization, and wherein the fourth field has a categorical field type, the method further comprising generating one or more additional statistical models based on the fourth field when retrieved data tuples from the dataset include two or more tuples with a same data value for the fourth field.

13. The method of claim 1, wherein the user associates each of the first and second fields with a respective field container by dragging and dropping each of the first and second fields into respective row position and column position field containers in the graphical user interface.

14. A computer system for generating a statistical model, comprising:
one or more processors;
memory; and
one or more programs stored in the memory configured for execution by the one or more processors, the one or more programs comprising instructions for:
providing a graphical user interface for a user to specify characteristics of a data visualization;
receiving, through the provided user interface, user selection of a plurality of fields from a dataset and user association of each field in the plurality of fields with a respective field container in the user interface, wherein the plurality of fields includes a first field and a second field of the dataset, and each field container corresponds to a data visualization characteristic;
determining a set of data properties for each of the first and second fields;
generating a statistical model of a mathematical relationship between the first and second fields based on the data properties of the first and second fields and data values associated with the first and second fields in the dataset, wherein the mathematical relationship expresses one of the first and second fields as a response variable that is a function of the other of the first and second fields based on the determined set of data properties for the first and second fields; and
displaying the data visualization in the user interface according to the user associations of the plurality of fields with the field containers and displaying a graphical representation of the statistical model superimposed on the data visualization.

15. The computer system of claim 14, wherein the first field is associated with a field container that specifies row position in the data visualization and the second field is associated with a field container that specifies column position in the data visualization.

16. The computer system of claim 14, wherein the determined set of data properties of each of the first and second fields includes a field type selected from the group consisting of categorical and quantitative.

17. The computer system of claim 16, wherein the one or more programs further comprise instructions for selecting the first field as the response variable when the first field is the only quantitative field in the plurality of fields associated with a field container that specifies row position or column position in the data visualization.

18. The computer system of claim 16, wherein the plurality of fields includes a third field associated with a field container that specifies row position or column position in the data visualization, the method further comprising generating one or more additional statistical models based on the third field.

19. A non-transitory computer readable storage medium storing one or more programs configured for execution by a computer system that includes one or more processors and memory, the one or more programs comprising instructions for:
providing a graphical user interface for a user to specify characteristics of a data visualization;
receiving, through the provided user interface, user selection of a plurality of fields from a dataset and user association of each field in the plurality of fields with a respective field container in the user interface, wherein the plurality of fields includes a first field and a second field of the dataset, and each field container corresponds to a data visualization characteristic;
determining a set of data properties for each of the first and second fields;
generating a statistical model of a mathematical relationship between the first and second fields based on the data properties of the first and second fields and data values associated with the first and second fields in the dataset, wherein the mathematical relationship expresses one of the first and second fields as a response variable that is a function of the other of the first and second fields based on the determined set of data properties for the first and second fields; and
displaying the data visualization in the user interface according to the user associations of the plurality of fields with the field containers and displaying a graphical representation of the statistical model superimposed on the data visualization.

20. The computer readable storage medium of claim 19, wherein the first field is associated with a field container that specifies row position in the data visualization and the second field is associated with a field container that specifies column position in the data visualization.

21. The computer readable storage medium of claim 19, wherein the determined set of data properties of each of the first and second fields includes a field type selected from the group consisting of categorical and quantitative.

22. The computer readable storage medium of claim 21, wherein the one or more programs further comprise instructions for selecting the first field as the response variable when the first field is the only quantitative field in the plurality of fields associated with a field container that specifies row position or column position in the data visualization.

23. The computer readable storage medium of claim 21, wherein the plurality of fields includes a third field associated with a field container that specifies row position or column position in the data visualization, the method further comprising generating one or more additional statistical models based on the third field.