Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a medicine recommendation method based on a hidden semi-Markov model. The method comprises the steps of firstly, predicting a disease condition concerned by a user according to an observable network behavior sequence of the user on a cloud platform, and then recommending related medicines to the user according to the disease condition most concerned by the user; the problem of accurate recommendation of user medicines on a medicine polymerization supply chain collaboration platform is solved.
In order to achieve the above object, the present invention provides a drug recommendation method based on hidden semi-markov model, which mainly comprises the following steps:
firstly, training data preprocessing, namely performing data cleaning on the internet behavior data of a user on a medical platform to generate a training data set of a user behavior sequence;
secondly, estimating parameters of a medicine recommendation model;
thirdly, acquiring an internet behavior sequence of a user on a medicine platform;
fourthly, the online behavior sequence of the user is used as an observed value, and the trained medicine recommendation model is used for deducing the state sequence of the user;
fifthly, calculating the expected duration of each state of the state sequence;
sixthly, sequencing the expected duration of each state in a descending order to obtain a plurality of states most concerned by the user, namely a plurality of diseases most concerned by the user;
and seventhly, recommending corresponding medicines to the user according to the previous plurality of diseases most concerned by the user.
Preferably, the drug recommendation model is a hidden semi-markov model based model.
Preferably, the parameter model of the drug recommendation model is represented as: θ ═ pi, a, B }; wherein, pi is the initial state probability of the initial model, A is the state transition probability, and B is the observation probability.
Preferably, the method for estimating the parameters of the drug recommendation model is a forward-backward algorithm.
Preferably, the fourth step of inferring the state sequence of the user using the trained drug recommendation model is based on a Viterbi algorithm.
So-called observation space, which is used for the cooperation of users in the medical aggregation supply chainSequence of online behaviors on the platform, denoted x ═ x1,x2,...,xTThe information processing method includes pages browsed by a user on systems or platforms such as an APP, a medicine cloud platform and a robot, accessed resources or proposed problems and the like. The value space of the state is the disease condition concerned by the user and is expressed as y ═ y1,y2,...yn。
According to the method and the system, the illness state concerned by the user is accurately predicted according to the online behavior of the user on the cloud platform, and then the related medicine is recommended to the user according to the illness state most concerned by the user, so that the relevance of the medicine recommendation result is improved.
Detailed Description
The invention is described in detail below with reference to the drawings and specific examples, but the invention is not limited thereto.
The observation value space is an online behavior sequence of a user on a collaborative platform of a medicine polymerization supply chain, and is represented as x ═ x1,x2,...,xTThe information processing method includes pages browsed by a user on systems or platforms such as an APP, a medicine cloud platform and a robot, accessed resources or proposed problems and the like. The value space of the state is the disease condition concerned by the user and is expressed as y ═ y1,y2,...yn。
The parameter model of the drug recommendation model is represented as: θ ═ pi, a, B }; wherein, pi is the initial state probability of the initial model, A is the state transition probability, and B is the observation probability.
For convenience in describing the model, the present invention employs the following notation:
1) t: t + d denotes the time sequence starting from t up to t + d, i.e. t, t + 1.
2)S[t-d+1:t]J represents [ t-d +1, t ═ j]The state over the time interval is j, and neither the state of t +1 nor t-1 is j.
3)St]J denotes that the state at and before time t is j, and the state at t +1 is not j.
4)S[tJ denotes that the state at and after time t is j, and the state of t-1 is not j.
The parameter estimation task of the drug recommendation model is to estimate the corresponding parameters of the hidden semi-Markov model by the collected user online behavior sequence. The invention adopts a forward and backward algorithm to solve the problem of parameter estimation of a medicine recommendation model, which is specifically described as follows.
1) Defining a forward and backward variable:
αt(j,d)=P[St-d+1:t=j,o1:t|θ];
βt(j,d)=P[ot+1:T|St-d+1:t=j,θ]。
2) initialization of a forward and backward algorithm:
α1(j,d)=πj,
βT(j,d)=1。
3) and (3) iterative derivation process:
4) calculating an intermediate variable:
ηt(j,d)=P[S[t-d+1:t]=j,o1:T|λ]=αt(j,d)βt(j,d);
ξt(i,d';j,d)=P[St]=i,S[t+1:t+d]=j,o1:T|λ]=αt(i,d')a(i,d')(j,d)bj,d(ot+1:t+d)βt+d(j,d);
5) formula for updating parameters
Wherein when
When the temperature of the water is higher than the set temperature,
otherwise
Given the behavior sequence of the user, the Viterbi algorithm is used for extracting a better user interest sequence y-y1,y2,...yt。
The desired duration of computing state i is:
the total expected time of the user in a certain state may be displayed, i.e. the degree to which the user is interested in a certain disease state may be reflected. Generally, the level of interest a user has in a particular medical condition is proportional to the desired duration of the condition for which the condition is associated.
Referring to fig. 1, an embodiment of the present invention provides a hidden semi-markov model-based drug recommendation method, which mainly includes the following steps:
firstly, training data preprocessing, namely performing data cleaning on the internet behavior data of a user on a medical platform to generate a training data set of a user behavior sequence;
secondly, estimating parameters of a medicine recommendation model;
thirdly, acquiring an internet behavior sequence of a user on a medicine platform;
fourthly, the online behavior sequence of the user is used as an observed value, and the trained medicine recommendation model is used for deducing the state sequence of the user;
fifth, calculating the expected duration of each state of the state sequence
Sixthly, sequencing the expected duration of each state in a descending order to obtain the first N states most concerned by the user, namely the first N illness states most concerned by the user;
and seventhly, recommending corresponding medicines to the user according to the previous plurality of diseases most concerned by the user.
The drug recommendation model is a hidden semi-Markov model-based model. The method for estimating the parameters of the drug recommendation model is a forward and backward algorithm. The fourth step is to use the trained drug recommendation model to infer the state sequence of the user based on the Viterbi algorithm.
According to the embodiment of the invention, the illness state concerned by the user is accurately predicted according to the online behavior of the user on the cloud platform, and then the related medicine is recommended to the user according to the illness state most concerned by the user, so that the relevance of the medicine recommendation result is improved.
The invention has been described in detail, but it is apparent that variations and modifications can be effected by one skilled in the art without departing from the scope of the invention as defined by the appended claims.