# A Multi-Model Approach for User Portrait
## 3 The Multi-Stage User Portrait Model
### User Portrait Based on SVM  
SVM has a strong theoretical basis that can ensure that the global optimal solution rather than the local minimum can be explained. In other words, SVM, which originally intends to find a way to deal with two kinds of data classification problems, has a good generalization ability for unknown samples. That is why we decided to use SVM for text classification. To perform classification, SVM first extracts features from the original space and maps the samples in the original space to a vector of higher dimensional feature space so as to solve the linear indivisibility of the original space.  
Let us assume that the training dataset is \((x_{1},y_{1})\), \((x_{2},y_{2})\),..., \((x_{1},y_{1})\), \(x\in\)R\({}_{n}\), \(y\in\)\(\{+1,-1\}\). To find the optimal hyperplane \(Wx+b=0\), we need to solve Formula (1).  
\[\text{Max }W(\alpha)=\sum_{i=1}^{l}\alpha_{i}-\frac{1}{2}\sum_{i=1}^{l}\sum_{j=1} ^{l}\alpha_{i}\alpha_{j}y_{i}y_{j} \tag{1}\]  
where \(\alpha_{i}\geq 0(i=1,2,\ldots,l)\) and \(\sum\limits_{i=1}^{l}\alpha_{i}\alpha_{j}=0\), and Formula (2) is used after getting \(\alpha\).  
\[w=\sum_{i=1}^{l}y_{i}\alpha_{i}x_{i} \tag{2}\]  
Then, we get \(w\), which satisfies Formula (3):  
\[\big{|}f_{w,b}(x_{i})\big{|}=1 \tag{3}\]  
Thus, we get \(b\).  
Finally, to determine whether a certain sample \(z\) belongs to class \(\alpha\), we need to go through the following two steps:  
1. First, we calculate \(x=(z)\);
2. The following decision function is calculated: \[f(x)=\text{sgn}[\sum_{i=1}^{l}y_{i}\alpha_{i}(x,x_{i})+b]\] (4)  
Figure 2: Multi-model execution process.  
If _f(x)_ = 1, then z is a member of class \(\alpha\), otherwise it is not.  
Following are the steps for a user portrait based on the SVM model.  
SVM is a supervised learning model that uses the \(D_{l}\) of a manually classified document set to train the classifier. To improve the accuracy of the classification, we should increase the size of the training set \(D_{l}\) by increasing the number of documents contained in \(D_{l}\). However, the well-classified document set \(D_{l}\) is an expensive and scarce resource compared to the unclassified document set \(D_{w}\), and, in fact, the number in \(D_{w}\) is generally much larger than \(\mid D_{l}\mid\).  
The EM algorithm regards the classification of unclassified documents as incomplete data and would transform \(D_{w}\) into \(D_{l}\) automatically through iteration, thus enlarging the sale of training set \(D\). The iterative algorithm LSTM discussed in this paper combines the EM algorithm and the SVM algorithm and makes \(D\) = {\(D_{l}\), \(D_{w}\)}, exhibiting the characteristics of supervised learning and unsupervised learning. It is thus a semi-supervised learning algorithm.  
Let \(D_{l}\) and \(D_{w}\) be classified and unclassified documents, respectively. In addition, let \(Z_{k}\) represent the collection of categories of unclassified documents at iteration k, where k is the number of the current iteration. The process of the \(I\_SVM\) algorithm is executed as follows:  
1. The SVM classifier is initialized by classified document \(D_{l}\) (see Equations (1)-(3)), in which the parameters \(\alpha\), \(w\), and \(b\) are obtained.
2. The E_step: The category of \(d\) (\(d_{i}\)\(\in\)\(D_{w}\)) is calculated and judged by parameters \(\alpha\), \(w\), and \(b\) using Formula (4). The M_step: The parameters of the SVM model, i.e., \(\alpha\), \(w\), and \(b\), are calculated again based on \(D\) = {\(D_{l}\)\(D_{w}\)}.
3. If the category of the classified documents changes or \(k\) is less than the specified number of iterations, then \(k\) = \(k\) + 1 and go to step 2.
4. The classifier tends to be stable and generates the final SVM classifier.
5. The final SVM classifier is used to classify test documents and output the classification results.