## 4 Prediction of Progress in Rehabilitation--Predictive Model
### Parameters of the Tested Models  
During the research, dozens of predictive models with different structures of input, output data, and varying model parameters were tested. The models that yielded the best simulation results featured the following functions:  
* Training Function (trainlm): The Levenberg-Marquardt algorithm (trainlm) is used to adjust weights during training. It optimizes by minimizing error through weight modification and is known for its fast convergence, especially in regression. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**No.**} & \multirow{2}{*}{**Age**} & **Gender** & **Depression** & **RMA 1 * & **RMA 2 * & **RMA 3 * & **ADL * \\  & & **(1-Woman; 2-Men)** & **(0–15)** & **(0–13)** & **(0–10)** & **(0–15)** & **(0–6)** \\ \hline
1 & 66 & 1 & 8 & 5 & 5 & 1 & 2 \\
2 & 71 & 1 & 7 & 6 & 4 & 3 & 3 \\
3 & 68 & 2 & 8 & 5 & 6 & 2 & 3 \\
4 & 74 & 1 & 9 & 3 & 4 & 2 & 2 \\
5 & 54 & 2 & 3 & 7 & 6 & 2 & 3 \\
6 & 78 & 2 & 6 & 4 & 3 & 0 & 2 \\
7 & 66 & 1 & 8 & 3 & 3 & 1 & 2 \\
8 & 67 & 1 & 4 & 9 & 10 & 8 & 4 \\
9 & 59 & 1 & 5 & 6 & 5 & 3 & 3 \\
10 & 63 & 1 & 6 & 4 & 4 & 6 & 3 \\ \hline \hline \end{tabular}
* Before rehabilitation.  
\end{table} 
Table 1: Input data. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Network Name**} & \multicolumn{2}{c}{**Data Structure**} & \multirow{2}{*}{**Number of Layers**} & \multicolumn{2}{c}{**Neurons in Layers**} \\  & & **(Target Structure)** & & **and Transfer Functions** \\ \hline Net1 & 1 & 3 & Layer 1: 7 (tansig), \\  & & & Layer 2: 4 (tansig), \\  & & & Layer 3: 4 (tansig) \\  & & & Layer 1: 7 (tansig), \\ Net2 & 2 & 4 & Layer 2: 7 (tansig), \\  & & & Layer 3: 7 (tansig), \\  & & & Layer 4: 4 (purelin) \\  & & & Layer 1: 7 (tansig), \\ Net3 & 2 & 3 & Layer 2: 4 (tansig), \\  & & & Layer 3: 4 (tansig) \\ Net4 & 3 & 3 & Layer 1: 7 (tansig), \\  & & & Layer 3: 3 (tansig) \\  & & & Layer 1: 7 (tansig), \\ Net5 & 4 & 4 & Layer 2: 7 (tansig), \\  & & & Layer 3: 7 (tansig), \\  & & & Layer 4: 1 (purelin) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Models parameters. * Adaptive Learning Function (adaptwb): This function handles adaptive weight modification during training. It allows adjustment of learning rates over time, accelerating convergence and enhancing adaptability. * Performance Function (MSE): The Mean Squared Error (MSE) is used to assess performance by measuring the average squared differences between actual and predicted values. Minimizing MSE means better model representation of real data. Additionally, selected models included the following transfer functions:
* tansig (Hyperbolic Tangent): A nonlinear transfer function often used in hidden layers of neural networks. It transforms input values within a range of \(-1\) to \(1\). * purelin (Linear): A linear transfer function that outputs the input value directly. Commonly used in output layers for regression problems where a linear relationship is expected. Below are the remaining parameters of the models that provided the best results during simulations. The parameters for splitting the training data were uniformly set for all the tested models. They define how the available dataset is divided into three main parts: training, validation, and testing as follows:  
* TrainRatio (Training Data Ratio): Specifies the percentage of data used for training the model. It constitutes 70% of the training data. These data are used to update the model's weights and learn from examples. * ValRatio (Validation Data Ratio): Indicates the percentage of data used for model validation. Validation data accounts for 15% of the training data and is used during training to assess performance and improve model generalization. * TestRatio (Testing Data Ratio): Specifies the percentage of data used for model testing. These data, also constituting 15% of the training data, are used to objectively evaluate the model on unseen data. The sum of all three ratios should equal 1, meaning the entire dataset is appropriately divided.