## 3 Method
### Active Learning and Clustering  
The clustering work was carried out through DTTW. However, in advance, the authors need to define the appropriate value of \(w_{t}\) and \(w_{n}\) in Equation (3). In this paper, authors used an active learning method which needs little human tagging work. The whole procedure is shown in Figure 5:  
Figure 5: Overview for the active learning process. Firstly, the training set \(T\) is empty. Each two different companies in stocks data form a \"company pair\". The first learning module stage is skipped, and \(W_{n}\)\(W_{t}\) were both set at 0.5. The initial threshold for \(d_{local}\) is 0.5. The \(d_{local}\) values of every company pair can be calculated after applying DTTW on training set. Then, sorting the company pairs according to \(d_{local}\), the result would be an ordered sequence of companies with \(d_{local}\). Next, the top \(k\) company pairs with highest scores and the top \(k\) company pairs with lowest scores would be sent for human tagging. This progress is carried out by domain experts, with reference to the 10-K report. If companies in company pairs are really sharing same or similar business scopes, the human \(d_{local}\) will be set to 0, else it will be set as 1. Then a precision judgment stage will start, comparing the precision of \(d_{local}\) to the pre-set threshold for precision. Once the authors obtain a \(d_{local}\) result with higher precision than preset ones, the active learning part will be terminated. If not, the authors get \(2k\) company pairs with a human tag, which is then sent to training set \(T\), and stages 1 to 4 in Figure 5 will be repeated. The learning module uses the gradient descent method to fit the weights \(W_{n}\) and \(W_{t}\). It needs to be stressed that, from \(2 nd\) turns on, in stage 4 there will be some tagged company pairs (suppose the number is \(n\), \(n<k\)) among \(2k\) selected pairs. The authors would then find the next lower or higher \(2(k-n)\) pairs and filter out this \(2n\) pairs, adding them into \(T\). A more systematic algorithm description is shown below in Algorithm 1:  
```
0: The initial weight for numeric similarity, \(W_{n}\); The initial weight for text similarity, \(W_{t}\); Threshold for cluster precision, \(Threshold_{p}\); Number of records selected for human judgement, \(k\); Stock dataset, \(SD\); DTTW function, \(DTTW(x)\); Learning module function \(LM(x)\);
0: The final weight for numeric similarity, \(W_{n}\); The final weight for text similarity, \(W_{t}\);
1: Training Set \(T\leftarrow\mathit{empty}\);
2:for distinct company pair \(P_{i}\in SD\)do
3:\(d_{local_{i}}=DTTW(P_{i})\)
4:endfor
5:\(d_{local}\leftarrow\) sorting company pairs according to \(d_{local}\);
6:for stock pair \(P_{i}\in k\) company pairs with highest scores and \(k\) company pairs with lowest scores do
7:if companies in \(P_{i}\) are really sharing same or similar business scopes then
8:\(d_{local_{i}}=0\);
9:else
10:\(d_{local_{i}}=1\);
11:endif
12: Put \(P_{i}\) into \(T\);
13:endfor
14: Precision \(\leftarrow\) calculating precision of \(d_{local}\)
15:if Precision \(>\mathit{Threshold}_{p}\)then return\(W_{n}\),\(W_{t}\);
16:else
17:\(W_{n}\),\(W_{t}=LM(T)\)
18:repeat Step 5 to Step 15
19:until Precision \(>\mathit{Threshold}_{p}\) return\(W_{n}\),\(W_{t}\);
20:endif
```  
**Algorithm 1** Framework of active learning for weights of numeric similarity and text similarity. This step will ensure in every turn there will be \(k\) newly-tagged company pairs with the highest \(d_{local}\), and \(k\) newly-tagged company pairs with the lowest \(d_{local}\) sent into the training set, accelerating the training progress. According to the experiments, active learning usually took 12 turns to reach convergence, with 120 tagged pairs. As is shown in Figure 6, we used the three indexes of precision, recall rate, and F1 value to compare the clustering performance of the proposed DTTW algorithm with other existing algorithms. Precision is the proportion of correctly-clustered stocks to all the stocks that have been clustered.