## 5 Prototype of Algorithms and Data Conversion
### Implementation Details and Problems  
Before proceeding to testing, a few implementation-specific things have to be addressed. Due to the general unavailability of medical patient notes to train a new model or customize an existing one, the implementation instead uses several NER models, examining the entities recognized by each of them. As a result, the text parsing part of the prototype combines multiple NLP approaches and is tested on what is an approximation of the real data.  
Due to the general unavailability of medical patient notes to train a new model or customize an existing one, the implementation instead uses several NER models, examining the entities recognized by each of them. As a result, the text parsing part of the prototype is not perfect, but instead combines multiple NLP approaches and is tested on what is an approximation of the real data.  
The unknown data are represented by \"\(-1\)\" during the merging as a way of expressing uncertainty. The value of \"\(-1\)\" allows the program to quickly separate the uncertain values from the rest of the data (which is normalized in the range of [0, 1]), simplifying the implementation of the methods we need to process data, particularly unit conversion, and in case unknown values remain in the sample after the conversion, they get replaced with the values mentioned in the previous section before the program proceeds to check the data for multicollinearity.  
Multicollinearity in the prototype is detected using _Variance Inflation Factor (VIF)_, the function for which is provided by the _statsmodels_ library. There may be more efficient ways to detect it, but as of the time of the writing of this paper, VIF seems to be a pretty popular method. Having finally checked everything, the data are passed to one of the methods.  
The experiments for diagnosis methods are performed by calling the appropriate function within the tests.py module from TestLauncher function, which then splits off a subset according to one of the batch sizes mentioned in previous section, and trains the method with it. Afterwards, a sample is randomly picked from the data that was not used for training and its value is predicted. The experiments are repeated a given number of times, which can be specified as a parameter for TestLauncher. Meanwhile, unit conversion and NLP have their own experiment launcher within the tests.py module that needs to be called directly.  
Due to the overall computational complexity of the TR-SVM method, an implementation of the pruning heuristic described in [42] alongside it was necessary. It is a heuristic for reducing the number of terminated ramp functions without relevant loss of information. Let \(f_{t}=(K_{t}(x_{i}))_{i=1,\cdots,N}\) be a vector representing the feature induced by the terminated ramp function \(K_{t}\) and \(s_{t}\) is the fraction of components of \(f_{t}\) equal to \(1\) or \(-1\):  
\[S_{t}=\frac{Card\{i|K_{t}(x_{i})=1\}}{N}\]  
The \(s_{t}\) can be used as an indicator of the relevance of feature.  
The first set of the TRSVM experiments uses the hyperparameter C = 0.01, which was experimentally determined to be more optimal, and calculates \(S\) in accordance with the formula:  
\[S=max\left(0,1-\frac{200}{n}\right)\]  
to decrease the computational time on a higher amount of samples (Figure 6).