Background {#Sec1}
==========

Traditional Chinese medicine(TCM) has a long history and is one of the oldest forms of medicine.  The fact that traditional Chinese medicine can exist for thousands of years is a proof that TCM has the value of its medical form.  Traditional Chinese medicine is being accepted by the public.  More and more researchers are working on Chinese medicine, and more Chinese medicines are used in different countries.\[[@CR1]\]. 

The same disease may have different symptoms in different patients.  Due to the differences between patients, accurate diagnosis and treatment are even more important\[[@CR2]\].  In the field of Western medicine, doctors explore the cause of the disease and focus on treating specific parts of the body.  However, Chinese medicine works differently.  Traditional Chinese medicine and Western medicine have fundamental differences in diagnosis and treatment.  The Chinese medicine practitioner explores the internal and external causes of the patient and combines them accordingly. 

In TCM, herbal remedies are usually based on traditional Chinese medicine formula, and the use of only one type of herbal medicine rarely occurs.  Each herb has its advantages and disadvantages, and they are formulated in a reasonable proportion.  Figure [1](#Fig1){ref-type="fig"} is a schematic diagram of the composition of a formula \[20\].  Formula is the foundation of traditional Chinese medicine and the core of TCM research.  Traditional Chinese medicine data such as ancient Chinese literature and clinical prescriptions contain prescription data.  How to study prescription data through scientific and technical analysis has become the main topic of TCM informatization.  Traditional Chinese medicine data generally appears in the form of texts with strong natural language, usually characterized by unstructured, massive and heterogeneous.  These characteristics have become a huge challenge in the process of informationization of Chinese medicine.  In order to meet the challenge, how to integrate the data of heterogeneous Chinese medicine and model representation, using the data processing method to analyze Chinese medicine data has become an important work of TCM informationization.\[[@CR3]\].  Fig.  1The composition of a formula

The traditional model can no longer meet the inheritance and development of TCM knowledge.  The main bottleneck is the organization form of the knowledge and the limitation of human resources.  Simply, TCM knowledge mainly exists in the forms of prescriptions, medical records, etc.  Unlike ordinary texts, TCM texts have irregular natural language, which creates great difficulties for digitization.  At the same time, because the degree of informationization of TCM is not high, the inheritance model of TCM is generally an apprenticeship mode in which an old practitioner cultivates apprentices.  As a result, some knowledge cannot be passed down in time.  How to pass on the vast knowledge of TCM in an efficient way has become a hot topic in the field of TCM research. 

The development of machine learning and artificial intelligence is conducive to drive the inheritance of traditional Chinese medicine.  Experience can be regarded as a kind of knowledge in artificial intelligence, which can be used as input data for machine learning.  Secondly, \"dialectical treatment\" is the basic principle of TCM diagnosis of diseases.  This is in line with the basic principles of machine learning: the model is trained based on the training set, and the model gives the target value based on the input values.  Xu et al.  used data mining methods to explore drug combinations for nonalcoholic fatty liver disease\[[@CR4]\].  Chen et al.  used a three-part map to explore the symptom-disease pattern in the case\[[@CR5]\].  Liu et al.  used CRF to learn the characteristic patterns in TCM cases to identify symptoms and cases\[[@CR6]\].  Wang et al.  proposed a probabilistic model for the analysis of symptoms, diseases, and drug relationships in TCM cases\[[@CR7]\].  Although some of these tasks can also learn the low-dimensional representation of nodes, they focused on data with rich semantics.  The majority of TCM medical data, particularly formula-based prescriptions, are lack of good semantic information. 

In this paper, we propose a clustering algorithm based on probability model to solve the clustering problem of heterogeneous information network of traditional Chinese medicine.  For a given target type, we aim to generate the clustering of the target object and the ranking information of the objects in the cluster.  We propose a heterogeneous information network of traditional Chinese medicine, which is a star network schema.  The algorithm can obtain stable clustering results after many iterations.  Our main contributions are as follows:

We propose a clustering algorithm based on probability model, which integrates clustering with ranking information for Chinese medicine formula categorization and discover potential knowledge.  The algorithm can help doctors optimize diagnosis and prescription.  According to the ranking information of each object in the cluster, doctors can easily assess its importance. 

We conducted experiments on real data sets of traditional Chinese medicine.  The experimental results show that the algorithm is effective and accurate.  The algorithm can provide reasonable clustering results for optimizing prescriptions and is confirmed by Chinese medicine experts. 

Social networks, the Internet, medical information networks and many other networks in real world contain a large number of interconnected nodes.  These networks are called information networks \[[@CR8]\].  The ubiquitous information network is an important part of modern information infrastructure.  The nodes in the information network are connected by an intricate network structure, which contains rich information.  At present, information network analysis is not only widely concerned by researchers in various fields, but also a hot topic in the field of data mining and information retrieval.  However, most information network related research has a basic assumption: the types of nodes and the types of links in the network are unique.  That is to say, the researcher does not distinguish the types of nodes and regards them as homogeneous information networks, for example, the author collaboration network.  In fact, these networks are full of different kinds of nodes, and it is more reasonable to think of them as heterogeneous information networks (HINs) with different types of nodes and links.  Heterogeneous information networks contain richer semantic information in nodes and links.  For example, in a bibliographic information network, papers are connected to each other by different types of nodes, such as authors, conferences, and topics.  If a paper is connected to two authors at the same time, the two authors have a cohesive relationship with this paper\[[@CR9]\]. 

Ranking is an important task on the heterogeneous information network, and it faces some challenges.  First, there are different types of objects and relationships in HIN.  Second, different types of objects and relationships have different semantic information.  In addition, the ranking information of different objects will affect each other. Taking the bibliographic heterogeneous network as an example, ranking on authors may have different results under different meta paths \[[@CR10]\] since these meta paths will construct different link structures among authors.  Moreover, the rankings of different-typed objects have mutual effects.  For example, reputable authors generally publish papers in top journals\[[@CR11]\]. 

Clustering is a process of classifying similar objects.  The objects in the same cluster are similar, and the objects between different clusters are dissimilar.  Traditional clustering is generally based on object-based features, such as the K-means algorithm.  At present, network-based clustering (community discovery) and other issues are receiving widespread attention.  The correlation model usually treats it as a homogeneous information network and divides the network into a series of subgraphs in a given way (e.g., normalized cuts and modularity).  Many algorithms have been proposed to solve this NP-hard problem, such as the spectral method \[[@CR12]\], greedy method and sampling technique \[[@CR13]\].  Some studies consider both the link information and attribute information of the object to improve clustering accuracy \[[@CR14]\].  Further, clustering on heterogeneous information networks has received attention. 

Unlike homogeneous networks, different types of objects on heterogeneous information networks present a huge challenge to the task. 

On the one hand, different types of objects in the network bring new forms of clustering.  For example, a cluster may contain different types of objects with the same topic.  A cluster of database domains contains authors, conferences, and papers in this field.  In this case, clustering on heterogeneous information networks has richer semantics, but it also faces more challenges.  On the other hand, the rich information contained in the network helps to improve the accuracy of the task.  Li et al.  put forward the SCHAN algorithm to solve the clustering problem in Attributed HIN\[[@CR15]\].  Zhou et al.  designed a dynamic learning algorithm SI-Cluster for social influence based graph clustering\[[@CR16]\].  Luo et al.  introduced the concept of relation-path to measure the similarity between two objects and propose a framework for semi-supervised learning in HINs\[[@CR17]\].  Undoubtedly, these approaches improved the clustering performance, but they were confined to entities with rich attributes or labeled data. 

Methods {#Sec2}
=======

Problem formulation {#Sec3}
-------------------

In this section, we introduce several important concepts and define the problem of clustering in the TCM HIN. 

### Definition 1 (Heterogeneous Information Network). {# d29e390}

An information network is defined as an undirected graph *G*=\<*V*,*E*\> with an object type mapping function *τ*:*V*→*T* and link type mapping function *ψ*:*E*→*R*, where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$T=\{T_{k}\}_{k=1}^{|T|}$\end{document}$ is a set of object types and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$R=\{R_{k}\}_{k=1}^{|R|}$\end{document}$ is a set of link types on T. Specifically, we call such an information network a HIN when \|*T*\|≥2 and a homogeneous information network when \|*T*\|=1. 

### Definition 2. {# d29e508}

(Network schema) Given a HIN *G*=\<*V*,*E*\>, a network schema is defined as an undirected graph *S*~*G*~=\<*T*,*R*\>, where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$T=\{T_{k}\}_{k=1}^{|T|}$\end{document}$ is a set of object types and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$R=\{R_{k}\}_{k=1}^{|R|}$\end{document}$ is a set of link types on T.

### Definition 3 (Star Network). {# d29e613}

A HIN *G*=\<*V*,*E*\> on \|*T*\| types of entities $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$T=\{T_{k}\}_{k=0}^{K}(K\ge 2)$\end{document}$ is with a star network schema if, ∀*e*=\<*t*~*i*~,*t*~*j*~\>∈*E*,*t*~*i*~∈*T*~0~∧*t*~*j*~∈*T*~*k*~(*k*≠0), or vise versa.  G is then called a star network. * T*~0~ is called the target type, and *T*~*k*~(*k*≠0) are called attribute types\[[@CR11]\].The schema for TCM-HIN is shown in Fig.  [2](#Fig2){ref-type="fig"}.  Fig.  2Schema for TCM-HIN

In this paper, we use *T* to represent the set of types of TCM entities.  We have *T*={*F*~*m*~,*F*~*c*~,*H*,*S*}, where *F*~*m*~,*F*~*s*~,*H*, and *S* denote the entity types "formula", "function", "herb", and "symptom", respectively.  For convenience, we use *F*~*m*~ to denote both the set of objects belonging to the "formula" type and the type name.  Other types are similar to *F*~*m*~. We use *R*={*F*~*m*~*F*~*c*~,*F*~*m*~*H*,*F*~*m*~*S*} to represent the set of types of TCM relations on T, where *F*~*m*~*F*~*c*~,*F*~*m*~*H*, and *F*~*m*~*S* denote the relation types "formula-function", "formula-herb", and "formula-symptom", respectively. 

### Definition 4 (TCM-HIN). {# d29e870}

TCM-HIN is a HIN *G*=\<*V*,*E*\> with star network schema *S*~*G*~=(*T*,*R*), where *T*={*F*~*m*~,*F*~*c*~,*H*,*S*} and *R*={*F*~*m*~*F*~*c*~,*F*~*m*~*H*,*F*~*m*~*S*}\[[@CR18]\].  An example of TCM-HIN is shown in Fig.  [3](#Fig3){ref-type="fig"}.  Fig.  3An example of TCM-HIN

Based on these definitions, we can formulate our key problem as follows: given a TCM-HIN *G*=\<*V*,*E*\>, the target type *T*~0~, and a specified cluster number *K*, we aim to generate *K* clusters {*C*~*K*~} for target objects from target type on *G*, as well as the within-cluster ranking information for all the objects based on these clusters in the network. 

We propose a ranking-based clustering algorithm for mining formula categorization.  In this section, we first introduce the overall clustering framework.  Then, we explain four important parts of the algorithm in detail. 

Framework of algorithm {#Sec4}
----------------------

To integrate ranking with clustering in a HIN, a model is required to flexibly support these two tasks.  Therefore, we propose a probabilistic generative model to estimate the probability of target and attribute objects in the network.  We can use the rankings of objects to infer the probability of objects and clustering information.  The major difficulty in clustering in a HIN is the definition and calculation of pairwise similarity between objects.  We map each target object into a low-dimensional space defined by the current clustering result to avoid defining and calculating similarity between each pair of objects. 

TCM clustering is mainly composed of the following five steps:

∙ Step 0: Randomly initialize partitions of target objects and induce initial clusters from the original network according to these partitions, i.e., $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\{C_{k}^{0}\}_{k=1}^{K}$\end{document}$. Decompose the star schema network into three bipartite networks, where *V*={*F*~*m*~,*S*},{*F*~*m*~,*H*}, and {*F*~*m*~,*S*}, respectively. 

∙ Step 1: For each bipartite network, build a ranking-based probabilistic generative model for target type and attribute type, i.e., $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\{P(x|C_{k}^{t})\}_{k=1}^{K}$\end{document}$.

∙ Step 2: For each bipartite network, estimate the posterior probabilities to each cluster for each target object, i.e., $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\{P(C_{k}^{t}|x)\}_{k=1}^{K}$\end{document}$.

∙ Step 3: Calculate the distance from each target object to each cluster center based on the posterior probabilities and then assign each target object to the nearest cluster. 

∙ Step 4: Repeat Steps 1, 2 and 3 until the cluster does not change significantly or the iteration number is larger than a predefined number. 

The core framework of TCM-Clus is shown in Algorithm 1.  In TCM-HIN, a formula may connect to more than one herb, function, and symptom.  For example, in Fig.  [4](#Fig4){ref-type="fig"}, a formula called ![]( 12911_2019_963_Figa_HTML.gif){#d29e1175} contains two herbs called ![]( 12911_2019_963_Figb_HTML.gif){#d29e1178}(Cinnamomum cassia) and ![]( 12911_2019_963_Figc_HTML.gif){#d29e1181}(arisacma consanguineum) and has two functions called ![]( 12911_2019_963_Figd_HTML.gif){#d29e1184}(dispelling pathogenic wind and eliminating phlegm) and ![]( 12911_2019_963_Fige_HTML.gif){#d29e1188}(boosting source of fire for eliminating abundance of yin).  However, it does not mean that ![]( 12911_2019_963_Figf_HTML.gif){#d29e1191}(Cinnamomum cassia) has both functions.  Therefore, we should decompose the TCM-HIN into several bipartite networks as above, instead of simply making estimation in original TCM-HIN\[[@CR11]\].  In this paper, we decompose the TCM-HIN into three bipartite networks $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\phantom {\dot {i}\!}(G_{S},G_{H},G_{F_{c}})$\end{document}$, which are induced graphs of the original graph G. Because the ranking function and posterior probability estimation for each bipartite network are similar, we only present the explanation for the bipartite network *G*~*S*~=\<*V*,*E*\>, where *V*={*F*~*m*~,*S*} and *G*~*S*~⊆*G*.  Fig.  4Schema for TCM-HIN

Ranking function {#Sec5}
----------------

In information network analysis, the two most important ranking algorithms are PageRank \[[@CR19]\] and HITS \[[@CR20]\], both of which are successfully applied to Internet searches.  PageRank is a link analysis algorithm that assigns a numerical weight to each object of the information network, with the purpose of "measuring" its relative importance within the object set.  Conversely, HITS ranks objects based on two scores: authority and hub.  Authority estimates the value of the content of the object, whereas hub measures the value of its links to other objects.  Both PageRank and HITS evaluate the static quality of objects in the information network, which is similar to the intrinsic meaning of our ranking methods.  However, both PageRank and HITS are designed on a network of webpages, which is a directed homogeneous network, and the weight of the edge is binary. 

### Definition 5 (Ranking Distribution and Ranking Function). {# d29e1298}

A ranking distribution *P*(**T**) on a type of object T is a discrete probability distribution, which satisfies *P*(*T*=*t*)≥0(∀*t*∈*T*) and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\sum _{t \in T}P(T=t)=1$\end{document}$. A function *f*:*G*→*P*(**T**) defined on an information network *G* is called a ranking function on type *T* if given an information network *G*, it can output a ranking distribution *P*(**T**) on *T*. 

Ranking is beneficial for people to grasp the importance of objects in a collection.  For example, PageRank and authority of HITS represent the static importance of webpages, while the rank of a document to a given query in text retrieval reflects the relevance of the document to that query. 

We use W to represent the adjacency matrix, which we call the relation matrix, between the target type and the attribute type.  We can define the matrix as $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$W_{F_{m}S}(i,j)=p_{ij} $$ \end{document}$$ where *i* and *j* are two objects from type *F*~*m*~ and type *S* and *p*~*ij*~ is the frequency of *i* that links to *j*. 

We have two simple empirical rules:

∙ Rule 1: Highly ranked formulas can cure highly ranked symptoms. 

∙ Rule 2: One highly ranked symptom can enhance the rank of another symptom if they are cured by the same formula. 

According to Rule 1, we generate the ranks of types *F*~*m*~ and *S* as follows: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$P(f_{mi}|F_{m},G)=\sum_{j=1}^{|S|}W_{F_{m}S}(f_{mi},j)P(s_{j}|S,G)  $$ \end{document}$$

$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$P(s_{j}|S,G)=\sum_{i=1}^{|F_{m}|}W_{SF_{m}}(s_{j},i)P(f_{mi}|F_{m},G)  $$ \end{document}$$

where *G* is a network, *f*~*mi*~ is an object from type *F*~*M*~, and *s*~*j*~ is an object from type *S*.  Notice that the normalization will not change the ranking position of an object, but it provides a relative importance score to each object.  After normalization, we have $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ P(\mathbf{F}_{\mathbf{m}}|F_{m},G)=\frac{W_{F_{m}S}P(\mathbf{S}|S,G)}{\| W_{F_{m}S}P(\mathbf{S}|S,G)\|}   $$ \end{document}$$

$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ P(\mathbf{S}|S,G)=\frac{W_{SF_{m}}P(\mathbf{F}_{\mathbf{m}}|F_{m},G)}{\| W_{SF_{m}}P(\mathbf{F}_{\mathbf{m}}|F_{m},G)\|}   $$ \end{document}$$

We can prove that *P*(**F**~**m**~\|*F*~*m*~,*G*) is the eigenvector of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$W_{F_{m}S}W_{SF_{m}}$\end{document}$ and *P*(**S**\|*S*,*G*) is the eigenvector of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$W_{SF_{m}}W_{F_{m}S}$\end{document}$.

### *Proof* {#d29e2059}

Combining ([3](#Equ3){ref-type=""}) and ([4](#Equ4){ref-type=""}), we can obtain $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$\begin{aligned} P(\mathbf{F}_{\mathbf{m}}|F_{m},G) &=\frac{W_{F_{m}S}P(\mathbf{S}|S,G)}{\| W_{F_{m}S}P(\mathbf{S}|S,G)\|}\\ &=\frac{W_{F_{m}S} \frac{W_{SF_{m}}P(\mathbf{F}_{\mathbf{m}}|F_{m},G)}{\| W_{SF_{m}}P(\mathbf{F}_{\mathbf{m}}|F_{m},G)\|}} {\| W_{F_{m}S}\frac{W_{SF_{m}}P(\mathbf{F}_{\mathbf{m}}|F_{m},G)}{\| W_{SF_{m}}P(\mathbf{F}_{\mathbf{m}}|F_{m},G)\|}\|}\\ &=\frac{W_{F_{m}S}W_{SF_{m}}P(\mathbf{F}_{\mathbf{m}}|F_{m},G)}{\| W_{F_{m}S}W_{SF_{m}}P(\mathbf{F}_{\mathbf{m}}|F_{m},G)\|} \end{aligned} $$ \end{document}$$

Thus, *P*(**F**~**m**~\|*F*~*m*~,*G*) is the eigenvector of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$W_{F_{m}S}W_{SF_{m}}$\end{document}$. Similarly, *P*(**S**\|*S*,*G*) is the eigenvector of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$W_{SF_{m}}W_{F_{m}S}$\end{document}$. We can use the power method to calculate the primary eigenvector.  □

When considering Rule 2, we can revise the equation as $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ \begin{aligned} P(s_{j}|S,G)&=\alpha\sum_{i=1}^{|F_{m}|}W_{SF_{m}}(s_{j},i)P(f_{mi}|F_{m},G)\\ &+(1-\alpha)\sum_{i=1}^{|S|}W_{SS}(j,i)P(s_{j}|S,G) \end{aligned}  $$ \end{document}$$

where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\phantom {\dot {i}\!}W_{SS} = W_{SF_{m}}W_{F_{m}S}$\end{document}$ and parameter *α*∈\[0,1\] determines the weight of "symptom-formula" and "symptom-symptom".  Similarly, we can prove that *P*(**S**\|*S*,*G*) should be the primary eigenvector of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\alpha W_{SF_{m}}W_{F_{m}S}+(1-\alpha)W_{SS}$\end{document}$, and *P*(**F**~**m**~\|*F*~*m*~,*G*) should be the primary eigenvector of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\alpha W_{F_{m}S}(I-(1-\alpha)W_{SS})^{-1}W_{SF_{m}}$\end{document}$.

In fact, if we consider the problem from the perspective of the meta path, these two rules reflect the meta path based relationship between objects.  Rule 1 corresponds to meta path *S*−*F*~*m*~, while Rule 2 corresponds to meta path *S*−*F*~*m*~−*S*. 

Ranking-based probabilistic generative model {#Sec6}
--------------------------------------------

We assume that the probabilities that objects from different types will be visited in the given network are independent of each other.  The probability of visiting an object in *G* can be decomposed into two parts: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$p(x|G)=p(T_{x}|G)\times p(x|T_{x},G) $$ \end{document}$$ where the first part *p*(*T*~*x*~\|*G*) is the general probability that the type of *x* will be visited in the network *G* and the second part *p*(*x*\|*T*~*x*~,*G*) is the probability that an object *x* will be visited among all the objects from type *T*~*x*~ in the network *G*.  Here, we consider the ranking distribution as the probability of objects to be visited within their own type in a given information network G. We will show that the value of *p*(*T*~*x*~\|*G*) is not important and can be set to 1 later.  In a subnetwork *G*~*k*~=*G*(*C*~*k*~), we can calculate the probability of visiting an object: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$p(x|G_{k})=p(T_{x}|G_{k})\times p(x|T_{x},G_{k}) $$ \end{document}$$ However, we will encounter problems if we use the above equation directly.  In a given cluster, a target object may link to objects whose ranking is zero in that cluster.  In addition, a target object may not belong to the current cluster.  If we simply assign the probability of visiting the target object as zero in that cluster, then we will lose some important information.  To solve this problem, we can use smoothing, which is a well-known technique in information retrieval to cope with the zero probability problem for missing terms in a document \[[@CR21]\].  We add the global ranking to smooth the conditional ranking before calculating the visibility for the target object: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ p(x|T_{x},G_{k})=(1-\lambda)p(x|T_{x},G_{k}) + \lambda p(x|T_{x},G)  $$ \end{document}$$

where the smoothing parameter *λ* denotes the portion of global ranking. 

To evaluate the model, we make another independence assumption that the probabilities that objects from the same types will be visited are also independent of each other: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ p(x_{i},x_{j}|T_{x},G)=p(x_{i}|T_{x},G)\times p(x_{j}|T_{x},G)  $$ \end{document}$$

where *x*~*i*~,*x*~*j*~∈*T*~*x*~.

Posterior probability estimation using EM algorithm {#Sec7}
---------------------------------------------------

To determine which cluster target objects belong to, we estimate the posterior probability for each target object.  For convenience, we use *X* and *Y* to represent types *F*~*m*~ and *S*, where \|*X*\|=*m* and \|*Y*\|=*n*. 

Given a clustering on the input network G, we can calculate the posterior probability for each target object using the Bayesian rule: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$p(G_{k}|x_{i})\propto p(x_{i}|G_{k})\times p(k) $$ \end{document}$$, where *p*(*x*~*i*~\|*G*~*k*~) is the probability that target object *x*~*i*~ will be visited in cluster *k* and *p*(*k*) denotes the relative size of cluster *k*.  From this formula, we can see that type probability *p*(*T*\|*G*) is just a constant for calculating the posterior probabilities for target objects and can be neglected. 

Let *Θ* be the parameter matrix, which is an *m*×*K* matrix: *Θ*~*m*×*k*~={*P*(*G*~*k*~\|*x*~*i*~)}(*i*=1,2,⋯,*m*;*k*=1,2,⋯,*K*).  To obtain the best *Θ* that maximizes the likelihood to generate the whole bipartite network, we have the following likelihood function: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$L(\Theta|W_{XY})=P(W_{XY}|\Theta)= \prod_{i=1}^{m}\prod_{j=1}^{n}P(x_{i},y_{j}|\Theta)^{W_{XY}(i,j)}$$ \end{document}$$, where *P*(*x*~*i*~,*y*~*j*~\|*Θ*) is the probability of generating link \<*x*~*i*~,*y*~*j*~\> given the current parameter.  Because it is difficult to maximize *L* directly, we apply the EM algorithm to solve the problem.  In the E-Step, we introduce hidden variable *z*∈{1,2,⋯,*K*} to represent the cluster label that a link \<*x*,*y*\> is from.  The complete log likelihood can be written as $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$\begin{aligned} \log L &=\log \prod_{i=1}^{m}\prod_{j=1}^{n}P(x_{i},y_{j},z|\Theta)^{W_{XY}(i,j)} \\ &=\log \prod_{i=1}^{m}\prod_{j=1}^{n}[p(x_{i},y_{j}|z,\Theta)p(z|\Theta)]^{W_{XY}(i,j)} \\ &=\sum_{i=1}^{m} \sum_{j=1}^{n} W_{XY}(i,j) \log (p(x_{i},y_{j}|z)p(z|\Theta)) \end{aligned} $$ \end{document}$$ Initially, we can set the parameters in *Θ*^(0)^ as even values.  The expectation of the log likelihood under the current distribution of *Z* is $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ \begin{aligned} &Q(\Theta,\Theta^{(t)})\\ &=\sum_{k=1}^{K}\sum_{i=1}^{m}\sum_{j=1}^{n}[W_{XY}(i,j)\\ &\quad\times \log(P(x_{i},y_{j}|z=k)P(z=k|\Theta^{(t)}))P(z=k|x_{i},y_{j},\Theta^{(t)})]\\ &=\sum_{i=1}^{m}\sum_{k=1}^{K}\sum_{j=1}^{n}[W_{XY}(i,j) \log(P(z=k|\Theta^{(t)}))P(z=k|x_{i},y_{j},\Theta^{(t)})]\\ &\quad+\sum_{k=1}^{K}\sum_{i=1}^{m}\sum_{j=1}^{n}[W_{XY}(i,j)\log(P(x_{i},y_{j}|z=k))P(z=k|x_{i},y_{j},\Theta^{(t)})] \end{aligned}  $$ \end{document}$$

where *Θ*^(*t*)^ is the parameter matrix after *t* iterations. 

We can use the Bayesian rule to calculate conditional distribution *P*(*z*=*k*\|*x*~*i*~,*y*~*j*~,*Θ*^(*t*)^) as follows: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ {}P(z=k|x_{i},y_{j},\Theta^{(t)})\propto p^{(t)}(x_{i}|k)p^{(t)}(y_{j}|k)p^{(t)}(z=k)   $$ \end{document}$$

In the M-Step, to obtain *P*^(*t*+1)^(*z*=*k*) that maximizes *Q*(*Θ*,*Θ*^(*t*)^), we introduce the Lagrange multiplier *λ*.  For each *P*(*z*=*k*), where *k*=1,2,⋯,*K*, we have $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $${}\begin{aligned} &\frac{\partial}{\partial P(z=k)}[Q(\Theta,\Theta^{(t)})+\lambda(\sum_{k=1}^{K}P(z=k)-1))]=0\\ \Rightarrow&\sum_{i=1}^{m}\sum_{j=1}^{n}W_{XY}(i,j)\frac{1}{P(z=k)}P(z=k|x_{i},y_{j},\Theta^{(t)})+\lambda=0 \end{aligned} $$ \end{document}$$ Now, integrating with ([9](#Equ9){ref-type=""}), we can obtain the new estimation for *P*(*z*=*k*): $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ {}p^{(t+1)}(z=k)=\frac{\sum_{i=1}^{m} \sum_{j=1}^{n} W_{XY}(i,j)P\left(z=k|x_{i},y_{j},\Theta^{(t)}\right)}{\sum_{i=1}^{m} \sum_{j=1}^{n} W_{XY}(i,j)}  $$ \end{document}$$

Finally, each parameter in *Θ* is calculated as $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ P(G_{k}|x_{i})=P(z=k|x_{i})=\frac{P(x_{i}|G_{k})P(z=k)}{\sum_{l=1}^{K}P(x_{i}|G_{l})P(z=l)}  $$ \end{document}$$

Cluster assignment {#Sec8}
------------------

After we obtain the estimations for each target object in each bipartite network, we can represent the target object as a 3*K*-dimensional vector $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$\begin{array}{*{20}l} {}\vec{s}_{X_{i}}&=(p_{S}(G_{1}|x_{i}),\ldots,p_{S}(G_{K}|x_{i}),\ldots,\\ &\qquad p_{F_{c}}(G_{K}|x_{i}),\ldots,p_{H}(G_{K}|x_{i}))\end{array} $$ \end{document}$$

The centers for each cluster can thus be calculated accordingly, which is the arithmetic mean of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\vec {s}_{X_{i}}$\end{document}$ for all *x*~*i*~ in each cluster: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$\vec{s}_{C_{k}}=\frac{\sum_{x\in C_{k}}\vec{s}(x)}{|C_{k}|} $$ \end{document}$$

where *x*~*i*~ is an object from type *F*~*m*~ and \|*X*~*k*~\| is the size of the cluster k.

The distance between an object and cluster is defined by 1 minus cosine similarity: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ D(x,C_{k})=1-\frac{\sum_{l=1}^{K}\vec{s}_{x}(l)\vec{s}_{C_{k}}(l)}{\sqrt{\sum_{l=1}^{K}(\vec{s}_{x}(l))^{2}}\sqrt{\sum_{l=1}^{K}(\vec{s}_{C_{k}}(l))^{2}}}  $$ \end{document}$$

Then, we can assign each object to the cluster with the smallest distance. 

User-guided clustering {#Sec9}
----------------------

User guidance is critical for clustering objects in the network\[[@CR22]\].  Using different types of link information in a network, different reasonable clustering results can be generated.  We take user guidance in the form of object seeds for some clusters as the prior knowledge for the clustering result *Θ* by modeling the prior as a Dirichlet distribution rather than treating them as hard labeled ones.  For each target object *x*~*i*~, its clustering probability vector *P*(**G**\|*x*~*i*~) is a multinomial distribution, which is generated from some Dirichlet distribution.  If *x*~*i*~ is labeled as a seed in cluster *k*^∗^,*P*(**G**\|*x*~*i*~) is then modeled as being sampled from a Dirichlet distribution with parameter vector $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\phantom {\dot {i}\!}\lambda _{d}\mathbf {e}_{k^{*}}+1$\end{document}$, where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$\phantom {\dot {i}\!}\mathbf {e}_{k^{*}}$\end{document}$ is a K-dimensional basis vector, with the *k*^∗^th element as 1 and 0 elsewhere.  If *x*~*i*~ is not a seed, *x*~*i*~ is then assumed as being sampled from a uniform distribution, which can also be viewed as a Dirichlet distribution with a parameter vector of **1**.The density of *P*(**G**\|*x*~*i*~) given such priors is $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $${}P(\mathbf{G}|x_{i},\lambda_{d})=\left\{ \begin{aligned} &\prod_{k}P(G_{k}|x_{i})^{\mathbf{1}\{ x_{i} \in G_{k} \}\lambda_{d}}&,x_{i} is \,labeled\, as\, k^{*}\\ &1&,x_{i}\, is\, not \,labeled.  \end{aligned} \right.  $$ \end{document}$$ where **1**{*x*~*i*~∈*G*~*k*~} is an indicator function, which is 1 if *x*~*i*~∈*G*~*k*~ holds and 0 otherwise.  The hyperparameter *λ*~*d*~ is a nonnegative value and controls the strength of users' confidence over the object seeds in each cluster. 

Time complexity analysis {#Sec10}
------------------------

The time complexity of TCM-Clus is composed of the following parts.  First, the time complexity for ranking is *O*(*t*~1~\|*E*\|), where *t*~1~ is the iteration number and \|*E*\| is the number of links.  Notice that \|*E*\|≪\|*V*\|^2^ in a sparse network, where \|*V*\| is the total number of objects in the network.  Second, for the posterior probability estimation, we need to calculate *O*(*K*\|*E*\|+*K*+*mK*) parameters at each iteration, where the time complexity for (9) is *O*\|*K*\|*E*\|\|, the time complexity for (10) is *O*(*K*), and the time complexity for (11) is *O*(*mK*).  Third, the cluster adjustment for each object has complexity *O*(*mK*^2^).  Since we need to compute the distance between each object and each cluster, the dimension of an object is *K*.  In total, the time complexity for TCM-Clus is *O*(*t*~1~\|*E*\|+*t*~2~(*K*\|*E*\|+*K*+*mK*)+*mK*^2^), where *t*~2~ is the iteration number of the estimation.  If the network if sparse, which is typical in most applications, the time complexity is almost linear to the number of objects in the network. 

Results {#Sec11}
=======

In this section, we conduct several experiments to show the effectiveness of TCM-Clus.  We discuss the evaluation of TCM-Clus.  First, we introduce the datasets used in this paper.  Then, we discuss the evaluation of TCM-Clus. 

Datasets {#Sec12}
--------

In this paper, we use the real datasets ChP, The Pharmacopoeia of the People's Republic of China 2015 Edition (<http://wp.chp.org.cn/en/index.html>), and 3K+ TCM clinical cases mainly in the stomach.  We use herb information in Volume I, which contains 2598 types of medicinal materials without classifications, to set up our experiments.  ChP is a unstructured corpus and contains various information.  We only extract formula, function, herb, and symptom to build TCM-HIN. 

Quantitative evaluation {#Sec13}
-----------------------

We use FVIC (fraction of vertices identified correctly) to evaluate the clustering accuracy of the clustering results.  It has been used in many research projects and is defined as follows: $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document} $$ \begin{aligned} &olSet(c,c*)=\{v|v\in c\wedge v\in c^{*}\}\\ &maxolSet(c,C_{K})=max_{c\in C_{K}}\{|olSet(c,c^{*})|\}\\ &FVIC=\sum_{c\in C_{F}}\frac{maxolSet(c,C_{K})}{N} \end{aligned}  $$ \end{document}$$

where *C*~*F*~ and *C*~*K*~ represent the found clusters and known clusters, respectively. * c* and *c*^∗^ are clusters in *C*~*F*~ and *C*~*K*~, respectively.  N is the number of objects in the network.  FVIC evaluates the average matching degree by comparing each predicted cluster with the most matching real cluster.  A higher score indicates a better clustering with respect to the ground truth. 

We compare TCM-Clus with spectral clustering, which is the k-way Ncut algorithm and has been used to cluster Western medical records\[[@CR23]\]; PaReCat, which has been used to cluster Chinese medical records for the task of patient record categorization\[[@CR24]\]; and K-Means, a common clustering technique.  In this experiment, we fix the smoothing parameter *λ* as 0.2 and weight parameter *α* as 0.8.  The accuracy results are shown in Table [1](#Tab1){ref-type="table"}.  Table 1Clustering Accuracy for Two DatasetsK-MeansPaReCatspectralTCM-ClusChp0.4730.7480.7410.825Clinical cases0.5890.8350.7870.875

We can observe that TCM-Clus achieves the best clustering accuracy on the two datasets.  K-Means shows poor performance because our medical data lack semantic information.  Spectral has a good result.  However, due to omitting the structure of the graph, it has worse performance compared to TCM-Clus.  The performance of PaReCat is closest to our algorithm, but it is more suitable for patient record categorization with disease, symptom and herb.  We have shown that TCM-Clus can indeed improve clustering accuracy by integrating ranking with clustering. 

Parameter study {#Sec14}
---------------

We use clustering accuracy to analyze the effect of different smoothing parameters *λ* on Chp dataset.  We represent three different *λ*s for symptom, herb, function as *λ*~*s*~,*λ*~*h*~ and *λ*~*f*~, respectively.  We change one type of *λ* and fix the other two to 0.2.  We run TCM-Clus on ChP datasets, and the results are shown in Fig.  [5](#Fig5){ref-type="fig"}.  The results are based on ten different initial partitions.  We can observe that TCM-Clus achieves better accuracy when *λ* is from 0.1 to 0.8.  If the smoothing parameter *λ* is too small or too large, it means that we only consider conditional ranking or global ranking.  Too small (*λ*→0) or too large (*λ*→1) will decrease the performance of TCM-Clus.  Fig.  5Clustering accuracy with different smoothing parameters

We also examine the impact of iteration number on the clustering accuracy.  As shown in Fig.  [6](#Fig6){ref-type="fig"}, the clustering accuracy is poor when the iteration number is too small.  As the iteration number becomes larger, the accuracy improves and then stabilizes.  Fig.  6Clustering accuracy with different iteration numbers

Lastly, we examine the impact of the weight parameter *α* and the result is shown in Fig.  [7](#Fig7){ref-type="fig"}, If the weight parameter *α* is too small or too large, it means that we only consider one kind of meta path based relationships.  Shorter meta paths have more information than longer ones.  If *α*=1, the clustering accuracy equals 0.791, which is larger than 0.765(*α*=0).  Fig.  7Clustering accuracy with different weight parameters

Qualitative evaluation {#Sec15}
----------------------

We apply our methods to investigate whether TCM-Clus can effectively cluster formulas into informative categories.  The results are testified by TCM experts, and many of them are widely used in clinical diagnosis.  We show the top-10 herbs and formulas in a cluster identified by our method in Table [2](#Tab2){ref-type="table"} and the top-5 functions and symptoms in a cluster in Table [3](#Tab3){ref-type="table"}.  Table 2Top-10 Herbs and Formulas in A ClusterFormulaRankHerbRank1![](12911_2019_963_Figh_HTML.gif){#d29e6843}(tian xing chi yan fang)0.0199![](12911_2019_963_Figi_HTML.gif){#d29e6851}(Chinese liquorice)0.06122![](12911_2019_963_Figj_HTML.gif){#d29e6863}0.0136![](12911_2019_963_Figk_HTML.gif){#d29e6870}(weeping forsythia)0.06043![](12911_2019_963_Figl_HTML.gif){#d29e6882}(nei shu huang lian tang)0.0128![](12911_2019_963_Figm_HTML.gif){#d29e6890}(gardenia)0.05924![](12911_2019_963_Fign_HTML.gif){#d29e6902}(shu feng qing re tang)0.0120![](12911_2019_963_Figo_HTML.gif){#d29e6910}(A. propinquus)0.04715![](12911_2019_963_Figp_HTML.gif){#d29e6922}(xie fei yin)0.0110![](12911_2019_963_Figq_HTML.gif){#d29e6930}(Chinese peony root)0.04256![](12911_2019_963_Figr_HTML.gif){#d29e6942}(qing yan li ge tang)0.0104![](12911_2019_963_Figs_HTML.gif){#d29e6950}(Chinese goldthread)0.04117![](12911_2019_963_Figt_HTML.gif){#d29e6962}(liang ge san)0.0102![](12911_2019_963_Figu_HTML.gif){#d29e6970}(Chinese bellflower)0.03538![](12911_2019_963_Figv_HTML.gif){#d29e6982}(huan yin jiu ku tang)0.0078![](12911_2019_963_Figw_HTML.gif){#d29e6990}(female ginseng)0.02889![](12911_2019_963_Figx_HTML.gif){#d29e7002}(liang ying qing qi tang)0.0076![](12911_2019_963_Figy_HTML.gif){#d29e7010}(gypsum fibrosum)0.027910![](12911_2019_963_Figz_HTML.gif){#d29e7022}(qing wen bai du yin)0.0072![](12911_2019_963_Figaa_HTML.gif){#d29e7030}(tenuifolia)0.0274 Table 3Top-5 Functions and Symptoms in A ClusterFunctionRankSymptomRank1![](12911_2019_963_Figab_HTML.gif){#d29e7072}(clearing heat and detoxifying)0.0213![](12911_2019_963_Figac_HTML.gif){#d29e7080}(swelling and pain of eye)0.01352![](12911_2019_963_Figad_HTML.gif){#d29e7092}(dispelling wind and heat)0.0207![](12911_2019_963_Figae_HTML.gif){#d29e7100}(red face and labial coke)0.01303![](12911_2019_963_Figaf_HTML.gif){#d29e7112}(clearing heat QI)0.0185![](12911_2019_963_Figag_HTML.gif){#d29e7120}(sore throat and losing voice)0.01244![](12911_2019_963_Figah_HTML.gif){#d29e7132}(cooling the blood and detoxifying)0.0143![](12911_2019_963_Figai_HTML.gif){#d29e7140}(coughing with lung heat)0.01175![](12911_2019_963_Figaj_HTML.gif){#d29e7152}(clearing bowel and visceral heat)0.0122![](12911_2019_963_Figak_HTML.gif){#d29e7160}(feeling muggy and distension)0.0106

Case evaluation {#Sec16}
---------------

As mentioned above, TCM-Clus can achieve high quality categorizations.  Furthermore, we can obtain new knowledge from clusters, such as "different formulas with similar herbs", "different formulas with similar functions", "different symptoms with similar herbs" and so on.  We show an example of "different symptoms with similar herbs" discovered by TCM-Clus in Table [4](#Tab4){ref-type="table"}.  Table 4Different Symptoms with Similar HerbsSymptomsHerbsCommon Herbs![](12911_2019_963_Figal_HTML.gif){#d29e7200}(epigastric pain), ![]( 12911_2019_963_Figam_HTML.gif){#d29e7203}(heartburn), ![]( 12911_2019_963_Figan_HTML.gif){#d29e7206}(belching), ![]( 12911_2019_963_Figao_HTML.gif){#d29e7209}(fullness) ![]( 12911_2019_963_Figap_HTML.gif){#d29e7212}(tongue coating),![](12911_2019_963_Figaq_HTML.gif){#d29e7217}(red thorowax),![](12911_2019_963_Figar_HTML.gif){#d29e7220}(bitter orange), ![]( 12911_2019_963_Figas_HTML.gif){#d29e7223}(Chinese peony), ![]( 12911_2019_963_Figat_HTML.gif){#d29e7226}(Java grass), ![]( 12911_2019_963_Figau_HTML.gif){#d29e7229}(Chuanxiong), ![]( 12911_2019_963_Figav_HTML.gif){#d29e7232}(mandarine peel), ![]( 12911_2019_963_Figaw_HTML.gif){#d29e7236}(magnolia-bark), ![]( 12911_2019_963_Figax_HTML.gif){#d29e7239}(barley), ![]( 12911_2019_963_Figay_HTML.gif){#d29e7242}(Chinese liquorice), ![]( 12911_2019_963_Figaz_HTML.gif){#d29e7245}(rice sprout)![](12911_2019_963_Figba_HTML.gif){#d29e7250}(red thorowax), ![]( 12911_2019_963_Figbb_HTML.gif){#d29e7253}(bitter orange), ![]( 12911_2019_963_Figbc_HTML.gif){#d29e7256}(Chinese peony), ![]( 12911_2019_963_Figbd_HTML.gif){#d29e7259}(Java grass), ![]( 12911_2019_963_Figbe_HTML.gif){#d29e7262}(Chuanxiong), ![]( 12911_2019_963_Figbf_HTML.gif){#d29e7265}(mandarine peel), ![]( 12911_2019_963_Figbg_HTML.gif){#d29e7269}(Chinese liquorice)![](12911_2019_963_Figbh_HTML.gif){#d29e7275}(Poor food and drink), ![]( 12911_2019_963_Figbi_HTML.gif){#d29e7278}(Fatigue), ![]( 12911_2019_963_Figbj_HTML.gif){#d29e7281}(stringy pulse), ![]( 12911_2019_963_Figbk_HTML.gif){#d29e7284}(pink tongue), ![]( 12911_2019_963_Figbl_HTML.gif){#d29e7287}(Liver distention and pain)![](12911_2019_963_Figbm_HTML.gif){#d29e7292}(red thorowax),![](12911_2019_963_Figbn_HTML.gif){#d29e7295}(bitter orange),![](12911_2019_963_Figbo_HTML.gif){#d29e7298}(Chinese peony), ![]( 12911_2019_963_Figbp_HTML.gif){#d29e7301}(Java grass),![](12911_2019_963_Figbq_HTML.gif){#d29e7304}(Chuanxiong),![](12911_2019_963_Figbr_HTML.gif){#d29e7307}(mandarine peel), ![]( 12911_2019_963_Figbs_HTML.gif){#d29e7311}(female ginseng),![](12911_2019_963_Figbt_HTML.gif){#d29e7314}(woad root),![](12911_2019_963_Figbu_HTML.gif){#d29e7317}(Field pennycress), ![]( 12911_2019_963_Figbv_HTML.gif){#d29e7320}(Chinese liquorice),![](12911_2019_963_Figbw_HTML.gif){#d29e7323}(red dates)![](12911_2019_963_Figbx_HTML.gif){#d29e7330}(pale tongue), ![]( 12911_2019_963_Figby_HTML.gif){#d29e7333}(thin coating) ![]( 12911_2019_963_Figbz_HTML.gif){#d29e7336}(Live Qi), ![]( 12911_2019_963_Figca_HTML.gif){#d29e7339}(stringy pulse), ![]( 12911_2019_963_Figcb_HTML.gif){#d29e7342}(Lump in breast)![](12911_2019_963_Figcc_HTML.gif){#d29e7347}(red thorowax),![](12911_2019_963_Figcd_HTML.gif){#d29e7350}(bitter orange),![](12911_2019_963_Figce_HTML.gif){#d29e7353}(Chinese peony), ![]( 12911_2019_963_Figcf_HTML.gif){#d29e7356}(Java grass),![](12911_2019_963_Figcg_HTML.gif){#d29e7359}(Chuanxiong),![](12911_2019_963_Figch_HTML.gif){#d29e7362}(mandarine peel), ![]( 12911_2019_963_Figci_HTML.gif){#d29e7366}(rhizoma sparganii),![](12911_2019_963_Figcj_HTML.gif){#d29e7369}(curcuma zedoary),![](12911_2019_963_Figck_HTML.gif){#d29e7372}(raw oyster), ![]( 12911_2019_963_Figcl_HTML.gif){#d29e7375}(Chinese liquorice),![](12911_2019_963_Figcm_HTML.gif){#d29e7378}(sea-tent),![](12911_2019_963_Figcn_HTML.gif){#d29e7381}(Sargassum)

Besides, given a symptom as an input, our system can output proper herb/formula for the symptom.  We have listed the herbs used for two symptoms in Table [5](#Tab5){ref-type="table"}.  The results are testified by TCM experts, and many of them are widely used in these symptoms.  Table 5An example for our recommendationSymptom![](12911_2019_963_Figco_HTML.gif){#d29e7408}(pharyngitis)![](12911_2019_963_Figcp_HTML.gif){#d29e7413}(Deficiency of spleen and deficiency of food)Herb 1![](12911_2019_963_Figcq_HTML.gif){#d29e7423}(Picria fel-terrae)![](12911_2019_963_Figcr_HTML.gif){#d29e7428}(sea-buckthorn)Herb 2![](12911_2019_963_Figcs_HTML.gif){#d29e7437}(semen oroxyli)![](12911_2019_963_Figct_HTML.gif){#d29e7442}(fuling)Herb 3![](12911_2019_963_Figcu_HTML.gif){#d29e7451}(lignum et folium trachelospermi)![](12911_2019_963_Figcv_HTML.gif){#d29e7456}(ginseng)Herb 4![](12911_2019_963_Figcw_HTML.gif){#d29e7465}(herba taching)![](12911_2019_963_Figcx_HTML.gif){#d29e7470}(yam)Herb 5![](12911_2019_963_Figcy_HTML.gif){#d29e7479}(Lonicera confusa DC.)![](12911_2019_963_Figcz_HTML.gif){#d29e7484}(Chinese-date)

Discussion {#Sec17}
==========

Based on our algorithm, we can learn potential knowledge in TCM, such as discovering similar prescriptions and recommending Chinese medicine based on symptoms.  There are still some entities that we have not considered, such as the amount of herb and the information of patients.  In our future work, more research is needed to address general HINs with more kinds of entities.  In addition, the ranking function is highly related to different domains, and how we can automatically extract rules based on small partial ranking results given by experts could be another interesting problem. 

Conclusions {#Sec18}
===========

TCM is one of the most important complementary and alternative medicines.  However, the complexity and elusiveness of diagnostic methods limit its development and generalization.  Formulas are an essential part of TCM.  Mining categorizations from TCM medical records is an important task for precision medicine.  We present a novel algorithm, TCM-Clus, for mining formula categorization.  We use a generative probabilistic model based on ranking to generate the reachable probability of target objects.  Meanwhile, Bayesian rules and the EM algorithm are utilized to estimate the posterior probability.  The experiments show that TCM-Clus achieves better clustering results than other representative algorithms and is beneficial for enhancing the predictive accuracy of medicine. 

HIN

:   Heterogeneous information network TCM: Traditional Chinese medicine

**Publisher's Note**

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. 

Xintian Chen and Chunyang Ruan contributed equally to this work. 

CR and YZ designed the study.  XC and CR designed the model and programmed the algorithm.  HC verified the experimental results.  All authors were involved in the revision of the manuscript.  XC and CR contributed equally. 

This work is supported in part by the Chinese National Natural Science Foundation (No.  61332013), the the Research Innovation Plan of Shanghai Education Commission (No.  14YS026) and the Research Foundation of Shanghai Municipal Health and Family Planning Commission (No.  JP013).  Publication costs are funded by the Chinese National Natural Science Foundation (No.  61332013)

The Chinese Pharmacopoeia 2015 Edition (<http://wp.chp.org.cn/en/index.html>). 

Not applicable. 

Not applicable. 

The authors declare that they have no competing interests.