Skip to main content
Wiley Open Access Collection logoLink to Wiley Open Access Collection
. 2026 Jul 28;45(7):e70041. doi: 10.1002/minf.70041

Undersampling Techniques for Nonlinear Chemical Space Visualization

Akash Surendran 1, Krisztina Zsigmond 1, Ramón Alain Miranda‐Quintana 1,✉
PMCID: PMC13413639  PMID: 42521404

Abstract

The visualization of high‐dimensional chemical space is a critical tool for understanding molecular diversity, structure–property relationships, and for guiding compound selection. However, the performance of non‐linear dimensionality reduction (DR) techniques like t‐stochastic neighborhood embedding (t‐SNE), uniform manifold approximation and projection (UMAP), and generative topographic mapping (GTM) are often susceptible to the choice of hyperparameters, along with the high cost of their training for large datasets. In this study, we investigated the effect of undersampling methods on the choice of hyperparameter selection for these non‐linear dimensionality reduction methods. Our results demonstrate that selecting small representative subsets of chemical data not only reduces computational costs associated with hyperparameter training but also serves as an innovative means to train nonlinear DR methods, leading to projections that better preserve the local structure within the chemical space.


Visualizing high‐dimensional chemical space is essential for understanding molecular diversity and structure–property relationships, but popular nonlinear dimensionality reduction methods like t‐SNE, UMAP, and GTM are sensitive to hyperparameters and computationally expensive on large datasets. This study shows that using small, representative subsets for hyperparameter tuning reduces computational cost and can improve the preservation of local structure in the resulting chemical space projections.

graphic file with name MINF-45-e70041-g001.jpg

1. Introduction

The chemical space represents the multidimensional landscape of already existing as well as theoretically possible molecules, enclosing the “intermolecular relationships” based on the structural and functional properties of these molecules [1, 2, 3, 4, 5, 6]. With advances in modern synthetic and computational fronts, this landscape is continuously expanding at a rapid rate, with estimates suggesting about 1060 molecules residing in the drug‐like chemical space [5]. These molecules are usually represented using vectors that span several hundreds or even thousands of dimensions, the simplest being binary fingerprints, where the presence and absence of a structural feature are represented by 1 and 0, respectively [7, 8, 9]. Similarity indices are usually employed to quantify the similarity between a pair of molecules, with the Tanimoto similarity [10] being the most widely used index for binary fingerprints. Mathematically, this function maps a pair of molecular fingerprints to a number between 0 and 1, with 0 and 1 representing completely dissimilar and identical molecules, respectively. The principle behind similarity‐based searches is that ”similar molecules display similar properties” [11].

Typically, the average similarity of a library is calculated using the set of all pairwise similarities, which scales as O(N2) to the number of molecules. To address this issue, our group developed iSIM [12, 13, 14, 15, 16], an extended similarity‐based [17, 18, 19, 20, 21] tool to calculate the average similarity of molecular libraries in O(N). The principle behind iSIM is the simultaneous comparison of multiple molecules, and it has been shown that the results are consistent with pairwise similarity across both binary fingerprints and real‐valued descriptors. Coupled with complementary similarity, this method also supports advanced sampling of molecular libraries to target specific sectors of the vast chemical space, improving the coverage and representation of the selected compound sets.

Following the identification of promising regions, a crucial next step is the visualization of the chemical space to interpret the complex structure‐property relationships between molecules. Because the usual high‐dimensional representation of molecules is not interpretable to the human eye, dimensionality reduction (DR) methods are usually employed to project these fingerprints to two or three dimensions [2, 22, 23]. Principal component analysis (PCA) [24, 25] remains a workhorse technique for chemical space visualization, which works by identifying orthogonal axes of maximum variance in the descriptor space and projecting them along these axes, preserving the global data structure. However, this comes at the cost of poor local neighborhood preservation, especially when the chemical space is highly nonlinear. In a recent study by Orlov et al. [23], it was shown that nonlinear methods such as t‐stochastic neighborhood embedding (t‐SNE), uniform manifold approximation and projection (UMAP), and generative topographic mapping (GTM) provide far superior performance in preserving the local structure of the underlying chemical space, which mostly consists of small organic molecular compounds. Similarly, Takacs et al. [26] investigated the application of self‐organizing maps (SOMs) to visualize and analyze regions of drug‐like chemical space that remain heavily under‐represented. This method maps the high‐dimensional chemical space onto a 2D grid, preserving the topological features and highlighting the property clusters. By transforming multidimensional chemical data into intuitive graphical representations, these methods can enhance the virtual screening of large molecular libraries, structure–activity relationships (SAR), library design, and synthesis of drug‐like molecules [4, 5, 27].

Non‐linear manifold‐based dimensionality reduction methods on one hand provide key insights into the local distribution of data in molecular libraries but require extensive computational resources. The hyperparameter set plays a key role in the efficiency of these methods, and training these models on larger datasets can be challenging. In this study, we attempt to address this problem by training three non‐linear models, t‐SNE, UMAP, and GTM on 30 CHEMBL datasets [28] by implementing five different sampling methods using iSIM, but instead training the models on these smaller datasets. A comparison will be performed to determine whether the choice of sampling can help improve the quality of projections performed by these three DR methods. The performance of the projections will be evaluated on several local and global neighborhood preservation metrics [23, 29] (discussed in the next section), and the results will be compared across different DR methods as well as within each DR method across different training samples used. The key question to be answered in this manuscript is thus: What is the impact of robust, deterministic, undersampling methods on the selection of training sets for nonlinear DR techniques in chemical space visualization?

2. Methodology and Workflow

2.1. Generation of Fingerprints

A brief visual representation of the workflow is provided in Figure 1. CHEMBL datasets for 30 different macromolecular targets containing between 615 and 3657 molecules in SMILES strings were selected from the study by van Tilborg et al. [28]. For the larger benchmarking study, a subset of 50 000 molecules was created from the mcule natural products dataset [30]. Binary Morgan fingerprints were generated using the RDKit module in Python [8, 31]. In this representation, molecules are represented as fixed‐length binary vectors, and the popular extended‐connectivity fingerprints (ECFP) with a radius of 2 and 1024 bit length, also known as the ECFP4 representation, was employed. Although the choice of molecular representation mainly depends on the focus of the study, here we are particularly interested in the local chemical space mapped by ECFP4 fingerprints, since mapping faithful latent representations are important for structure–activity relationship studies. Hence, we will focus on the local neighborhood preservation between the fingerprint space and latent space rather than the entire global structure of the dataset.

FIGURE 1.

FIGURE 1

Brief workflow: 30 CHEMBL datasets curated for 30 different macromolecular targets were selected for this study. Morgan fingerprints were generated for each dataset, and samples (10% and 20% of the original dataset size) were generated using iSIM complementary similarity sampling methods. Nonlinear DR methods were trained using each sample, and the corresponding original dataset was projected in 2D. Neighborhood preservation metrics were analyzed to compare the quality of these projections for chemical space visualization.

2.2. iSIM Complementary Similarity‐Based Sampling of Libraries

iSIM is a novel computational method that efficiently calculates the average similarity between molecular sets in linear time scaling (O(N)), bypassing the quadratic (O(N2)) scaling of traditional pairwise approaches. It works by aggregating bit‐ or descriptor‐level statistics across the entire set to calculate the average similarity of the entire chemical library. For example, to calculate the instant Tanimoto similarity (iT) for a set of N molecules represented by M‐dimensional binary fingerprints, the first step is to arrange all these vectors in a matrix with each row representing a molecule, that is, an N×M matrix. Then, a 1×N matrix corresponding to the sum of the individual columns of the previous matrix is constructed, and each element of this matrix is represented by kq, q=1,2,…,M. Using this, iT can be calculated as

iT=∑q=1Mkq(kq−1)2∑q=1M{kq(kq−1)2+kq(N−kq)}

After fingerprint generation, the datasets were sampled using complementary similarity‐based sampling tools in the iSIM module [12]. The key idea behind complementary similarity is ”how well a molecule represents others.” One molecule was removed, and the iSIM for the remaining set was calculated. A higher complementary similarity corresponds to low‐density regions or lower similarity to the rest of the set, whereas the opposite is true for lower complementary similarity. Similarities were calculated using the Tanimoto similarity index, which is a widely used similarity index for binary data, and the molecules were ranked according to increasing complementary similarity. This can then be used to target specific regions of chemical space by providing a means to sample the set in O(N) complexity. Using the tools in our group's GitHub https://github.com/mqcomplab/iSIM/tree/main, we sampled 10% and 20% of each dataset by applying the following five sampling methods:

  • •

    Medoid sampling: M (10% or 20% of the total molecules in the set) Molecules with lowest complementary similarity

  • •

    Outlier sampling: M Molecules with highest complementary similarity

  • •

    Extremes sampling: M/2 molecules with highest complementary similarity and M/2 molecules with the lowest complementary similarity.

  • •

    Stratified sampling: divides the set into b strata of equal size (containing same number of molecules) and selects the molecule with lowest similarity in each stratum until M molecules are chosen.

  • •

    Quota sampling: the range of complementary similarity (max‐min) is divided into b strata of equal range which is max−minb. Note that this time the range of complementary similarity in each stratum is same but not necessarily the number of molecules. Molecules are then chosen until M is reached.

A visual representation of all five sampling methods is given in Figure 2 for CHEMBL234, the largest dataset in this study, which contains 3657 molecules. Medoid, outlier, and extremes target specific regions of the chemical space, while stratified and quota samples target diverse regions of the underlying chemical space.

FIGURE 2.

FIGURE 2

t‐SNE plots for CHEMBL234 by sampling 10% of the data. Blue portions depict the sampled molecules, and gray portions represent the projection of the entire dataset. The former three methods target specific portions but the latter two target diverse regions of the chemical space.

2.3. Hyperparameter Tuning of Nonlinear DR Methods

The next step involved hyperparameter tuning for the three nonlinear dimensionality reduction methods: t‐SNE, UMAP, and GTM. DR models and metrics were chosen from the GitHub repository of the authors of [23]. The t‐SNE algorithm was implemented using the OpenTSNE Python library, the UMAP algorithm using the umap‐learn library, and the GTM using the Incremental GTM of Gaspar et al. [32]. The set of hyperparameters was exactly the same as that in [23], and a grid search was adopted to tune the best set of hyperparameters. For t‐SNE, perplexity values were selected from [1, 2, 4, 8, 16, 32, 64, 128] and exaggeration from [1, 2, 3, 4, 5, 6, 8, 16, 32], learning rate as the default of OpenTSNE and Fast Fourier Transform accelerated interpolation was used for gradient calculation. For UMAP, the nearest neighbors (n_neighbors) were chosen from [2, 4, 6, 8, 16, 32, 64, 128, 256], and the minimal distance (min_dist) was chosen from [0.0, 0.1, 0.2, 0.3, 0.4, 0.6, 0.8, 0.99]. For GTM, the number of nodes was selected from [225, 625, 1600], the number of basis functions was set to [100, 400, 1225], the regularization coefficients were set to [1, 10, 100], and the basis widths were set to [0.1, 0.4, 0.8, 1.2]. The scoring was based on the percentage of preserved nearest 20 neighbors in the high‐dimensional fingerprint space.

2.4. Neighborhood Preservation Score

In a pivotal contribution, Orlov et al. [23] recently highlighted the relevance of quantifying the degree to which different DR representations could retain information about local environments compared to the original high‐dimensional fingerprint space. A combination of local and global preservation metrics was used to evaluate the efficiency of the neighborhood preservation. The first step involves finding the first k neighbors of a molecule in the “ambient” or 1024‐dimensional fingerprint space based on the Tanimoto similarity. The same step is then repeated in the “latent” or low‐dimensional projection space, but using Euclidean distances, since the Tanimoto distance is not a metric for real‐valued vectors [33]. The number of nearest preserved neighbors can be evaluated using the neighborhood preservation score PNN(k):

PNN(k)=∑i=1NSikk×N

where k represents the number of neighbors considered and Sik represents the overlap or shared k‐nearest neighbors of the N compounds in latent and ambient spaces. Additional local and global preservation metrics can be evaluated by constructing the co‐ranking matrix Q, which is discussed in the next section.

2.5. Co‐Ranking Matrix Q and Neighborhood Preservation Metrics

A matrix can be constructed in both the ambient and latent spaces by evaluating and ranking the pairwise distances. This matrix is called the co‐ranking matrix Q. The elements of the co‐ranking matrix Qkl count the number of cases where samples of rank k in the ambient space become rank l in the latent space and are diagonal in the ideal case. This matrix can also be used to calculate the following DR metrics.

  • 1.
    Co‐k nearest neighbor size: Represents the number of points within k‐nearest neighbors before and after DR, giving the total number of mild intrusions and exclusions:
    QNN(k)=1km∑i=1k∑j=1kQij
    where m represents the total number of neighbors and k is the number of neighbors considered for the hit calculation. The factor 1/km is a normalization factor that keeps the values in [0,1] range. Here, mild intrusions refer to elements with k<l and correspond to far‐away points pulled closer by the DR. Mild exclusions refer to points with k>l and correspond to points that are pushed away by DR. Ideally, QNN is 1, which means no change in the order of neighbors after DR.
  • 2.
    Area under QNN curve: A single metric irrelevant of k to calculate the global neighborhood preservation based on the QNN curve:
    AUC=1m∑k=1mQNN(k)
  • 3.
    Local continuity meta criterion (LCMC): As an alternative to QNN, LCMC removes the number of neighbors km−1 from QNN:
    LCMC(k)=QNN(k)−km−1
    The metric favors local neighborhood preservation compared to QNN by ensuring a larger penalty for a higher k value. k value corresponding to the maximum of LCMC(k), kmax is
    kmax=argmaxk(LCMC(k))
  • 4.
    Local and global property metrics: Calculated from the QNN curve, Qlocal and Qglobal correspond to the local and global neighborhood preservation metrics. Given the kmax value previously defined, these metrics can be calculated as follows:
    Qlocal=1kmax∑k=1kmaxQNN(k)
    Qglobal=1m−kmax∑k=kmaxm−1QNN(k)

    Qlocal is usually preferred over Qglobal because the immediate neighbors of a compound are much more significant in cheminformatics studies.

  • 5.
    Trustworthiness and continuity: Trustworthiness and continuity are used to account the errors due to hard intrusions and hard extrusions, respectively.
    T(k)=1−1mk(m−k)∑i=km∑j=1kQij(i−k)
    C(k)=1−1mk(m−k)∑i=1k∑j=kmQij(j−k)

The DR methods and neighborhood metrics were generated with the help of software from Varnek's group and the code is available at https://github.com/AxelRolov/cdr_bench.

3. Results and Discussion

3.1. Benchmarking on 30 ChEMBL Datasets

The grid search was performed as follows: Each of the 30 ChEMBL datasets was first sampled to obtain 10% and 20% of the data using the iSIM sampling tools corresponding to the five sampling methods previously discussed. These sampled sets were then used to perform hyperparameter tuning for the three nonlinear DR methods: t‐SNE, UMAP, and GTM. Because these methods are susceptible to the choice of hyperparameters and the intrinsic structure of the data, there is no universal hyperparameter configuration, and the best selection of hyperparameters will always vary with the chosen datasets. For example, t‐SNE was applied to published single‐cell RNA‐seq datasets to study the perplexity trade‐offs between the local/global structure to show that although a high perplexity value (∼1% of sample size) can improve the global structure of the projected data, it comes at the cost of degraded local structures [34]. Despite the acceleration of gradient calculations provided by FFT and interpolation, t‐SNE is still typically slower than PCA and UMAP (for the order of  ∼104 datapoints), making the hyperparameter tuning process costly for large datasets. In our computation, the complete training and testing process of UMAP took the least time, 33s to train on 10% of the CHEMBL204 dataset (sample size = 274 molecules) and then project the entire dataset (containing 2754 molecules). On the other hand, GTM took the most time, about 12 min to do the same, followed closely by t‐SNE which took about 11 min and 30 s.

In a previous work by the group [12], it was shown that iSIM achieves linear scaling (O(N)) in dataset sampling and when about 10% of the datasets were selected, quota and stratified sampling stand out in closely matching the average similarity of the entire dataset, achieving better coverage of the underlying chemical space. This is also clear from the visual representation of these sampling methods in Figure 2. Though the global data structure is better captured by quota and stratified samples, the main interest of this article is if the choice of sampling could influence the local structure after DR. A scatter plot of these three methods trained on the five sampling methods on one of the datasets used in the study (CHEMBL237) is shown in Figure 3. The structure of projections shows significantly larger variations on t‐SNE trained across different sampling methods to those for UMAP and GTM. This indicates that t‐SNE is much more sensitive to the choice of hyperparameters than the other two DR methods. A larger portion of bright points in the GTM heatmap indicates superior local neighborhood preservation with the method trained on quota and stratified samples showing a larger number of bright points.

FIGURE 3.

FIGURE 3

t‐SNE, UMAP, and GTM projections of CHEMBL237 dataset trained on 20% samples by Extremes, Medoid, Outlier, Quota, and Stratified sampling. The abundance of lighter shades in the heatmap of GTM indicates a superior local neighborhood preservation. t‐SNE on the other hand, is more sensitive to the choice of sampling.

To get a quantitative understanding of the quality of projections, the performance of these five sampling methods is evaluated based on the neighborhood metrics described in the previous section. The key idea is to sample datasets up to one or two orders of magnitude below the actual size, capturing as much information as possible about the distribution of the data, which further boosts the optimum hyperparameter selection at reduced computational costs. Considering the size of smaller datasets, the sample size was chosen to be at least 10%, to have a greater number of molecules than the minimum number of strata, which was set to 50 by default. The hyperparameter scoring is based on the percentage of the first 20 neighbors preserved in the latent space, according to the code developed for [23]. Because we are interested in the local neighborhood of a molecule rather than the global structure of the entire dataset, special focus is placed on metrics such as PNN(k), Qlocal, trustworthiness, and continuity, as the presence of similar structural features or functional groups governs properties.

A plot of these metrics against the number of neighbors k is given in Figure 4 and is tabulated in Table 1 (the values correspond to khit=20). AUC and Qglobal describe the global neighborhood preservation quality of the DR method, while Qlocal, PNN, trustworthiness, and continuity focus on local neighborhood preservation. Although the performance of t‐SNE and UMAP was consistent across all five sampling methods, there were key differences in the performance of GTM. First, while comparing the local structure preservation metrics across these three methods, it can be seen that GTM offers a far superior performance to t‐SNE and UMAP, while the global metrics, such as AUC and Qglobal do not show a significant difference. The percentage of preserved nearest 20 neighbors (PNN) was less than 20 for t‐SNE and UMAP, while the number was as high as 48% on average for GTM across all 30 CHEMBL datasets. This value was as high as over 50% when the first 50 neighbors were considered. This hints at the far superior performance of GTM over the other two methods while offering a similar global structure.

FIGURE 4.

FIGURE 4

DR metrics plot in the order Extremes, Medoid, Outlier, Quota, and Stratified. The color scheme is as follows: t‐SNE, yellow; UMAP, green; and GTM, red. The shaded regions represent the standard deviation across datasets.

TABLE 1.

Embedding quality of neighborhood preservation metrics across the five sampling methods for (a) t‐SNE, (b) UMAP, and (c) GTM. While the global preservation metrics do not show a large variation across DR methods, the local preservation is consistently better in GTM. GTM trained on quota and stratified samples show enhanced local metric preservation while the performance of t‐SNE and UMAP are similar across all sampling methods.

Sampling PNN20 AUC
Qlocal
Qglobal
Trust20 Cont20
(a) DR metrics of t‐SNE projections trained across the five iSIM sampling methods
Extremes 16 ± 7 0.56 ± 0.03 0.2 ± 0.08 0.59 ± 0.07 0.68 ± 0.07 0.75 ± 0.05
Medoid 13 ± 6 0.55 ± 0.03 0.17 ± 0.07 0.58 ± 0.05 0.65 ± 0.06 0.72 ± 0.05
Outlier 12 ± 6 0.54 ± 0.03 0.14 ± 0.06 0.57 ± 0.05 0.64 ± 0.06 0.72 ± 0.06
Quota 19 ± 10 0.55 ± 0.03 0.19 ± 0.09 0.57 ± 0.04 0.68 ± 0.08 0.76 ± 0.06
Stratified 19 ± 11 0.54 ± 0.02 0.19 ± 0.09 0.56 ± 0.03 0.67 ± 0.07 0.76 ± 0.07
(b) DR metrics of UMAP projections trained across the five iSIM sampling methods
Extremes 7 ± 3 0.55 ± 0.02 0.16 ± 0.06 0.62 ± 0.05 0.63 ± 0.05 0.65 ± 0.06
Medoid 7 ± 3 0.53 ± 0.03 0.11 ± 0.08 0.57 ± 0.05 0.59 ± 0.06 0.63 ± 0.07
Outlier 5 ± 2 0.53 ± 0.02 0.11 ± 0.05 0.59 ± 0.05 0.58 ± 0.04 0.59 ± 0.05
Quota 8 ± 4 0.57 ± 0.03 0.19 ± 0.05 0.64 ± 0.04 0.67 ± 0.06 0.69 ± 0.06
Stratified 8 ± 4 0.58 ± 0.03 0.20 ± 0.06 0.64 ± 0.04 0.68 ± 0.06 0.71 ± 0.06
(c) DR metrics of GTM projections trained across the five iSIM sampling methods
Extremes 34 ± 7 0.64 ± 0.04 0.34 ± 0.06 0.65 ± 0.05 0.87 ± 0.04 0.84 ± 0.05
Medoid 30 ± 7 0.60 ± 0.03 0.31 ± 0.06 0.61 ± 0.04 0.82 ± 0.05 0.81 ± 0.05
Outlier 30 ± 7 0.60 ± 0.04 0.29 ± 0.07 0.61 ± 0.05 0.85 ± 0.05 0.79 ± 0.06
Quota 46 ± 7 0.67 ± 0.04 0.43 ± 0.07 0.68 ± 0.05 0.93 ± 0.04 0.91 ± 0.05
Stratified 48 ± 8 0.69 ± 0.04 0.45 ± 0.07 0.69 ± 0.05 0.93 ± 0.04 0.92 ± 0.05

Given the rapidly growing amount of chemical data, a central problem in cheminformatics is to train Machine Learning models with minimum input to reproduce maximum information about a given dataset. Hyperparameter selection is key for the performance of nonlinear DR methods and often computationally expensive given their nonlinear scaling with data size, and hence, we address this problem by asking if a smaller sampling of these datasets could provide a suitable set of hyperparameters and hence a better quality of projections. The neighborhood preservation metrics were compared within each DR method, and it was observed that although these metrics remained consistent across all sampling methods for t‐SNE and UMAP, there were stark differences in the quality of projections in GTM. While PNN shows an increasing trend with the number of neighbors k across all DR methods, GTM trained on quota and stratified sampling of datasets displayed an improved performance, preserving as high as over half of the nearest 50 neighbors in the latent space. Trustworthiness metric displays significantly better values in GTM, but more importantly clocks an average value of 93% when GTM is trained on Quota and Stratified sampling. Even for k=50, the metric shows a value above 90%, while other training samples show about 80% and an even lower number (between 60% and 70%) when for t‐SNE or UMAP. A similar trend is also observed for the continuity metric. Note that trustworthiness and continuity display the errors due to hard intrusions and hard extrusions respectively. A high value for both metrics indicates that the DR method minimizes false positives (trustworthiness) and false negatives (continuity) in local relationships.

LCMC, which is a local preservation‐focused alternative to QNN, peaks at a higher value for quota and stratified training samples, leading to a better Qlocal score, an important local preservation metric. Qlocal, in general, shows a relatively better performance even for t‐SNE and UMAP, although, the differences were more profound when comparison is within GTM, with average values as high as 0.45. A key reason for the overperformance of GTM compared with other DR methods is its probabilistic grid structure, which preserves the local topology better. Coupled with efficient iSIM sampling methods like quota and stratified sampling which are known to provide a better description of the data distribution, the choice of hyperparameter selection is enhanced. Even with a small fraction of data (approximately 10%–20%), the set of hyperparameters corresponding to the intrinsic distribution in the original data set can be found at a highly reduced cost, leading to a better and more accurate low‐dimensional projection of the data. Sampling methods covering diverse chemical regions outperform extremes‐focused approaches. Another key observation is that stratified/quota sample trained projections lead Qglobal by a small margin (approximately ≤0.08) across methods, indicating that global structure is less sensitive to sampling than the local structure. A similar trend can also be observed in the case of AUC.

3.2. Benchmarking for a 50k Mcule Natural Products Subset

To evaluate whether the undersampling‐guided hyperparameter selection generalizes to higher scales, we extended this benchmarking pipeline to a 50 000‐molecule subset of mcule natural products which is roughly one to two orders of magnitude higher than the datasets used in the first study. Following the same procedure, each of the three nonlinear DR methods (t‐SNE, UMAP, and GTM) was trained on a 10% sample (∼5000 molecules) drawn by each of the five iSIM complementary similarity‐based sampling strategies. Critically, PCA was introduced as a linear hyperparameter independent dimensionality reduction baseline in this extended benchmark, providing an important reference point to disentangle method family from sampling effect. The full 50k dataset was then projected using the best hyperparameter settings identified from each training sample, and the resulting embeddings were evaluated across the same five neighborhood preservation metrics used previously: the nearest‐neighbor preservation score PNN, trustworthiness, continuity, QNN, and LCMC.

The results of the benchmarking are given in Figure 5. The neighborhood overlap score PNN reveals a striking reversal relative to the smaller dataset benchmarks: t‐SNE (yellow) is now the top‐performing method across all five sampling conditions and all values of neighbors considered k followed by GTM, UMAP and then PCA which exhibits a poor PNN score, barely exceeding 5%. All the methods show less than 20% overlap for the nearest neighbors considered for the former three sampling methods, whereas the PNN scores for t‐SNE get as high as about 30% for this neighborhood size showing significant improvement for the case of stratified sampled configurations.

FIGURE 5.

FIGURE 5

DR metrics plot for the 50k mcule natural product subset in the order Extremes, Medoid, Outlier, Quota, and Stratified. The color scheme is as follows: PCA, blue; t‐SNE, yellow; UMAP, green; and GTM, red.

At the scale of 50 000 molecules, the 10% training set is significantly larger than those used in the original benchmarking with much smaller datasets. The richer and more chemically diverse training sample appears to directly benefit t‐SNE's perplexity optimization: with more molecules in the training pool, the grid search identifies perplexity values that better capture the true local density of the full chemical space. GTM follows the trend in showing a similar improvement for the latter two sampling strategies, though it does not show the same proportional gain, possibly because its fixed grid resolution becomes a limiting factor as the dataset size grows. The number of latent grid nodes may not scale as naturally with dataset density of t‐SNE's perplexity hyperparameter.

UMAP relies on a local‐global tradeoff and known to prioritize the preservation of the broad topological skeleton of a dataset over fine‐grained local neighborhoods, and this tendency appears to become even more pronounced as dataset size increases. At 50k molecules, the chemical space contains significantly more overlapping local dense regions than in smaller benchmarks, and even when optimized by grid search on 10% sample may not adequately capture the heterogeneity of local density across the full dataset. The result is a systematic underestimation of the true local neighborhoods in the 2D projection, reflected in the persistently low PNN values. PCA, predictably, performs the worst because the method assumes linearity and relies on global variance maximization which is essentially blind to the local structure, and its projections compress the intricate local topology of chemical space into a low‐dimensional linear subspace that discards most of the neighborhood information.

Trustworthiness also shows a similar trend where all three non‐linear DR methods show elevated values for quota and stratified sampling, whereas PCA due to its poor neighborhood information, exhibits significantly lower values. GTM maintains a slight edge in trustworthiness, while t‐SNE's higher PNN is accompanied by marginally lower trustworthiness values. This distinction is meaningful, t‐SNE's aggressive local clustering recovers a larger fraction of true neighbors at the expense of some false positive, whereas GTM's probabilistic grid on the other hand imposes a softer topology that suppresses hard intrusions even at scale, leading to a slightly more reliable map. Unlike nonlinear DR methods, PCA simply maps the data into directions of maximum variance irrespective of local topology, producing mediocre trustworthiness values.

The global neighborhood preservation scores like AUC and Qglobal show similar trends as in the previous results; see Table 2 where the choice of sampling appears to make little to no difference for these metrics and the trend is consistent across all DR methods. These results carry several important implications for undersampling‐guided DR at large chemical dataset scale. Most importantly, the performance hierarchy is not fixed across dataset size as t‐SNE, which showed significantly lower local preservation than GTM on the smaller datasets, emerged as the leading method at 50k molecules. This suggests that the relative advantage of each DR method is dataset‐size dependent, and that the richer information available in a 10% sample of a large dataset particularly benefits t‐SNE's hyperparameter optimization. GTM remains the more trustworthy method in a strict false‐positive sense, and the choice between the two should be guided by whether the application demands maximum neighbor recall (favoring t‐SNE) or maximum projection reliability (favoring GTM). PCA's near‐zero performance on all local metrics at this scale delivers a clear message: For chemical libraries of this size and diversity, linear dimensionality reduction is not a viable tool for local neighborhood visualization and should be restricted to use cases where global variance structure is the primary interest, such as identifying broad chemical series or detecting outlier libraries.

TABLE 2.

Embedding quality of neighborhood preservation metrics across the five sampling methods for (a) t‐SNE, (b) UMAP, and (c) GTM on the 50k molecule dataset. As before, the global preservation metrics do not show a large variation, local preservation generally show improvement in all three DR methods for quota and stratified samples.

Sampling PNN20 AUC
Qlocal
Qglobal
Trust20 Cont20
(a) DR metrics of t‐SNE projections trained across the five iSIM sampling methods
Extremes 20.10 0.57 0.24 0.57 0.90 0.85
Medoid 20.72 0.57 0.25 0.57 0.86 0.91
Outlier 16.15 0.57 0.21 0.57 0.87 0.84
Quota 27.17 0.59 0.34 0.6 0.93 0.94
Stratified 31.68 0.59 0.39 0.59 0.95 0.95
(b) DR metrics of UMAP projections trained across the five iSIM sampling methods
Extremes 7.94 0.55 0.17 0.55 0.81 0.78
Medoid 7.85 0.55 0.23 0.56 0.82 0.91
Outlier 6.64 0.56 0.14 0.57 0.79 0.78
Quota 10.74 0.56 0.23 0.57 0.88 0.87
Stratified 12.01 0.57 0.27 0.57 0.89 0.89
(c) DR metrics of GTM projections trained across the five iSIM sampling methods
Extremes 14.10 0.59 0.27 0.59 0.93 0.89
Medoid 13.28 0.57 0.24 0.57 0.89 0.87
Outlier 12.15 0.58 0.24 0.59 0.92 0.87
Quota 17.11 0.60 0.32 0.60 0.96 0.91
Stratified 18.57 0.61 0.35 0.62 0.96 0.93

The consistent underperformance of extremes, medoid, and outlier sampling methods across all scales, methods, and metrics points to practically actionable conclusion: Oversampled molecules from a particular region of the chemical space do not constitute a representative training set for manifold‐learning‐based DR methods regardless of dataset size. Stratified and quota sampling, by covering the full range of complementary similarity proportionally, reliably produce the most accurate hyperparameter selection at every scale tested, and should be the default choice for practitioners implementing this framework on new datasets. Finally, the stability of these trends across about two orders of magnitude from about ∼600–3600 molecules to 50 000 molecules strongly suggests that the framework as a whole is likely to remain effective at larger scales, potentially extending to CHEMBL at its full size of several million compounds. A complete benchmarking of million molecule CHEMBL datasets are not practically feasible, since the calculation of these metrics stems from pairwise distance information which scales quadratically with time and memory. The O(N) scaling of iSIM sampling ensures that diverse subset generation does not become a computational bottleneck even at very large N, and the consistency of the relative performance of sampling methods and DR models across scales provides a principled basis for expecting the approach to generalize without modification to the full chemical space.

4. Conclusions

This work primarily focused on the effect of deterministic, diversity‐driven undersampling strategies on the quality of nonlinear DR for chemical space visualization from a scale of several hundreds to 50 000 molecules. Training t‐SNE, UMAP, and GTM on just 10% subsets generated by five iSIM complementary similarity sampling strategies, we find that the choice of training sample has a consistent and reproducible effect on projection quality, with stratified and quota sampling outperforming outlier‐focused approaches across all methods and both scales on local preservation metrics including PNN, trustworthiness, and continuity. Notably, the relative performance of DR methods is scale‐dependent: GTM leads on local preservation for smaller datasets, while t‐SNE emerges as the top performer at 50 000 molecules, a shift attributed to the larger absolute training pool available at scale, which enables more faithful perplexity optimization. UMAP remains competitive on global metrics but consistently underperforms on local neighborhood preservation, and PCA's near‐zero local preservation scores confirm that linear projections are categorically inadequate for local structure visualization in large, diverse chemical libraries.

The fundamental message of this work is that training nonlinear DR models on small but carefully selected diverse subsets not only substantially reduces computational cost but can actively improve projection quality by guiding hyperparameter selection toward configurations that better capture the intrinsic local structure of chemical space. The O(N) scaling of iSIM sampling ensures that this approach remains computationally tractable as dataset size grows, and the consistency of results across two orders of magnitude of dataset size provides a principled basis for expecting the framework to generalize to the full CHEMBL database and beyond. Future work could explore wider hyperparameter grids for t‐SNE and UMAP, the application of additional molecular representations beyond ECFP4 fingerprints, and the extension of this pipeline to even larger datasets approaching the scale of the complete drug‐like chemical space.

Funding

This work was supported by the National Institutes of Health (R35GM150620).

Conflicts of Interest

The authors declare no conflicts of interest.

Acknowledgments

A.S., K.Z. and R.A.M.Q. thank the National Institute of General Medical Sciences of the National Institutes of Health for support under award number R35GM150620. A.S thanks Alexey Orlov for valuable insights on the neighborhood preservation metrics code.

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.

References

  • 1. Lipinski C. and Hopkins A., “Navigating Chemical Space for Biology and Medicine,” Nature 432 (2004): 855–861. [DOI] [PubMed] [Google Scholar]
  • 2. Reymond J.‐L., “The Chemical Space Project,” Accounts of Chemical Research 48 (2015): 722–730. [DOI] [PubMed] [Google Scholar]
  • 3. Reymond J.‐L., Ruddigkeit L., Blum L., and Van Deursen R., “The Enumeration of Chemical Space,” WIREs Computational Molecular Science 2 (2012): 717–733. [Google Scholar]
  • 4. Medina‐Franco J. L., Chávez‐Hernández A. L., López‐López E., and Saldívar‐ González F. I., “Chemical Multiverse: An Expanded View of Chemical Space,” Molecular Informatics 41 (2022): 2200116. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5. Reymond J.‐L., Van Deursen R., Blum L. C., and Ruddigkeit L., “Chemical Space as a Source for New Drugs,” MedChemComm 1 (2010): 30–38. [Google Scholar]
  • 6. Medina‐Franco J. L., Sánchez‐Cruz N., López‐López E., and Díaz‐Eufracio B. I., “Progress on Open Chemoinformatic Tools for Expanding and Exploring the Chemical Space,” Journal of Computer‐Aided Molecular Design 36 (2022): 341–354. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7. David L., Thakkar A., Mercado R., and Engkvist O., “Molecular Representations in AIdriven Drug Discovery: A Review and Practical Guide,” Journal of Cheminformatics 12 (2020): 56. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8. Rogers D. and Hahn M., “Extended‐Connectivity Fingerprints,” Journal of Chemical Information and Modeling 50 (2010): 742–754. [DOI] [PubMed] [Google Scholar]
  • 9. Landrum G., RDKit: Open‐Source Cheminformatics (2006).
  • 10. Bajusz D., Rácz A., and Héberger K., “Why Is Tanimoto Index an Appropriate Choice for Fingerprint‐Based Similarity Calculations?,” Journal of Cheminformatics 7 (2015): 1–13. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11. Maggiora G., Vogt M., Stumpfe D., and Bajorath J., “Molecular Similarity in Medicinal Chemistry: Miniperspective,” Journal of Medicinal Chemistry 57 (2014): 3186–3204. [DOI] [PubMed] [Google Scholar]
  • 12. López‐Pérez K., Kim T. D., and Miranda‐Quintana R. A., “iSIM: Instant Similarity,” Digital Discovery 3 (2024): 1160–1171. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13. Lopez‐Perez K., Zhao B., and Miranda‐Quintana R. A., “iSIM‐Sigma: Efficient Standard Deviation Calculation for Molecular Similarity,” Journal of Chemical Information and Modeling 65 (2025): 6797–6808. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14. Lopez Perez K., Lopez‐Lopez E., Soulage F., Felix E., Medina‐Franco J. L., and Miranda‐Quintana R. A., “Growth Vs Diversity: A Time‐Evolution Analysis of the Chemical Space,” Journal of Chemical Information and Modeling 65 (2025): 6788–6796. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15. López‐Pérez K. and Miranda‐Quintana R. A., “iCliff Taylor's Version: Robust and Efficient Activity Cliff Determination,” Journal of Chemical Information and Modeling 65 (2025): 5801–5810. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16. López‐Pérez K. and Miranda‐Quintana R. A., “Extended Activity Cliffs‐Driven Approaches on Data Splitting for the Study of Bioactivity Machine Learning Predictions,” Molecular Informatics 44 (2025): e202400054. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17. Miranda‐Quintana R. A., Bajusz D., Rácz A., and Héberger K., “Extended Similarity Indices: The Benefits of Comparing More than Two Objects Simultaneously. Part 1: Theory and Characteristics,” Journal of Cheminformatics 13 (2021): 32. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18. Miranda‐Quintana R. A., Rácz A., Bajusz D., and Héberger K., “Extended Similarity Indices: The Benefits of Comparing More than Two Objects Simultaneously. Part 2: Speed, Consistency, Diversity Selection,” Journal of Cheminformatics 13 (2021): 33. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19. López‐Pérez K., López‐López E., Medina‐Franco J. L., and Miranda‐Quintana R. A., “Sampling and Mapping Chemical Space with Extended Similarity Indices,” Molecules 28 (2023): 6333. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20. Dunn T. B., López‐López E., Kim T. D., Medina‐Franco J. L., and Miranda‐ Quintana R. A., “Exploring Activity Landscapes with Extended Similarity: Is Tanimoto Enough?,” Molecular Informatics 42 (2023): 2300056. [DOI] [PubMed] [Google Scholar]
  • 21. Chang L., Perez A., and Miranda‐Quintana R. A., “Improving the Analysis of Biological Ensembles through Extended Similarity Measures,” Physical Chemistry Chemical Physics 24 (2021): 444–451. [DOI] [PubMed] [Google Scholar]
  • 22. Cihan Sorkun M., Mullaj D., and Koelman J. V. A., “ChemPlot, a Python Library for Chemical Space Visualization,” Chemistry–Methods 2 (2022): e202200005. [Google Scholar]
  • 23. Orlov A. A., Akhmetshin T. N., Horvath D., Marcou G., and Varnek A., “From High Dimensions to Human Insight: Exploring Dimensionality Reduction for Chemical Space Visualization,” Molecular Informatics 44 (2025): e202400265. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24. Hempel J. E., Williams C. H., and Hong C. C., “Principal Component Analysis as a Tool for Library Design: A Case Study Investigating Natural Products, Brand‐Name Drugs, Natural Product‐Like Libraries, and Drug‐Like Libraries,” Chemical Biology: Methods and Protocols 1263 (2015): 225–242. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25. Naveja J. J. and Medina‐Franco J. L., “ChemMaps: Towards an approach for visualizing the chemical space based on adaptive satllite compounds,” F1000Research 6 (2017): 1134. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26. Takács G., Sándor M., Szalai Z., Kiss R., and Balogh G. T., “Analysis of the Uncharted, Druglike Property Space by Self‐Organizing Maps,” Molecular Diversity 26 (2022): 2427–2441. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27. Saldívar‐González F. I. and Medina‐Franco J. L., “Approaches for Enhancing the Analysis of Chemical Space for Drug Discovery,” Expert Opinion on Drug Discovery 17 (2022): 789–798. [DOI] [PubMed] [Google Scholar]
  • 28. Van Tilborg D., Alenicheva A., and Grisoni F., “Exposing the Limitations of Molecular Machine Learning with Activity Cliffs,” Journal of Chemical Information and Modeling 62 (2022): 5938–5951. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29. Zhang Y., Shang Q., and Zhang G., “pyDRMetrics‐A Python Toolkit for Dimensionality Reduction Quality Assessment,” Heliyon 7 (2021): e06199. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30. Kiss R., Sandor M., and Szalai F. A., “http://Mcule.com: A Public Web Service for Drug Discovery,” Journal of Cheminformatics 4 (2012): P17. [Google Scholar]
  • 31. Landrum G., Open‐source cheminformatics software, https://www.rdkit.org/.
  • 32. Gaspar H. A., Baskin I. I., Marcou G., Horvath D., and Varnek A., “Chemical Data Visualization and Analysis with Incremental Generative Topographic Mapping: Big Data Challenge,” Journal of Chemical Information and Modeling 55 (2015): 84–94. [DOI] [PubMed] [Google Scholar]
  • 33. Surendran A., Zsigmond K., Lopez‐Perez K., and Miranda‐Quintana R. A., “Is the Tanimoto Similarity a Metric?,” Journal of Mathematical Chemistry 63 (2025): 1229–1240. [Google Scholar]
  • 34. Kobak D. and Berens P., “The Art of Using t‐SNE for Single‐Cell Transcriptomics,” Nature Communications 10 (2019): 5416. [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.


Articles from Molecular Informatics are provided here courtesy of Wiley

RESOURCES