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:
defining a plurality of set of rules, wherein each set of rules corresponds to a predictive model for predicting click-through rates for an advertisement;
storing the each set of rules corresponding to the predictive model in a library, wherein the each set of rules corresponding to the predictive model is stored as a user-defined function in the library;
building the predictive model using a training data set, wherein the training data set includes multiple features used as input parameters to train the predictive model for classification of values to find a probability 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 the probability of the user clicking on the advertisement; and
providing the output.
2. The method as claimed in claim 1 , wherein the user-defined function is called via a standard sequel language.
3. A system for analyzing data in a database, the system comprising:
a processor; and
a memory, coupled to the processor, that includes code modules stored therein that are executable by the processor, wherein the code modules include:
a rule definition module, wherein the rule definition module is configured to define a plurality of set of rules, wherein each set of rules corresponds to a predictive model for predicting click-through rates for an advertisement;
a storage module, wherein the storage module is configured to store the each set of rules corresponding to the predictive model in a library as a user-defined function;
a predictive model building module configured to build the predictive model using a training data set, wherein the training data set includes multiple features used as input parameters to train the predictive model for classification of values to find a probability of a user clicking on the advertisement;
a function-calling module, wherein the function-calling module is configured to call the user defined function in a database query, wherein the user-defined function is called to analyze the data in the database;
an invoking module configured to invoke 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;
a processing module configured to process the data responsive to the database query with the user-defined function to generate an output responsive to the user-defined function that indicates the probability of the user clicking on the advertisement; and
an output module configured to providing the output.
4. The system as claimed in claim 3 , wherein the function-calling module calls the user defined function via a standard sequel language.