Method and system for analyzing data in a database
A method and system analyze data in a database. The method and system include defining a plurality of set of rules, wherein each set of rules corresponds to a predictive model, storing the each set of rules corresponding to the predictive model in a library as a user-defined function and calling the user-defined function via a standard sequel language.
1. A method for analyzing data in a database, the method comprising:
executing code by a processor to perform operations comprising:
storing a plurality of sets of rules corresponding to a predictive model in a library, wherein each set of the rules corresponds to the predictive model for predicting click-through rates for an advertisement, wherein:
each set of the rules is stored as a user-defined function in the library;
each set of the rules is defined to correspond to the predictive model; and
the predictive model is built using a training data set; and
the training data set includes multiple features used as input parameters to train the predictive model for classification of values of a user clicking on the advertisement;
calling the user-defined function in a database query, wherein the user defined function is called to analyze the data in the database;
invoking the user-defined function to operate on one or more rows in the database directly from a function-calling module to analyze the data in the database in accordance with the predictive model;
processing the data responsive to the database query with the user-defined function to generate an output responsive to the user-defined function that indicates a probability of the user clicking on the advertisement; and
providing the output.
2. The method of claim 1 , wherein the user-defined function is configured to operate on one or more rows in the database.
3. The method of claim 1 , wherein the user-defined function is called via a structured query language.
4. The method of claim 1 , wherein the features of the training data set include an advertisement type.
5. A non transitory, computer readable medium system comprising:
a processor; and
code that is executable by the processor for analyzing data in a database, wherein when the code is executed by the processor the processor performs operations comprising:
storing a plurality of sets of rules corresponding to a predictive model in a library, wherein each set of the rules corresponds to the predictive model for predicting click-through rates for an advertisement, wherein:
each set of the rules is stored as a user-defined function in the library;
each set of the rules is defined to correspond to the predictive model; and
the predictive model is built using a training data set; and
the training data set includes multiple features used as input parameters to train the predictive model for classification of values of a user clicking on the advertisement;
calling the user-defined function in a database query, wherein the user defined function is called to analyze data in the database;
invoking the user-defined function to operate on one or more rows in the database directly from a function-calling module to analyze the data in the database in accordance with the predictive model;
processing the data responsive to the database query with the user-defined function to generate an output responsive to the user-defined function that indicates a probability of the user clicking on the advertisement; and
providing the output.
6. The system of claim 5 , wherein the function-calling module calls the user defined function is called via a structured query language.
7. The system of claim 5 , wherein when the user defined function is called the processor applies the called user defined function on one or more rows in the database.
8. The system of claim 5 , wherein the features of the training data set include an advertisement type.