Summary of the invention
Based on the deficiencies in the prior art, the problem that the present invention need solve is: provide a kind of can making to recommend vegetable to have more intelligently recommending ordering dishes method and system scientific and that rationalize.
For addressing the above problem, the invention provides a kind of intelligently recommending ordering dishes method, it may further comprise the steps:
A, according to the order dishes attribute data of all vegetables in the database of the history obtained, generate the correlation rule collection to carrying out data mining between the attribute data of described all vegetables, described correlation rule collection is made up of many correlation rules, and calculates the degree of confidence that described correlation rule is concentrated every correlation rule;
Wherein, described correlation rule is made up of correlation rule former piece and correlation rule consequent, described correlation rule consequent is drawn by described correlation rule antecedent derivation, define described history and order dishes that the data set of the attribute data of all vegetables is P in the database, having N1 time in data set P occurs in the described correlation rule former piece, have N2 time again and described correlation rule consequent occurs, then the degree of confidence of described correlation rule is N2/N1*100%, is used to represent that described correlation rule in degree of confidence is is believable on the probability of N2/N1*100%;
B, receive first vegetable of user's input, and first vegetable of described input is stored to orders the vegetable database;
C, concentrated from described correlation rule, at the vegetable X in described all vegetables, seek coupling and order a kind of attribute data of orderring vegetable in the vegetable database or the attribute data of more than one combinations is the correlation rule former piece with described, with a kind of attribute data of described vegetable X or the attribute data of more than one combinations is the Attribute Association rule set of correlation rule consequent, and the degree of confidence addition calculation of every correlation rule in the described Attribute Association rule set that will obtain obtains the recommendation value of described vegetable X;
Wherein, X is one of them vegetable in described all vegetables;
D, the recommendation of each vegetable in described all vegetables is worth sorts, choose and recommend to be worth N forward vegetable of rank as recommending vegetable, and export described N recommendation vegetable, wherein, described N is the integer greater than 0;
E, judge whether to receive the vegetable of user's input, if then the vegetable of described input is stored to and has describedly order the vegetable database and continued step C; Otherwise, finish recommending ordering dishes.
In addition, step C be at each vegetable in all vegetables all calculated recommendation be worth.Recommend the quantity of vegetable to change for output N among the step D according to user's requirement, the quantity that can choose N is 5, if do not generate 5 eligible and recommend to be worth recommendation vegetable greater than 0, can choose then that vegetable is recommended the vegetable that rank is the highest in the sorting out value table or also can be other vegetable of choosing the dining room special recommendation, gather together enough 5 vegetables as recommending vegetable output.The vegetable of the user's input in the step e can be the vegetable of selecting from recommend vegetable, also can be the free vegetable of user, can also be the normal vegetable etc. of ordering that recommend in the dining room.
Preferably, the attribute data of described all vegetables comprises following attribute classification: major component attribute and characteristic attribute.Wherein characteristic attribute comprises following attribute subclass: taste, cooking methods, auxiliary material, condiment, the style of cooking and the place of production etc. can also be other attribute subclass according to user's requirements set.
Preferred, described steps A specifically comprises:
According to the order dishes major component attribute data of all vegetables in the database of the history of obtaining, carry out data mining between the major component attribute data to described all vegetables and generate major component correlation rule collection, described major component correlation rule collection is made up of many major component correlation rules, and calculates the degree of confidence that described major component correlation rule is concentrated every major component correlation rule;
According to the order dishes characteristic attribute data of all vegetables in the database of the history of obtaining, carry out data mining generating feature correlation rule collection between the characteristic attribute data to described all vegetables, described feature association rule set is made up of many feature association rules, and calculates the degree of confidence of every feature association rule in the described feature association rule set;
Described step C specifically comprises:
C1, described major component attribute and described characteristic attribute are set up major component attribute weights function and characteristic attribute weights function respectively;
C2, from described major component incidence set, at the vegetable X in described all vegetables, seek coupling and order a kind of major component attribute data of orderring vegetable in the vegetable database or the major component attribute data of more than one combinations is the correlation rule former piece with described, with a kind of major component attribute data of described vegetable X or the major component attribute data of more than one combinations is the major component Attribute Association rule set of correlation rule consequent, and the degree of confidence and the major component weights of every major component correlation rule in the described major component Attribute Association rule set that will obtain multiply each other, the major component attribute that promptly obtains the vegetable X in described all vegetables is recommended degree of confidence, wherein, described major component weights are to obtain according to described major component attribute weights function calculation;
C3, concentrate from described feature association, at the vegetable X in described all vegetables, seeking coupling is the correlation rule former piece with described a kind of characteristic attribute data of orderring vegetable or more than one combined feature attribute datas of having order in the vegetable database, with a kind of characteristic attribute data or more than one combined feature attribute datas of the described vegetable X characteristic attribute correlation rule collection that is the correlation rule consequent, and the degree of confidence and the feature weights of every feature association rule concentrating of the described characteristic attribute correlation rule that will obtain multiply each other, the characteristic attribute that promptly obtains the vegetable X in described all vegetables is recommended degree of confidence, wherein, described feature weights are to obtain according to described characteristic attribute weights function calculation;
C4, recommend degree of confidence and characteristic attribute to recommend the degree of confidence addition major component attribute of described vegetable X, promptly obtain the recommendation value of described vegetable X.
In addition, described major component weights and described feature weights can also be to set in advance.
Further, major component attribute weights function among the described step C1 and characteristic attribute weights function are increasing function.
Further, major component attribute weights function among the described step C1 is Y=F1 (t1)=t1*t1, wherein, the computing method of described major component attribute weights argument of function t1 are, at every major component correlation rule, the major component attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described major component attribute order at the described ratio of having order the number of times sum that occurs in the vegetable;
Described characteristic attribute weights Function Y=F2 (t2)=t2*t2, wherein, the computing method of described characteristic attribute weights argument of function t2 are, at every feature association rule, the characteristic attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described characteristic attribute order at the described ratio of having order the number of times sum that occurs in the vegetable.
In addition, described major component attribute weights function is that identical weights function all is Y=F (t)=t*t with described characteristic attribute weights function.Setting up major component attribute weights function and characteristic attribute weights function is in order to identify the significance level of certain bar correlation rule in recommending the vegetable process, and it is identical with characteristic attribute weights function to choose major component attribute weights function, is to consider that the importance of major component attribute and characteristic attribute is suitable.
Another further, major component attribute weights function among the described step C1 is Y=F1 (t1)=t1*t1*t1, wherein, the computing method of described major component attribute weights argument of function t1 are, at every major component correlation rule, the major component attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described major component attribute order at the described ratio of having order the number of times sum that occurs in the vegetable;
Described characteristic attribute weights Function Y=F2 (t2)=t2*t2, wherein, the computing method of described characteristic attribute weights argument of function t2 are, at every feature association rule, the characteristic attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described characteristic attribute order at the described ratio of having order the number of times sum that occurs in the vegetable.
In addition, setting up major component attribute weights function and characteristic attribute weights function is in order to identify the significance level of certain bar correlation rule in recommending the vegetable process, and choose major component attribute weights function and characteristic attribute weights function inequality, be to consider that the importance of major component attribute and characteristic attribute is unsuitable, when thinking that the importance of major component attribute is greater than the importance of characteristic attribute, major component attribute weights function F 1 (t), and characteristic attribute weights function F 2 (t), and make these two functions satisfy following requirement simultaneously:
For t arbitrarily, F1 (t)>F2 (t);
When thinking that the importance of major component attribute is less than the importance of characteristic attribute, major component attribute weights function F 1 (t), and characteristic attribute weights function F 2 (t), and make these two functions satisfy following requirement simultaneously:
For t arbitrarily, F1 (t)<F2 (t);
In addition, more than for the computing method of the independent variable in the major component attribute weights function, can be simply at every major component correlation rule, major component attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described major component attribute order in described this simple calculating of ratio of having order the number of times sum that occurs in the vegetable, can also be that the sequence number of orderring the vegetable appearance is composed the vegetable weights respectively, the major component attribute of employing in the correlation rule former piece asked average algorithm with described major component attribute in described this weighted sum of ratio of having order the number of times sum that occurs in the vegetable more again in the described sum of products of having order the corresponding with it vegetable weights of sequence number that occur in the vegetable, can also be the fixed value of a predefined ascending series, can also be other computing method.Computing method for the independent variable in the characteristic attribute weights function also are in like manner.
The present invention also provides a kind of intelligently recommending ordering dishes system, and it comprises:
The correlation rule generation module, be used for according to the order dishes attribute data of all vegetables of database of the history obtained, generate the correlation rule collection to carrying out data mining between the attribute data of described all vegetables, described correlation rule collection is made up of many correlation rules, and calculates the degree of confidence that described correlation rule is concentrated every correlation rule;
Wherein, described correlation rule is made up of correlation rule former piece and correlation rule consequent, described correlation rule consequent is drawn by described correlation rule antecedent derivation, define described history and order dishes that the data set of the attribute data of all vegetables is P in the database, having N1 time in data set P occurs in the described correlation rule former piece, have N2 time again and described correlation rule consequent occurs, then the degree of confidence of described correlation rule is N2/N1*100%, is used to represent that described correlation rule in degree of confidence is is believable on the probability of N2/N1*100%;
The first vegetable receiver module is used to receive first vegetable that the user imports, and first vegetable of described input is stored to the database of orderring vegetable;
Recommend to be worth generation module, be used for concentrating from described correlation rule, at the vegetable X in described all vegetables, seek coupling and order a kind of attribute data of orderring vegetable in the vegetable database or the attribute data of more than one combinations is the correlation rule former piece with described, with a kind of attribute data of described vegetable X or the attribute data of more than one combinations is the Attribute Association rule set of correlation rule consequent, and the degree of confidence addition calculation of every correlation rule in the described Attribute Association rule set that will obtain obtains the recommendation value of described vegetable X;
Wherein, X is one of them vegetable in described all vegetables;
Output module is used for the recommendation value of described all vegetables is sorted, and chooses and recommends to be worth N forward vegetable of rank as the recommendation vegetable, and export described N and recommend vegetable, and wherein, described N is the integer greater than 0;
Judge module is used to judge whether to receive the vegetable that the user imports, if then the vegetable with described input is stored to the described database of orderring vegetable, and to recommending to be worth the execution command that generation module transmission searching is mated; Otherwise, finish recommending ordering dishes.
Preferably, the attribute data of described all vegetables comprises following attribute classification: major component attribute, characteristic attribute.
Preferred, described correlation rule generation module comprises:
The correlation rule generation unit of major component attribute data, be used for according to the order dishes major component attribute data of all vegetables of database of the history obtained, carry out data mining between the major component attribute data to described all vegetables and generate major component correlation rule collection, described major component correlation rule collection is made up of many major component correlation rules, and calculates the degree of confidence that described major component correlation rule is concentrated every major component correlation rule;
The correlation rule generation unit of characteristic attribute data, be used for according to the order dishes characteristic attribute data of all vegetables of database of the history obtained, carry out data mining generating feature correlation rule collection between the characteristic attribute data to described all vegetables, described feature association rule set is made up of many feature association rules, and calculates the degree of confidence of every feature association rule in the described feature association rule set;
Described recommendation is worth generation module and comprises:
The weights allocation units are used for major component attribute and characteristic attribute are set up major component attribute weights function and characteristic attribute weights function respectively;
The major component attribute is recommended the degree of confidence generation unit, be used for from described major component incidence set, at the vegetable X in described all vegetables, seek coupling and order a kind of major component attribute data of orderring vegetable in the vegetable database or the major component attribute data of more than one combinations is the correlation rule former piece with described, with a kind of major component attribute data of described vegetable X or the major component attribute data of more than one combinations is the major component Attribute Association rule set of correlation rule consequent, and the degree of confidence and the major component weights of every major component correlation rule in the described major component Attribute Association rule set that will obtain multiply each other, the major component attribute that promptly obtains the vegetable X in described all vegetables is recommended degree of confidence, wherein, described major component weights are to obtain according to described major component attribute weights function calculation;
Characteristic attribute is recommended the degree of confidence generation unit, be used for concentrating from described feature association, at the vegetable X in described all vegetables, seeking coupling is the correlation rule former piece with described a kind of characteristic attribute data of orderring vegetable or more than one combined feature attribute datas of having order in the vegetable database, with a kind of characteristic attribute data or more than one combined feature attribute datas of the described vegetable X characteristic attribute correlation rule collection that is the correlation rule consequent, and the degree of confidence and the feature weights of every feature association rule concentrating of the described characteristic attribute correlation rule that will obtain multiply each other, the characteristic attribute that promptly obtains the vegetable X in described all vegetables is recommended degree of confidence, wherein, described feature weights are to obtain according to described characteristic attribute weights function calculation;
Recommend to be worth generation unit, be used for recommending degree of confidence and characteristic attribute to recommend the degree of confidence addition major component attribute of described vegetable X, the recommendation that promptly obtains described vegetable X is worth.
The present invention utilizes the correlation rule data mining method that history is ordered dishes to carry out data mining between the attribute data of all vegetables in the database and generate the correlation rule collection, and the degree of confidence of every correlation rule in the compute associations rule set; Receive first vegetable of user's input, and first vegetable that will import is stored to and orders the vegetable database; Concentrate from correlation rule, at the vegetable X in all vegetables, seeking coupling is the correlation rule former piece to order a kind of attribute data of orderring vegetable in the vegetable database or the attribute data of more than one combinations, with a kind of attribute data of vegetable X or the attribute data of more than one combinations is the Attribute Association rule set of correlation rule consequent, and the degree of confidence addition calculation of every correlation rule in the Attribute Association rule set that obtains is obtained the recommendation value of vegetable X; The recommendation value of each vegetable in all vegetables is sorted, choose and recommend to be worth N forward vegetable of rank as the recommendation vegetable, and N recommendation of output vegetable, wherein, N is the integer greater than 0; Judge whether to receive the vegetable of user's input, if then the vegetable of importing is stored to and orders the vegetable database and continue step C; Otherwise, finish recommending ordering dishes.Compared with prior art, the present invention can make the vegetable of recommendation have more science and rationality.Attribute with vegetable among the present invention specifically is divided into major component attribute and characteristic attribute, is used for reflecting the essential characteristic of vegetable inherence, makes the correlation rule that generates have more science, for the decision maker provides the decision references of building meaning is arranged really.Also set up the weights function that increases progressively respectively at different attributes among the present invention, be used for progressively reducing previous repeatability influence of having order vegetable candidate's vegetable.
Embodiment
With the following Examples the present invention is further described:
Embodiment one:
The embodiment of a kind of intelligently recommending ordering dishes method of the present invention is a kind of method flow diagram of the present invention as shown in Figure 1.
Concrete, a kind of intelligently recommending ordering dishes method may further comprise the steps:
Step S01, according to the order dishes attribute data of all vegetables in the database of the history obtained, generate the correlation rule collection to carrying out data mining between the attribute data of described all vegetables, described correlation rule collection is made up of many correlation rules, and calculates the degree of confidence that described correlation rule is concentrated every correlation rule;
Wherein, described correlation rule is made up of correlation rule former piece and correlation rule consequent, described correlation rule consequent is drawn by described correlation rule antecedent derivation, define described history and order dishes that the data set of the attribute data of all vegetables is P in the database, having N1 time in data set P occurs in the described correlation rule former piece, have N2 time again and described correlation rule consequent occurs, then the degree of confidence of described correlation rule is N2/N1*100%, is used to represent that described correlation rule in degree of confidence is is believable on the probability of N2/N1*100%;
Transfer original transaction database (can be the real historical consume record in certain eating and drinking establishment), in original transaction database, data are carried out pre-service, at first reject the data item of uninterested drink of user and non-staple food, database after treatment can be defined as the history database of ordering dishes, utilize the knowledge in catering trade field to obtain the order dishes attribute data of each vegetable in the database of history then, the attribute data here can draw according to the objective knowledge judgement in catering trade field, also can be that subjective judgement according to experts such as cooks draws, the history that to obtain is ordered dishes then, and the attribute data of all vegetables imports computing machine in the database, generates correlation rule to carrying out data mining between the attribute data of all vegetables again.
Association rule mining is the typical method of data mining.Correlation rule is meant the rule that has or not, represents certain incidence relation between the group objects in the database of relation between the data of description item of excavating from lot of data.The present invention simply is referred to as data item with the name of vegetable to carry out data mining, but the attribute data of the inherence of vegetable is carried out data mining as data item, the correlation rule that this data mining generates can draw the inherent in other words conj.or perhaps dependence of real significant rule, i.e. dependence between the characteristic of vegetable.In addition,, obtain the history attribute data of vegetable in the database of ordering dishes again, thereby the attribute data of described vegetable is carried out regular data mining, make the function of recommending vegetable get caught up in the demand in epoch along with the renewal of original things database.
In addition, introduce a concrete example making an explanation to the several titles in the correlation rule:
Such as correlation rule be " attribute AA=>attribute BB " wherein, define described history and order dishes that the data set of the attribute data of all vegetables is P in the database, having N1 time in data set P occurs in the described attribute AA, have N2 time again and attribute BB occurs, then the degree of confidence of described correlation rule is N2/N1*100%, be used to represent that described correlation rule in degree of confidence is is believable on the probability of N2/N1*100%, it is meant that particular individual treats the degree that the particular proposition authenticity is believed.Promptly in occurring the record of attribute AA for N1 time, have N2 time and occurred attribute BB simultaneously, then correlation rule " attribute AA=>attribute BB " is believable on the probability of N2/N1*100%.
Defined attribute AA is the correlation rule former piece, and attribute BB is the correlation rule consequent.
Wherein, Described correlation rule is made up of correlation rule former piece and correlation rule consequent; Described correlation rule consequent is drawn by described correlation rule antecedent derivation; Define described history and order dishes that the data set of the attribute data of all vegetables is P in the database; Having N1 time in data set P occurs in the described correlation rule former piece; Have again N2 time and described correlation rule consequent occurs; Then the confidence level of described correlation rule is N2/N1*100%; Be used for representing that described correlation rule is that the probability of N2/N1*100% is believable in confidence level
On the method for association rule mining, the present invention has adopted up-to-date association rules mining algorithm FPgrowth.Adopt the data structure of frequent pattern tree (fp tree), the traditional algorithm Apriori than association rule mining on efficient is higher.
Step S02, receive first vegetable of user's input, and first vegetable of described input is stored to orders the vegetable database;
Step S03, concentrated from described correlation rule, at the vegetable X in described all vegetables, seek coupling and order a kind of attribute data of orderring vegetable in the vegetable database or the attribute data of more than one combinations is the correlation rule former piece with described, with a kind of attribute data of described vegetable X or the attribute data of more than one combinations is the Attribute Association rule set of correlation rule consequent, and the degree of confidence addition calculation of every correlation rule in the described Attribute Association rule set that will obtain obtains the recommendation value of described vegetable X;
Wherein, X is one of them vegetable in described all vegetables;
The recommendation that can calculate each vegetable in described all vegetables thus is worth.According to the attribute data of orderring vegetable, can draw the vegetable that client selected by the correlation rule that generates and have which type of attribute, like comprising the client of the vegetable of this attribute, also may like having the vegetable of what other attribute.
Step S04, the recommendation of each vegetable in described all vegetables is worth sorts, choose and recommend to be worth N forward vegetable of rank as recommending vegetable, and export described N recommendation vegetable, wherein, described N is the integer greater than 0; According to orderring vegetable, can find out some the attribute datas with them is the correlation rule of correlation rule former piece, the dish that has in all vegetables can be relevant with these many correlation rules wherein so, every correlation rule all has certain degree of confidence, obviously relevant degree of confidence sum is high more, recommends to be worth high more.
In addition, guarantee that at the same time the identical vegetable of major component attribute is no more than 2, can utilize choice function if condition distinguishing function, carry out defined function and choose.
In addition, recommend the quantity of vegetable to change for output N among the step D according to user's requirement, the quantity that can choose N is 5, if do not generate 5 eligible and recommend to be worth recommendation vegetable greater than 0, can choose then that vegetable is recommended the vegetable that rank is the highest in the sorting out value table or also can be other vegetable of choosing the dining room special recommendation, gather together enough 5 vegetables as recommending vegetable output.
Step S05, judge whether to receive the vegetable of user's input, if then the vegetable of described input is stored to and has describedly order the vegetable database and continued step C; Otherwise, finish recommending ordering dishes.
In addition, the vegetable of the user's input in the step e can be the vegetable of selecting from recommend vegetable, also can be the free vegetable of user, can also be the normal vegetable etc. of ordering that recommend in the dining room.
Concrete, the attribute data of described all vegetables comprises following attribute classification: major component attribute and characteristic attribute.Described characteristic attribute comprises following attribute subclass: taste, cooking methods, auxiliary material, condiment, the style of cooking, the place of production etc.The major component attribute is the principal ingredient that concrete vegetable comprises, such as: Saut is fried the meaning powder, and the meaning powder is a major component, and choosing of attribute data can be chosen the above some or all of data of enumerating according to actual conditions, can also be other attribute subclass.The attribute subclass of concrete cooking methods can with fry, fry in shallow oil, quick-fried, explode, burn, boil, steam, stew/simmer/be stewing, indexs such as smoked, baking/roasting, scalding weigh; The attribute subclass of condiment can be weighed with indexs such as sauce, vinegar, chilli oil, capsicum, green onion ginger, sesame oil, monosodium glutamates; The attribute subclass of taste can be weighed with pungent, index such as spicy, sour-sweet; The style of cooking is the styles of cooking such as Shandong, river, Soviet Union, Guangdong, Fujian, Zhejiang, Hunan, emblem, and the place of production is China, foreign country etc.
Described step S01 specifically comprises:
According to the order dishes major component attribute data of all vegetables in the database of the history of obtaining, carry out data mining between the major component attribute data to described all vegetables and generate major component correlation rule collection, described major component correlation rule collection is made up of many major component correlation rules, and calculates the degree of confidence that described major component correlation rule is concentrated every major component correlation rule;
According to the order dishes characteristic attribute data of all vegetables in the database of the history of obtaining, carry out data mining generating feature correlation rule collection between the characteristic attribute data to described all vegetables, described feature association rule set is made up of many feature association rules, and calculates the degree of confidence of every feature association rule in the described feature association rule set;
Simply the name of vegetable is referred to as data item, can not excavate useful rule, so adopt the internal characteristics attribute and the major component attribute that extract vegetable, respectively the internal characteristics attribute of vegetable and major component attribute are carried out association rule mining one time as data item, thereby obtain between the internal characteristics attribute of vegetable and the internal relation between the major component.
Described step S03 specifically comprises:
C1, described major component attribute and described characteristic attribute are set up major component attribute weights function and characteristic attribute weights function respectively;
C2, from described major component incidence set, at the vegetable X in described all vegetables, seek coupling and order a kind of major component attribute data of orderring vegetable in the vegetable database or the major component attribute data of more than one combinations is the correlation rule former piece with described, with a kind of major component attribute data of described vegetable X or the major component attribute data of more than one combinations is the major component Attribute Association rule set of correlation rule consequent, and the degree of confidence and the major component weights of every major component correlation rule in the described major component Attribute Association rule set that will obtain multiply each other, the major component attribute that promptly obtains the vegetable X in described all vegetables is recommended degree of confidence, wherein, described major component weights are to obtain according to described major component attribute weights function calculation;
In addition, described major component weights can also be to set in advance;
C3, concentrate from described feature association, at the vegetable X in described all vegetables, seeking coupling is the correlation rule former piece with described a kind of characteristic attribute data of orderring vegetable or more than one combined feature attribute datas of having order in the vegetable database, with a kind of characteristic attribute data or more than one combined feature attribute datas of the described vegetable X characteristic attribute correlation rule collection that is the correlation rule consequent, and the degree of confidence and the feature weights of every feature association rule concentrating of the described characteristic attribute correlation rule that will obtain multiply each other, the characteristic attribute that promptly obtains the vegetable X in described all vegetables is recommended degree of confidence, wherein, described feature weights are to obtain according to described characteristic attribute weights function calculation;
In addition, described feature weights can also be to set in advance;
C4, recommend degree of confidence and characteristic attribute to recommend the degree of confidence addition major component attribute of described vegetable X, promptly obtain the recommendation value of described vegetable X.
Major component attribute weights function and characteristic attribute weights function among the C1 among the described step S03 are increasing function.
Major component attribute weights function among the step C1 among the described step S03 is Y=F1 (t1)=t1*t1, wherein, the computing method of described major component attribute weights argument of function t1 are, at every major component correlation rule, the major component attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described major component attribute order at the described ratio of having order the number of times sum that occurs in the vegetable;
Described characteristic attribute weights Function Y=F2 (t2)=t2*t2, wherein, the computing method of described characteristic attribute weights argument of function t2 are, at every feature association rule, the characteristic attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described characteristic attribute order at the described ratio of having order the number of times sum that occurs in the vegetable.
In addition, described major component attribute weights function is identical weights Function Y=F (t)=t*t with described characteristic attribute weights function.Setting up major component attribute weights function and characteristic attribute weights function is in order to identify the significance level of certain bar correlation rule in recommending the vegetable process, and it is identical with characteristic attribute weights function to choose major component attribute weights function, is to consider that the importance of major component attribute and characteristic attribute is suitable.
In addition, introduce a concrete example computing method of the independent variable t1 in the major component attribute weights function further explained:
Certain bar major component correlation rule: { major component attribute A1, B1, C1}=>{ major component attribute D1} is orderring vegetable { a, b, c ... in, if major component attribute A1 is orderring a vegetable appearance in the vegetable, similarly, major component attribute B1 is orderring b vegetable appearance in the vegetable, major component attribute C1 c vegetable in ordering dishes occurs, then the independent variable t1=(a+b+c)/3 in the major component attribute weights function.
Major component attribute weights function among the step C1 among the described step S03 is Y=F1 (t1)=t1*t1*t1, wherein, the computing method of described major component attribute weights argument of function t1 are, at every major component correlation rule, the major component attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described major component attribute order at the described ratio of having order the number of times sum that occurs in the vegetable;
Described characteristic attribute weights Function Y=F2 (t2)=t2*t2, wherein, the computing method of described characteristic attribute weights argument of function t2 are, at every feature association rule, the characteristic attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described characteristic attribute order at the described ratio of having order the number of times sum that occurs in the vegetable.
In addition, setting up major component attribute weights function and characteristic attribute weights function is in order to identify the significance level of certain bar correlation rule in recommending the vegetable process, and choose major component attribute weights function and characteristic attribute weights function inequality, be to consider that the importance of major component attribute and characteristic attribute is unsuitable, when thinking that the importance of major component attribute is greater than the importance of characteristic attribute, major component attribute weights function F 1 (t), and characteristic attribute weights function F 2 (t), and make these two functions satisfy following requirement simultaneously:
For t arbitrarily, F1 (t)>F2 (t);
When thinking that the importance of major component attribute is less than the importance of characteristic attribute, major component attribute weights function F 1 (t), and characteristic attribute weights function F 2 (t), and make these two functions satisfy following requirement simultaneously:
For t arbitrarily, F1 (t)<F2 (t);
In addition, introduce a concrete example computing method of the independent variable in the characteristic attribute weights function further explained:
Certain bar feature association rule: { characteristic attribute E1, F1, G1}=>{ characteristic attribute H1}
Orderring vegetable { e, f, g ... in, if characteristic attribute E1 is orderring e vegetable appearance in the vegetable, similarly, characteristic attribute F1 is orderring f vegetable appearance in the vegetable, characteristic attribute G1 g vegetable in ordering dishes occurs, then the independent variable t2=(e+f+g)/3 in the characteristic attribute weights function.
In addition, more than for the computing method of the independent variable in the major component attribute weights function, can be simply at every major component correlation rule, major component attribute in the correlation rule former piece at the described sequence number sum that occurs in the vegetable and the described major component attribute order in described this simple calculating of ratio of having order the number of times sum that occurs in the vegetable, can also be that the sequence number of orderring the vegetable appearance is composed the vegetable weights respectively, the major component attribute of employing in the correlation rule former piece asked average algorithm with described major component attribute in described this weighted sum of ratio of having order the number of times sum that occurs in the vegetable more again in the described sum of products of having order the corresponding with it vegetable weights of sequence number that occur in the vegetable, can also be the fixed value of a predefined ascending series, can also be other computing method.Computing method for the independent variable in the characteristic attribute weights function also are in like manner.
In addition, this increasing function can be linear increasing function, exponential type increasing function etc.
In addition, can define the weights function according to actual conditions.But in the ordinary course of things, this function is a strictly monotone increasing.
Order dishes for example:
1, selects first assorted cold dishes
This is ordered dishes: Saut is fried the meaning powder
Order the vegetable database: Saut is fried the meaning powder
The attribute data of having order vegetable Saut stir-fry meaning powder is " black green pepper ", " beef fillet ", " meaning powder ", and wherein the characteristic attribute data are " black green pepper ", " beef fillet ", and the major component attribute data is " a meaning powder "
With the fragrant fried shredded squid of vegetable is example, the recommendation of calculating the fragrant fried shredded squid of vegetable is worth, wherein the attribute data of the fragrant fried shredded squid of vegetable is " perfume (or spice) ", " shredded squid ", and " perfume (or spice) " is the characteristic attribute of fragrant fried shredded squid, and " shredded squid " is the major component attribute of fragrant fried shredded squid.
To fry characteristic attribute " black green pepper ", " beef fillet " in the meaning powder be the correlation rule former piece to order the vegetable Saut, be that the concentrated feature association rule of characteristic attribute correlation rule of correlation rule consequent has with the characteristic attribute " perfume (or spice) " in the fragrant fried shredded squid of vegetable:
{ black green pepper, beef fillet }=>{ perfume (or spice) } degree of confidence: 0.5
The weights computation process of this feature association rule is as follows: in the correlation rule former piece, two data item are arranged, be characteristic attribute, be respectively: " black green pepper ", " beef fillet ".Wherein, characteristic attribute " black green pepper " has been order in the vegetable the 1st at all and has been order in the vegetable and occur, characteristic attribute " beef fillet " has been order in the vegetable the 1st at all and has been order in the vegetable and occur, and therefore, calls characteristic attribute weights function F 1 (x)=x*x (desirable other function is as the weights function).Calculate its independent variable, x=(1+1)/2=1.
With characteristic attribute correlation rule { black green pepper, beef fillet }=>degree of confidence 0.5 of { perfume (or spice) }, multiply by its weights F2 (1)=1*1=1, the recommendation degree of confidence that has obtained this feature association rule is 0.5*1=0.5.
To fry major component attribute " meaning powder " in the meaning powder be the correlation rule former piece to order the vegetable Saut, be that the concentrated major component correlation rule of major component correlation rule of correlation rule consequent has with the major component attribute " shredded squid " in the fragrant fried shredded squid:
{ meaning powder }=>{ shredded squid } degree of confidence: 0.48
The weights computation process of this major component correlation rule is as follows: in the correlation rule former piece, a data item arranged, is the major component attribute, for: the meaning powder.Wherein, occur therefore during major component attribute " meaning powder " the 1st in all are ordered dishes orders dishes, call major component attribute weights function F 1 (x)=x*x (desirable other function is as the weights function).Calculate its independent variable, x=1/1=1.
With major component correlation rule { meaning powder }=>degree of confidence 0.48 of { shredded squid }, multiply by its weights F1 (1)=1*1=1, obtained the recommendation degree of confidence 0.48*1=0.48 of this major component correlation rule.
With the recommendation degree of confidence addition calculation of above-mentioned Attribute Association rule, the recommendation that has just obtained the fragrant fried shredded squid of vegetable is worth and is 0.5+0.48=0.98.
Profit uses the same method, and the recommendation that can calculate other vegetable in all vegetables is worth.And all vegetables recommend are worth descending sort according to it, obtain following recommendation dish.
Selecting the back recommends: fragrant fried shredded squid, fragrant taro, fragrant plum braised pork, the fragrant green pepper beef in Chongqing, the fragrant peppery beef fillet king of iron plate
2, select second assorted cold dishes
This is ordered dishes: the fragrant green pepper beef in Chongqing
Order the vegetable database: Saut is fried meaning powder, Chongqing spicy beef
Having order vegetable is that Saut is fried meaning powder and Chongqing spicy beef, and the attribute data that Saut is fried the meaning powder is " black green pepper ", " beef fillet ", " meaning powder ", and wherein the major component attribute data is " a meaning powder ", and the characteristic attribute data are " black green pepper ", " beef fillet "; The attribute data of Chongqing spicy beef is " Chongqing ", " perfume (or spice) ", " peppery ", " beef ", and wherein the major component attribute data is " beef ", and the characteristic attribute data are " Chongqing ", " perfume (or spice) ", " peppery ".
With the spicy beef Piza is example, the recommendation of calculating vegetable spicy beef Piza is worth, wherein the attribute data of vegetable spicy beef Piza is " perfume (or spice) ", " peppery ", " Piza ", and wherein the major component attribute data is " Piza ", and the characteristic attribute data are " perfume (or spice) ", " peppery ".
To fry major component attribute data " meaning powder ", " beef " in meaning powder, the fragrant green pepper beef in Chongqing be the correlation rule former piece to order the vegetable Saut, be that the concentrated major component correlation rule of major component correlation rule of correlation rule consequent has with the major component attribute data " Piza " in the vegetable spicy beef Piza:
{ meaning powder, beef }=>{ Piza } degree of confidence: 0.125
The weights computation process of this major component correlation rule is as follows: the major component attribute data in the correlation rule former piece " meaning powder " has been order appearance in the vegetable (Saut is fried the meaning powder) all the 1st of having order in the vegetable, major component attribute data " beef " has been order appearance in the vegetable (the fragrant green pepper beef in Chongqing) all the 2nd of having order in the vegetable, therefore, call major component attribute weights function F 1 (x)=x*x (desirable other function is as the weights function).Calculate its independent variable, x=(1+2)/2=1.5.
With main composition correlation rule { meaning powder, beef }=>degree of confidence 0.125 of { Piza }, multiply by its weights F1 (1)=1.5*1.5=2.25, obtained the recommendation degree of confidence 0.125*2.25=0.28125 of this major component correlation rule
To order characteristic attribute data " black green pepper ", " beef fillet ", " Chongqing ", " perfume (or spice) ", " peppery " that the vegetable Saut fries in meaning powder, the fragrant green pepper beef in Chongqing is the correlation rule former piece, and the feature association rule set that is the correlation rule consequent with the characteristic attribute data " perfume (or spice) " in the vegetable spicy beef Piza, " peppery " has:
1. { black green pepper, beef fillet }=>{ perfume (or spice) } degree of confidence: 0.5
2. { Chongqing, black green pepper }=>{ peppery } degree of confidence: 0.25
1. feature association rule { black green pepper, beef fillet }=>the weights computation process of { perfume (or spice) } is as follows: characteristic attribute in the correlation rule former piece " black green pepper " has been order in the vegetable the 1st at all and has been order in the vegetable (Saut is fried the meaning powder) and occur, characteristic attribute " beef fillet " has been order appearance in the vegetable (Saut is fried the meaning powder) all the 1st of having order in the vegetable, therefore, call characteristic attribute weights function F 2 (x)=x*x (desirable other function is as the weights function).Calculate its independent variable, x=(1+1)/2=1.
With feature association rule { black green pepper, beef fillet }=>degree of confidence 0.5 of { perfume (or spice) }, multiply by its weights F1 (1)=1*1=1, obtained the recommendation degree of confidence 0.5*1=0.5. of this feature association rule
2. feature association rule { Chongqing, black green pepper }=>the weights computation process of { peppery } is as follows: characteristic attribute in the correlation rule former piece " Chongqing " has been order in the vegetable the 2nd at all and has been order in the vegetable (Chongqing spicy beef) and occur, characteristic attribute " black green pepper " has been order appearance in the vegetable (Saut is fried the meaning powder) all the 1st of having order in the vegetable, therefore, call characteristic attribute weights function F 2 (x)=x*x (desirable other function is as the weights function).Calculate its independent variable, x=(2+1)/2=1.5.
With characteristic attribute correlation rule { Chongqing, black green pepper }=>degree of confidence 0.25 of { peppery }, multiply by its weights F2 (1)=1.5*1.5=2.25, obtained the recommendation degree of confidence 0.25*2.25=0.5625 of this feature association rule
Above-mentioned major component Attribute Association rule and characteristic attribute are recommended the degree of confidence addition calculation, and the recommendation that has just obtained the fragrant fried shredded squid of vegetable is worth and is 0.5625+0.28125=0.84375
Profit uses the same method, and the recommendation that can calculate other vegetable in all vegetables is worth.And all vegetables recommend are worth descending sort according to it, obtain following recommendation dish.
Selecting the back recommends: spicy beef Piza, the fragrant chicken with several spices point of garlic, the fragrant chicken with several spices wing of wheat, spiced pungent duck tongue, fragrant peppery shelled peanut
Selected all vegetables until client, computing machine judges whether to receive the vegetable of user's input, has describedly order the database of vegetable and has returned above step if then the vegetable of described input is stored to, otherwise finished recommending ordering dishes.
Embodiment two:
Accordingly, the present invention also provides a kind of intelligently recommending ordering dishes system as shown in Figures 2 and 3, is a kind of structural representation of the present invention.
Concrete, a kind of intelligently recommending ordering dishes of the present invention system, it comprises:
Correlation rule generation module 1, be used for according to the order dishes attribute data of all vegetables of database of the history obtained, generate the correlation rule collection to carrying out data mining between the attribute data of described all vegetables, described correlation rule collection is made up of many correlation rules, and calculates the degree of confidence that described correlation rule is concentrated every correlation rule;
Wherein, described correlation rule is made up of correlation rule former piece and correlation rule consequent, described correlation rule consequent is drawn by described correlation rule antecedent derivation, define described history and order dishes that the data set of the attribute data of all vegetables is P in the database, having N1 time in data set P occurs in the described correlation rule former piece, have N2 time again and described correlation rule consequent occurs, then the degree of confidence of described correlation rule is N2/N1*100%, is used to represent that described correlation rule in degree of confidence is is believable on the probability of N2/N1*100%;
The first vegetable receiver module 2 is used to receive first vegetable that the user imports, and first vegetable of described input is stored to the database of orderring vegetable;
Recommend to be worth generation module 3, be used for concentrating from described correlation rule, at the vegetable X in described all vegetables, seek coupling and order a kind of attribute data of orderring vegetable in the vegetable database or the attribute data of more than one combinations is the correlation rule former piece with described, with a kind of attribute data of described vegetable X or the attribute data of more than one combinations is the Attribute Association rule set of correlation rule consequent, and the degree of confidence addition calculation of every correlation rule in the described Attribute Association rule set that will obtain obtains the recommendation value of described vegetable X;
Wherein, X is one of them vegetable in described all vegetables;
Output module 4 is used for the recommendation value of described all vegetables is sorted, and chooses and recommends to be worth N forward vegetable of rank as the recommendation vegetable, and export described N and recommend vegetable, and wherein, described N is the integer greater than 0;
Judge module 5 is used to judge whether to receive the vegetable that the user imports, if then the vegetable with described input is stored to the described database of orderring vegetable, and to recommending to be worth the execution command that generation module transmission searching is mated; Otherwise, finish recommending ordering dishes.
More specifically, the attribute data of described all vegetables comprises following attribute classification: major component attribute and characteristic attribute.Described characteristic attribute comprises following attribute subclass: taste, cooking methods, auxiliary material, condiment, the style of cooking and the place of production.The major component attribute is the principal ingredient that concrete vegetable comprises, such as: Saut is fried the meaning powder, and the meaning powder is a major component, and choosing of attribute data can be chosen the above some or all of data of enumerating according to actual conditions, can also be other attribute subclass.The attribute subclass of concrete cooking methods can with fry, fry in shallow oil, quick-fried, explode, burn, boil, steam, stew/simmer/be stewing, indexs such as smoked, baking/roasting, scalding weigh; The attribute subclass of condiment can be weighed with indexs such as sauce, vinegar, chilli oil, capsicum, green onion ginger, sesame oil, monosodium glutamates; The attribute subclass of taste can be weighed with pungent, index such as spicy, sour-sweet; The style of cooking is the styles of cooking such as Shandong, river, Soviet Union, Guangdong, Fujian, Zhejiang, Hunan, emblem; The place of production is China, foreign country etc.
Further, described correlation rule generation module 1 comprises:
The correlation rule generation unit 11 of major component attribute data, be used for according to the order dishes major component attribute data of all vegetables of database of the history obtained, carry out data mining between the major component attribute data to described all vegetables and generate major component correlation rule collection, described major component correlation rule collection is made up of many major component correlation rules, and calculates the degree of confidence that described major component correlation rule is concentrated every major component correlation rule;
The correlation rule generation unit 12 of characteristic attribute data, be used for according to the order dishes characteristic attribute data of all vegetables of database of the history obtained, carry out data mining generating feature correlation rule collection between the characteristic attribute data to described all vegetables, described feature association rule set is made up of many feature association rules, and calculates the degree of confidence of every feature association rule in the described feature association rule set;
Described recommendation is worth generation module 3 and comprises:
Weights allocation units 31 are used for major component attribute and characteristic attribute are set up major component attribute weights function and characteristic attribute weights function respectively;
The major component attribute is recommended degree of confidence generation unit 32, be used for from described major component incidence set, at the vegetable X in described all vegetables, seek coupling and order a kind of major component attribute data of orderring vegetable in the vegetable database or the major component attribute data of more than one combinations is the correlation rule former piece with described, with a kind of major component attribute data of described vegetable X or the major component attribute data of more than one combinations is the major component Attribute Association rule set of correlation rule consequent, and the degree of confidence and the major component weights of every major component correlation rule in the described major component Attribute Association rule set that will obtain multiply each other, the major component attribute that promptly obtains the vegetable X in described all vegetables is recommended degree of confidence, wherein, described major component weights are to obtain according to described major component attribute weights function calculation;
Characteristic attribute is recommended degree of confidence generation unit 33, be used for concentrating from described feature association, at the vegetable X in described all vegetables, seeking coupling is the correlation rule former piece with described a kind of characteristic attribute data of orderring vegetable or more than one combined feature attribute datas of having order in the vegetable database, with a kind of characteristic attribute data or more than one combined feature attribute datas of the described vegetable X characteristic attribute correlation rule collection that is the correlation rule consequent, and the degree of confidence and the feature weights of every feature association rule concentrating of the described characteristic attribute correlation rule that will obtain multiply each other, the characteristic attribute that promptly obtains the vegetable X in described all vegetables is recommended degree of confidence, wherein, described feature weights are to obtain according to described characteristic attribute weights function calculation;
Recommend to be worth generation unit 34, be used for recommending degree of confidence and characteristic attribute to recommend the degree of confidence addition major component attribute of described vegetable X, the recommendation that promptly obtains described vegetable X is worth.
The present invention can be applied on the field that the intelligent recommendation of vegetable is ordered dishes, the methods various and of the present invention such as intelligent recommendation purchase of commodity are relevant.
Should be noted that at last; above embodiment is only in order to illustrate technical scheme of the present invention; but not limiting the scope of the invention; although the present invention has been done to explain with reference to preferred embodiment; those of ordinary skill in the art is to be understood that; can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the essence and the scope of technical solution of the present invention.