Добавил:
kiopkiopkiop18@yandex.ru t.me/Prokururor I Вовсе не секретарь, но почту проверяю Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_5606_Библиотеки_им_академика_М_И_Перельмана.pdf
Скачиваний:
0
Добавлен:
02.09.2026
Размер:
21 Мб
Скачать
80 D. S. de Sousa et al.
Fig. 4.7 Basic steps to build a machine learning model. Data management (blue), model management (green), validations and controls (gray), and nal stage (purple)
Problem definition
Data collection
Data preprocessing
Model selection
Model training
Validation
Model tuning
Prediction
Let us take an example. Initially, understanding the nature of the target disea se, its molecular characteristics, and underlying biological mechanisms is elementary. From this understanding, the decision about what to do follows target discovery, ligand search, prediction of biological activity, or evaluation of ADMETox (Absorp­tion, Distribution, Metabolism, Excretion, and Toxicology) properties. Careful anal­ysis will determine whether it is appropriate to employ ML for any of these objectives.
Furthermore, it is necessary to dene whether the appropriate approach would be regression, classication, or another method. For example, in ligand search, classi­cation techniques may be suitable, while in property prediction, regression may be more indicated.
The decision about the type of problem and the specic task will guide the choice of the most appropriate ML algorithm. This selection is fundamental to solidifying the foundations of the successful develo pment of the scientic project at hand.
4 Machine Learning and Neural Network Methods Applied to Drug Discovery 81
3.2 Data Collection
Data collection is a fundamental element in the construction and performance of any model. The quality and quantity of the provided data are primary in the effectiveness of the resulting model. It is essential to consider various factors during this process to ensure the robustness and relevance of the information used [6064].
Firstly, the quantity of data is a determining factor. The more data made available to the model, the greater its learning and generalization capabilities. However, the pursuit of quantity should not compromise quality. It is important to ensure that the collected data are relevant to the specic context of the problem at hand [60, 61].
Data representativeness is equally essential, especially in sampling cases. The data should faithfully reect the diversity and complexity of the environment or phenomenon that the model aims to address. Otherwise, the model may develop biases and may not be able to handle situations outside the scope of the provided data [60, 61].
The choice of the database is a strategic step in data collection. Different types of data can be stored in various formats, and the selection of the appropriate database will directly inuence the efciency of the model. The structure and exibility of the database should be considered to ensure effective data handling throughout the process. In the eld of drug discovery, there are various databases designed for a variety of applications, which are highlighted in Table 4.6 under the Resources and Toolssection.
3.3 Data Preprocessing
Data preprocessing is an integral step in ML, as the quality of data and the useful information derived from it directly affect the models learning ability. In general, all raw data undergo several processing stages to enhance its quality. These stages can be simple steps that can be automated or even performed manually in some cases. These steps can be listed as follows:
Data Cleansing This step involves removing missing, inconsistent, or irrelevant data from data sets. Tasks within this phase may include eliminating records with missing values, addressing outliers, and rectifying data errors. For example, in a database of active compounds with various properties, some molecules may lack Log P values. It is essential to remove them because inferring that these values are null can signicantly impair the models performance. Moreo ver, outliers in molec­ular data can distort the overall analysis. For instance, an outlier could represent a compound with exceptionally high or low bindi ng afnity to a target protein [65].
Normalization or Standardization It is often necessary to normalize or standard­ize data to ensure uniform scaling across all characteristics. This measure is impor­tant in preventing features with vastly different magnitudes from exerting undue
82 D. S. de Sousa et al.
Table 4.2 Example of one-hot coding for types of molecules
Molecule type Small molecule Peptide Antibody
Small molecule 1 0 0
Peptide 0 1 0
Antibody 0 0 1
inuence during the training process. Consider a data set that includes molecular descriptors such as molecular weight, lipophilicity, and binding afnity to a target protein. These descriptors may naturally exhibit different scales, wi th molecular weight measured in Daltons, lipophilicity represented by log P values, and binding afnity often quantied in terms of IC
or Kivalues. During the normalization
50
phase, each molecular descriptor is transformed to a common scale, scaling the values of each descriptor to a range between 0 and 1, making them comparable regardless of their original units [66]. This is very important because features with larger scales might otherwise dominate the learning process, potentially overshadowing the signicance of other descriptors.
Encoding Categorical Variables When the data set includes categorical variables, such as different molecule types or protein categories, it becomes necessary to encode them into numerical values, often achieved through techniques like one-hot coding. Consider a data set containing information about various drug molecules, where a categorical variable represents the type of molecule, such as small molecules, peptides, or antibodies. To incorporate this categorical information into an ML model, one-hot coding is applied. In this technique, each category is assigned a binary value, and a new binary column is created for each category. The presence of a specic category is indicated by a 1in the corresponding column, while the absence is denoted by a 0[67]. An example of this process is shown in Table 4.2.
In this example, the categorical variable Molecule Typehas been encoded into three binary columns using one-hot coding. Each row now represents a drug molecule and indicates its type through the binary columns. This encoding ensures that categorical variables do not introduce ordinal relationships that may mislead the ML model. By representing categorical information in a numerical format, the model can effectively incorporate these features into its learning process, contributing to more accurate predictions.
Dimensionality Reduction In high-dimensional data sets, such as those generated in genomics studies, it can be useful to apply dimensionality reduction techniques such as PCA (Principal Component Analysis) or t-SNE (t-distributed Stochastic Neighbor Embedding). For instance, consider a genomics data set where each sample is characterized by the expression levels of thousands of genes. The high dimensionality of these data can make it computationally intensive and may lead to the curse of dimensionality, where the models performance decreases as the number of features increases. In the case of PCA, the algorithm identies the principal components, which are linear combinations of the original featu res that capture the
4 Machine Learning and Neural Network Methods Applied to Drug Discovery 83
Table 4.3 An example of the original data set
Sample Gene 1 Gene 2 ... Gene 1000
1 0.5 1.0 ... 0.8
2 0.8 0.7 ... 0.2
(continued)
Table 4.4 The same data set after applying PCA (reduced to 2 PCs)
Sample PC1 PC2
1 0.3 0.5
2 0.1 0.8
... ... ...
N 0.6 0.2
Table 4.3 (continued)
Sample Gene 1 Gene 2 ... Gene 1000
... ... ... ... ...
N 0.9 0.6 ... 1.0
maximum variance in the data. By retaining a subset of these principal components, one can effectively reduce the dimensionality of the data set while preserving the most critical information. This not only makes the data set more manageable but also helps in identifying patterns and relationships between samples. Similarly, t-SNE is a nonlinear dimensionality reduction technique that focuses on preserving the pairwise similarities between data points. It is particularly useful for visualizing high-dimensional data in lower-dimensional spaces, revealing the underlying struc­ture and clusters within the data set [68, 69]. Tables 4.3 and 4.4 show a simplied example with an original data set and after applying PCA, respectively.
After applying PCA, the data set might be represented using a reduced set of principal components.
In this transformed representation, the dimensionality has been reduced to two principal components (PC1 and PC2).
Data Sampling This technique is used to enhance the performance of ML models when there is a signicant imbalance between classes of interest. For instance, when predicting the biological activity of chemical compounds, it is not uncommon to encounter data sets where inactive compounds signic antly outnumber their active counterparts. To mitigate this issue, two prevalent data sampling techniques are commonly used: undersampling and oversampling. Undersampling involves reduc­ing the number of instances belonging to the majority class (in this case, inactive compounds) to match the number of instances of the minority class (active com­pounds). This approach helps balance the class proportions in the data set, ensuring that the model is not overwhelmed by the abundance of instances from the majority
84 D. S. de Sousa et al.
class. While undersampling can lead to a reduction in the amount of data available for training, it helps prevent the model from being biased toward the dominant class. Conversely, oversampling entails generating additional copies of instances from the minority class (active compounds) to balance the class proportions. This measure is implemented to ensure that the model has sufcient exposure to instances of the minority class, preventing it from exhibiting bias toward the majority class. Tech­niques such as duplicating existing instances, generating synthetic samples (using methods like SMOTESynthetic Minority Over-sampling Technique), or other sophisticated oversampling methods are employed to augment the representation of the minority class in the data set [70, 71]. Consider a data set for predicting the biological activity of chemical compounds, where only 10% of the compounds are labeled as active, while the remaining 90% are inactive. To address this class imbalance, an undersampling approach would involve randomly selecting 10% of the instances from the inactive class, creating a balanced data set. On the other hand, an oversampling approach might generate additional synthetic instances for the active class to match the size of the inactive class, ensuring that the model is exposed to a more balanced representation of both classes during training.
Feature Selection It is the process of discerning the most pertinent features for the specic task at hand . The primary goals of feature selection are to reduce data dimensionality and enhance model performance by focusing on the most informative attributes. In various data sets, especially those with a large number of features, not all features contribute equally to the predictive power of a model. Some features may be redundant, irrelevant, or even introduce noise, leading to overtting. Feature selection helps address these issues by retaining only the most signicant features, thereby streamlining the data representation and improving the efciency and effectiveness of the ML model [72, 73]. For example, consider a data set for predicting disea se outcomes based on patient proles. The data set may include numerous features such as age, gender, blood pressure, cholesterol levels, and genetic markers. Feature selection would involve identifying which subset of these features is most informative for accurately predicting the disease outcome. By focusing on the most relevant features, the model becomes more interpretable, computationally efcient, and less prone to overtting. The process of feature selection can be approached in various ways, including lter methods, wrapper methods, and embedded methods. Filter methods assess the relevance of features independently of the chosen ML algorithm, wrapper methods use the models performance as a criterion for feature selection, and embedded methods incorporate feature selection as an integral part of the model training process.
Separation of Training, Validation, and Test Sets This practice is important to ensure robust evaluation and optimization of model performance. In this process, the data set is divided into three distinct subsets. The Training Set is used to train the model, allowing it to learn patterns and relationships in the data. During this stage, the models parameters are iteratively adjusted to improve the accuracy of pre­dictions. The Validation Set plays a key role in hyperparameter tuning and model evaluation during training, which will be discussed later. The Test Set is reserved for
4 Machine Learning and Neural Network Methods Applied to Drug Discovery 85
the nal evaluation of the model’s performance. It provides an unbiased assessment of how well the model generalizes to new, unseen data. After training and hyperparameter tuning, the model is evaluated on the Test Set to measure its ability to make accurate predictions in real-world scenarios. In drug discovery, allocating approximately 70– 80% of the data to the training set, 10–15% to the validation set, and another 10–15% to the test set is a common practice [74 ]. The specic percent­ages may vary based on data characteristics, but this general split provides a balance between training the model effectively and assessing its generalization capabilities in drug discovery contexts.
Treatment of Temporal Data When dealing with temporal data, such as time series records of biological activity over time, it is essential to appropriately handle the data, taking into account temporal dependencies. Time series data often exhibit patterns and dependencies over sequential observations. To address this, techniques like lag features, rolling statistics, and time-based cross-validation can be employed. Lag features capture historical values, rolling statistics summarize trends, and time­based cross-validation ensure evaluation reects the temporal nature of the data. Additionally, considering seasonality, trend decomposition, and incorporating time­aware models, like RNNs or LSTMs, enhances the modeling of temporal dynamics in biological activity data sets [75].
3.4 Model Selection
In the application of ML in the context of drug discovery, the model selection stage is important for identifying promising drug candidates. Let us consider a data set describing the molecular properties of different compounds and their effectiveness in treating a specic disease. In this scenario, choosing the appropriate model can be crucial for accurately predicting the biological activity of new compounds.
Simpler models, such as linear regression, may be used for problems where the relationships between molecular features and drug efcacy are predominantly linear. However, in more complex cases where molecular interactions are nonlinear and involve a variety of factors, more sophisticated models, such as NNs or DL methods, may be more appropriate.
Model selection should consider the ability to handle molecular nuances such as specic protein interactio ns, the three-dimensional structure of the molecule, and other complexities inherent in biochemistry. Experimentation with different algo­rithms and parameter adjustments becomes even more relevant, as drug disco very often requires highly speci alized models tailored to the specic characteristics of the problem at hand [25, 38, 73]. The topic of applications addresses which environ­ments in drug discovery are suitable for the most appropriate ML algorithms.
86 D. S. de Sousa et al.
3.5 Model Training
The training stage in ML models is fundamental for empowering the algorithm to perform specic tasks based on the provided data. During this phase, the model is exposed to labeled data sets, where inputs (features) are associated with known outputs. The goal is to adjust the models parameters to minimize the difference between the predicted outputs and the actual outputs present in the training data.
The training process can be divided into several iterations known as epochs. In each epoch, the model goes through the enti re training set, makes predictions for each input, and compares these predictions with the actual outputs. Based on this discrepancy, an optimization algorithm adjusts the models weights and biases, aiming to reduce error and improve predi ction accuracy [38, 46, 74].
The loss function is notable in this context, quantifying the discrepancy between the models predictions and the actual labels. During training, the objective is to minimize this loss function, resulting in a more accurate and generalizable model [76].
The backpro pagation technique is widely used in this process. It involves calcu­lating the gradient of the loss function with respect to the models parameters, allowing weighted adjustments during the optimi zation phase [77]. This is essential for updating the weights of connections between unit s in a neural network.
It is important to mention that the batch size is also a critical aspect. Training can be performed in batches of data, where the model is adjusted based on a subset of the training set [78]. This not only reduces computational requirements but also intro­duces a form of regularization that can benet the models generalization to new data.
Suppose we have a data set of molecular information about compounds and their biological activities concerning a specic target such as a protein associated with a disease. During training, the model would be exposed to this set, adjusting its parameters to learn complex patterns that relate molecular features to biological activities. The loss function would be applied to assess the discrepancy between the activities predicted by the model and the actual activities observed in the training data. A common example would be the use of Mean Squared Error (MSE) as the loss function.
3.6 Validation
During the model evaluation phase, various methods are applied to ensure a com­prehensive and accurate analysis of performance on unseen data. Initially, test data sets, consisting of examples not used during training, are employed. The model makes predictions for these data, and the discrepancy between predictions and actual labels provides a direct measure of its generalization capability.
4 Machine Learning and Neural Network Methods Applied to Drug Discovery 87
In the context of classication, metrics such as precision, recall, and F1-score are fundamental. Precision measures the proportion of correct predictions to the total predictions, while recall (or sensitivity) assesses the proportion of true positives to the total actual positives. The F1-score provides a harmonic average between precision and recall, proving useful in situations with class imbalance. The confusion matrix is a visual tool that exposes correct predictions and confusion between classes [79].
For regression problems, metrics such as Mean Absolute Error (MAE) and Mean Squared Error (MSE), along with Y-randomization, are employed. MAE represents the average of absolute differences between predictions and actual labels, while MSE measures the average of squared differences between predictions and actual labels. Y-randomization is a technique used to asses s the robustness of a regression model, evaluating whether the model captures the relationship between independent and dependent variables or merely adjusts to the training data. The technique involves randomizing the values of the dependent variable while keepin g the values of independent variables unchanged. The model is then trained on the randomized data, and performance is compared with the model trained on the original data. If the model trained on randomized data performs similarly to the model trained on the original data, it suggests that the model is not capturing the relationship between independent and dependent variables [73, 7982].
Cross-validation, such as the K-Fold Cross-Validation method, is another indis­pensable approach. This method divides the data set into K parts, trains the model on K-1 parts, and evaluates one part. This process is repeated K times, and the average of performance metrics provi des a more robust insight into how well the model generalizes [60, 61].
Learning curves are valuable for understanding how the models performance varies with the size of the training set. This helps determine whether the model would benet from more data or has reached a saturation point.
ROC (Receiver Operating Characteristic) curves and AUC (Area under the Curve) are often used in classication problems. The ROC curve represents the true positive rate versus the false-positive rate for different decision thresholds. The AUC is a metric quantifying the discriminative ability of the model, with a higher AUC being desirable [83].
Residual analysis is applied to understand the differences between the models predictions and actual values. Observing patterns in residuals can indicate trends or structures not captured by the model. Additionally, Bootstrap is a resampli ng technique that generates multiple samples with replacemen ts from the original data set. This approach can be useful for evaluating the stability of performance estimates [80, 81].
Statistical tests are employed to assess whether performance differences between models are statistically signicant. This is especially relevant when comparing alternative models to identify the most effective one.
In drug discovery, these methods are essential to assess the models effectiveness. The choice of specic methods depends on the characteristics of the problem at hand, but the joint application of these techniques is necessary for a robust and reliable model evaluation.
88 D. S. de Sousa et al.
3.7 Tuning
The model tuning stage, also known as hyperparameter tuning, takes place after the validation phase in the development process of the ML model. While validation is crucial for assessing the models performance on a separate data set not used during training, the tuning stage aims to further optimize the models performance by adjusting its hyperparameters [84].
Hyperparameters are external elements to ML models, essential for inuencing their performance but not adjusted during training. Proper selection of these param­eters is cruci al to ensure a well-performing model. Below are some common hyperparameters and considerations on how to adjust them. The learning rate controls the size of steps taken during optimization. It can be manually adjusted, starting with a small value. To nd a learning rate that results in stable and efcient training, grid search or random search methods can be used. Grid search tests combinations of hyperparameters in a predened grid, while random search tests combinations randomly. The number of epochs represents how many times the algorithm goes through the entire training set during training. If the model is overtting, it may be necessary to reduce the number of epochs. Batch size refers to the numbe r of training samples used in one iteration. Larger sizes can speed up training but demand more memory. Smaller sizes may result in smoother conver­gence [84 86].
In the neural network architecture, the number of layers and neurons in each layer is a signicant hyperparameter. It is often advisable to initiate with a simple architecture and gradually escalate complexity based on the specic demands of the task. Employing cross-validation becomes essential in this iterative process to identify the architecture that exhibits optimal generalization performance across diverse data sets [87].
To mitigate the risk of overtting in NNs, regularization-related hyperparameters, such as L1 and L2 regularization terms, are highly recommended. These terms introduce penalties for large weight magnitudes, promoting a more generalized model. Experimentation with different values for regularization terms is recommended, with larger values intensifying the penalty and aiding in the preven­tion of overtting [8789].
Another pertinent hyperparameter is the dropout rate, denoting the percentage of neurons randomly turned offduring training to enhance robustness and prevent overtting. Commonly ranging from 0.2 to 0.5, the dropout rate can be netuned empirically based on the characteristics of the data. Careful adjustment of this parameter contributes to the networks ability to learn robust features while avoiding reliance on specic neurons, thereby promoting better generalization to unseen data [ 87 ].
In ensemble models like RF or gradient boosting, the number of trees is a signicant hyperparameter. A larger number generally improves performance, but there is a point of diminishing returns. The maximum tree depth is relevant in ensembles. Deeper depths in a model can potentially result in over tting. Therefore,
4 Machine Learning and Neural Network Methods Applied to Drug Discovery 89
it is advisable to experiment with various depth values and employ cross-validation as a means of assessing performance [90].
In the context of KNN (K-Nearest Neighbors) algorithms, the choice of the number of neighbors is an elementary hyperparameter. Opting for small values can make the model excessively sensitive to noise, potentially leading to overtting. On the other hand, selecting large values may result in an overly smoothed model, potentially missing important patterns in the data [91].
In the case of SVM, the kernel type (e.g., linear, polynomial, and radial) and its associated param eters are determined in model performance. The kernel denes the transformation applied to the input data, and variations in kernel types and param­eters can signicantly affect the models ability to capture complex relationships within the data. Therefore, a thoughtful exploration of different kernel types and their respective parameter settings, possibly through techniques like grid search, is essential to ensure the SVM model is appropriately congured for the specic characteristics of the data set at hand [92].
It is important to emphasize that the evaluation and parameter tuning process take place through iterative cycles. These cycles encompass ongoing analysis of the models performance on validation data sets, facilitating the detection of potential enhancements. Following each cycle, the validation process is concluded by evalu­ating the nal model using an independent test set. The inclusion of this test set is crucial to guarantee that the model not only adapts well to the training data but also demonstrates effective generalization to new data. This ensures the robustness and reliability of the model across diverse scenarios [73 , 80, 85, 86].
3.8 Prediction
The prediction phase in the ML process is the step where the trained model is used to make predictions or inferences on unseen data. After completing the training, validation, and hyperparameter tuning steps, the model is ready to be applied to new data for making predictions or classications.
During the prediction phase, input data are fed into the model, and the model utilizes the patterns learned during training to generate predictions or inferences. The specic nature of the prediction task can vary widely, depending on the type of problem being addressed. Additionally, the interpretability of the model can be explored to understand how the model makes decisions. In critical tasks, such as in healthcare, the interpretability of the model is often as important as predictive performance. The prediction phase is the culmination of the ML process, transforming the knowledge acquired during training into practical insights and actions for real-world applications.