A nonparametric density ratio-based method and system for classifying compositional data

By mapping multivariate component data to a nonnegative sphere and performing symmetric expansion and spherical kernel density estimation, combined with logarithmic marginal density ratio transformation, the problem of improper zero-value handling in existing methods is solved, thereby improving the accuracy and stability of the classification model.

CN122153616APending Publication Date: 2026-06-05CAPITAL UNIV OF ECONOMICS & BUSINESS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CAPITAL UNIV OF ECONOMICS & BUSINESS
Filing Date
2026-02-09
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing methods cannot naturally handle zero values ​​when dealing with multivariate component data, and methods based on parametric probability density estimation have significant limitations in terms of data distribution, resulting in insufficient robustness and stability of classification models.

Method used

The component data are mapped to a non-negative sphere by L2 norm normalization, symmetric extension is performed using a finite reflection group, probability density is estimated using the spherical kernel density function, and a support vector machine model is trained by combining logarithmic marginal density ratio transformation.

Benefits of technology

This approach improves the accuracy and stability of the classification model without requiring manual zero-value filling, enhances the discriminative power of features, and improves the robustness and generalization ability of the classifier.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122153616A_ABST
    Figure CN122153616A_ABST
Patent Text Reader

Abstract

The application provides a kind of based on nonparametric density ratio's component data classification method and system, it is related to data processing technical field, method includes: obtaining component data;Through L2 norm normalization, each variable in component data is mapped to non-negative sphere;Through finite reflection group, non-negative spherical data is expanded to entire sphere;Based on kernel density function, estimate the class conditional probability density of spherical data;Using pullback operation, obtain the class conditional probability density of component data;Through log marginal density ratio transformation, obtain the feature enhancement data set of each component type variable;SVM model is used to train feature enhancement data set and corresponding class label;Target feature enhancement data set of target component data is input into the SVM model after training, and output component data classification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method and system for classifying component data based on non-parametric density ratios. Background Technology

[0002] Component data refers to non-negative vector data where the sum of all components is a constant. It is widely found in fields such as geochemistry, economics, microbiome, and environmental science. When a study involves multiple such component data vectors, it constitutes multivariate component data. This type of data is not only subject to the inherent "constant sum constraint" but also possesses characteristics such as high dimensionality, relativity, complex structure, and frequent zero values. Directly applying traditional statistical methods or classification models based on Euclidean distance can lead to serious biases; therefore, it is necessary to develop specialized analytical methods applicable to its unique geometric structure.

[0003] Currently, classification methods for component data mainly fall into two categories. One category is based on log-ratio transformation methods, such as additive log-ratio, central log-ratio, or equidistant log-ratio transformations, which map the data from a simplex to Euclidean space before applying traditional classifiers such as Support Vector Machines (SVM) and logistic regression. The other category is based on parametric probability density estimation methods, such as assuming the data follows a Dirichlet distribution or, after square root transformation, assuming it follows a Kent distribution on a sphere, and then constructing a classification model.

[0004] However, existing methods, such as log-ratio transformation combined with support vector machines, cannot directly and naturally handle the ubiquitous zero values ​​in multivariate component data. These methods must rely on manual zero-value imputation preprocessing, which not only introduces subjective bias and uncertainty but also makes the performance and stability of the final classification model heavily dependent on the imputation strategy, resulting in insufficient robustness. Methods based on parametric probability density estimation have certain presuppositions on the data distribution, such as requiring the density function to satisfy unimodal and light-tailed characteristics, which have significant limitations in practical applications. Summary of the Invention

[0005] To address the technical problems that existing methods, such as those combining log-ratio transformation with support vector machines, cannot directly and naturally handle the ubiquitous zero values ​​in data, and that methods such as parametric probability density estimation have significant limitations, this invention provides a component data classification method and system based on non-parametric density ratio.

[0006] The technical solutions provided by the embodiments of the present invention are as follows: A first aspect of this invention provides a component data classification method based on non-parametric density ratios, comprising: S1: Obtain component data, which includes multiple component variables and their corresponding category labels; S2: By normalizing using the L2 norm, each variable in the component data is mapped to a non-negative sphere to obtain the sample matrix; S3: The finite reflection group generated by the coordinate axis reflection is used to symmetrically extend each component variable of the sample matrix to obtain the extended dataset; S4: By using the spherical kernel density function, the probability density is estimated for each extended dataset to obtain the probability density estimation function; S5: Perform a pullback operation on the probability density estimation function to obtain the class conditional probability density function of the component data; S6: Based on the class conditional probability density function, the log density ratio of each component variable is calculated through log marginal density ratio transformation to obtain the feature-enhanced dataset; S7: Train the SVM model based on the feature enhancement dataset and the corresponding category labels; S8: Obtain target component data; S9: Calculate the target feature enhancement dataset for target component data based on the class conditional probability density function; S10: Input the target feature enhancement dataset into the trained SVM classification model and output the component data classification results.

[0007] A second aspect of the present invention provides a component data classification system based on non-parametric density ratios, comprising: processor; A memory storing computer-readable instructions, which, when executed by the processor, implement the component data classification method based on non-parametric density ratio as described in the first aspect.

[0008] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the component data classification method based on non-parametric density ratio as described in the first aspect.

[0009] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this invention, by employing spherical mapping and symmetric extension techniques, the component data is mapped from the simplex space to a unit non-negative hypersphere and then symmetrically extended. This allows for the direct and natural processing of zero values ​​in the original data without any manual filling operations. The non-parametric kernel density estimation based on spherical geometry does not pre-determine the data distribution, thus offering greater flexibility. Furthermore, the logarithmic marginal density ratio transformation method effectively enhances features, resulting in a classification model with higher classification accuracy, stronger stability, and robustness. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a flowchart illustrating a component data classification method based on non-parametric density ratio, provided in an embodiment of the present invention.

[0012] Figure 2 This is a schematic diagram of the structure of a component data classification system based on non-parametric density ratio, provided in an embodiment of the present invention. Detailed Implementation

[0013] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0014] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0015] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.

[0016] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0017] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0018] Reference manual attached Figure 1 The diagram illustrates a flowchart of a component data classification method based on non-parametric density ratio provided by an embodiment of the present invention.

[0019] This invention provides a component data classification method based on non-parametric density ratio. This method can be implemented by a component data classification device based on non-parametric density ratio, which can be a terminal or a server. The processing flow of the component data classification method based on non-parametric density ratio may include the following steps:

[0020] S1: Obtain component data, which includes multiple component variables and their corresponding category labels.

[0021] Among them, component data refers to a dataset with complex structure, consisting of multiple vectors that satisfy the constraint that "each component is non-negative and the sum is a constant value", and containing zero values.

[0022] For example, suppose there is a sample size of n And includes p The component dataset of component variables, denoted as . Each sample corresponds to a category label. The value can be 1 or 0. The expression is as follows:

[0023]

[0024] in, Indicates the sample size. Indicates the first j The number of components in a component variable. , , d Indicates the total number of components. This represents the first component value of the first constituent variable in the first sample. This represents the second component value of the first component variable in the first sample. This represents the first constituent variable in the first sample. Each component value This represents the first component value of the second component variable in the first sample. Indicates the first sample. p The first component variable Each component value This represents the first component value of the first constituent variable in the second sample. This represents the second component value of the first component variable in the second sample. This represents the first constituent variable in the first sample. Each component value This represents the first component value of the second constituent variable in the second sample. Indicates the second sample. pThe first component variable Each component value Indicates the first n The first component value of the first component variable in each sample. Indicates the first n The second component value of the first component variable in a sample. Indicates the first n The first component variable in the sample Each component value Indicates the first n The first component value of the second component variable in the sample. Indicates the first n In the nth sample The first component variable Each component value.

[0025] Furthermore, this invention employs an extended spherical probability density estimation method. Through spherical mapping, the boundary zero-point problem of component data is transformed into a spherical problem more easily handled in directional statistics.

[0026] S2: By normalizing using the L2 norm, each variable in the component data is mapped to a non-negative sphere to obtain the sample matrix.

[0027] The L2 norm refers to the square root of the sum of the squares of the vector's components, used to measure the "length" or magnitude of the vector.

[0028] The nonnegative sphere refers to the geometric space formed by vectors whose components are all nonnegative and whose magnitude (L2 norm) is 1. It is the part of the unit sphere in the first quadrant.

[0029] It should be noted that step S2 abandons the traditional approach of using logarithmic ratio transformation to map data to Euclidean space, which is commonly relied upon in component data analysis. Instead, it innovatively adopts L2 norm normalization to directly map the data to the geometric structure of a non-negative unit sphere, thus naturally bypassing the zero-value sensitivity issue and eliminating the need for manual filling.

[0030] In one possible implementation, S2 specifically includes sub-steps S201 to S203: S201: Calculate the L2 norm of the vectors corresponding to each variable in the component data.

[0031] S202: The normalized spherical vector is obtained by dividing the vector of each variable by the corresponding L2 norm.

[0032] S203: Construct the mapped sample matrix based on all spherical vectors.

[0033] Specifically, spherical mapping is performed on the multivariate component data in the simplex space. ForX The Middle The first sample Component variables Divide it by the corresponding L2 norm. Let the mapped vector be denoted as... ,have:

[0034] .

[0035] .

[0036] in Represents the normalized spherical vector. Represents the original component vector. Describing the L2 norm, The original component values ​​are represented by the sample matrix mapped to the non-negative sphere, denoted as . , Indicates the first The first sample A spherical variable.

[0037] In this embodiment of the invention, component data is mapped from a simplex space subject to "fixed sum constraints" to a non-negative sphere by L2 norm normalization, laying the foundation for subsequent use of techniques in the field of directional statistics.

[0038] S3: The finite reflection group generated by the coordinate axis reflection is used to symmetrically extend each component variable of the sample matrix to obtain the extended dataset.

[0039] In this context, a finite reflection group refers to a mathematical group structure consisting of basic reflection operations (such as inverting coordinate axes) and all their combinations. In this invention, it specifically refers to the set of all possible reflection transformations generated by independently performing an "invert" operation on each coordinate axis in a high-dimensional space.

[0040] Symmetric extension refers to the process of using the symmetry of a finite reflection group to map the original data points (located on a non-negative sphere) to all their symmetrical positions on a unit sphere through group action, thereby generating a new set of mirror data points distributed across the entire sphere.

[0041] In one possible implementation, S3 specifically includes sub-steps S301 to S304: S301: Based on the number of components of each component variable, construct a finite reflection group generated by coordinate axis reflection.

[0042] S302: Through each reflection operation in the finite reflection group, map each sample point of each component variable in the sample matrix to generate all symmetric points of each component variable.

[0043] S303: Merge each original sample point and all symmetrical points to obtain an extended dataset of the original sample points.

[0044] In this embodiment of the invention, by using a symmetric extension based on a finite reflection group, the data points located at the boundary of the non-negative sphere (including zero values) are systematically mapped to the entire unit sphere, eliminating the boundary effect and enabling subsequent spherical kernel density estimation to be robustly performed on the unbounded extended data.

[0045] Specifically, for the first in the sample matrix The first sample Component variables ,remember First, the data is extended on a sphere. The extended formula is as follows:

[0046] in, Indicates to The expanded dataset express The number of elements in the middle. express stable subgroups Indicates the reflection group All operations act on the origin. The set of all distinct points obtained, i.e., the orbit. It is a finite reflection group generated by the reflection of the coordinate axes. Specifically, for For each coordinate axis in 3D space, there exists a reflection operation that inverts that coordinate while leaving other coordinates unchanged. For example, in 3D space (… )middle, Generated by the following three reflections, :reflection x Axis, i.e. , :reflection y Axis, i.e. , :reflection z Axis, i.e. . Including all possible combinations of reflections, total Each element, i.e., the group Size for Let a point be on a non-negative sphere. via finite reflection group After expansion, we get eight points. The set consisting of these eight points is composed of The resulting equivalence class after expansion is called an orbit, denoted as . Indicates to Finite reflection group Those reflections that retain their coordinates after the operation. For example, for a point... The points that remain unchanged after performing finite reflection group operations are: ,therefore ,track for .

[0047] S4: The probability density is estimated on the extended dataset using the spherical kernel density function, resulting in the probability density estimation function.

[0048] The spherical kernel density function is a function specifically used to estimate the probability density of data points on a unit sphere. The expression for the spherical kernel density function is as follows:

[0049] .

[0050] in, Represents the estimated probability density function. This represents the point on the sphere to be evaluated. Represents the first on the sphere i sample points Represents the kernel function. h This represents the bandwidth parameter, which controls the smoothness. Describing a d-dimensional unit hypersphere, This represents the normalization constant, which ensures that the integral result of the spherical kernel density estimate is 1.

[0051] In one possible implementation, S4 specifically includes sub-steps S401 and S402: S401: Based on the category labels corresponding to the component data, divide each extended dataset into a subset of positive class samples and a subset of negative class samples.

[0052] Among them, the positive class sample subset refers to the original samples selected from the extended dataset whose class label is positive (usually marked as positive). Y The set consisting of all sample points of (=1).

[0053] The negative class sample subset refers to the subset selected from the extended dataset whose corresponding original samples have negative class labels (usually tagged as negative). Y The set consisting of all sample points (=0).

[0054] S402: Using the spherical kernel density function, the probability density of the positive class sample subset and the negative class sample subset are estimated respectively, resulting in the positive class probability density estimation function and the negative class probability density estimation function.

[0055] Optionally, the bandwidth parameter of the spherical kernel density function can be optimized using a cross-validation method.

[0056] Specifically, The extended spherical variable is denoted as .based on Y =1 and Y =0 for both categories, Divided into positive class sample subsets and negative class sample subset Through the spherical kernel density function Estimate the positive class sample subset nonparametric probability density and negative class sample subset nonparametric probability density .

[0057] In this embodiment of the invention, the probability density functions of the positive and negative classes are directly estimated on the extended dataset using the spherical kernel density function, thereby obtaining a robust density estimate that is adapted to the spherical geometry and insensitive to zero values, providing a reliable probabilistic basis for subsequent feature enhancement.

[0058] S5: Perform a pullback operation on the probability density estimation function to obtain the class conditional probability density function of the component data.

[0059] The pullback operation refers to a mathematical process of "back-mapping" a probability density estimate defined on an extended dataset (the entire sphere) back to the original data space (the non-negative sphere).

[0060] The class conditional probability density function refers to the probability density function of a given sample belonging to a specific class (such as the positive class). Y =1 or negative class Y Given that (=0), the probability density of a certain random variable (i.e., each component variable in this invention) taking a specific value.

[0061] It should be noted that step S5 differs from existing methods that directly perform parametric density estimation in the component data space or abandon the transformation estimation of component geometry. Instead, it creatively designs a "pull-back" operation to reverse-map the kernel density estimate obtained on the entire sphere back to the original nonnegative sphere. This successfully restores the boundary-free distortion-free density estimate obtained based on the extended dataset to the class-conditional probability density function in the original component data space.

[0062] In one possible implementation, S5 specifically includes: The probability density estimates of all symmetric extension points are summed to obtain the class conditional probability density function of the component data.

[0063] Specifically, the calculation formula for the pullback operation is as follows: .

[0064] in, The probability density function representing the component data (on a non-negative sphere). Represents the normalization constant. The probability density function representing the extended dataset (over the entire sphere) is based on the principle that points on the sphere... The density estimates of all extended symmetric points are summed to reconstruct the probability density estimate of the corresponding original data.

[0065] Specifically, for the positive class sample subset density function and negative class sample subset density function Perform pull-back operations separately to obtain component data. Positive class conditional probability density Negative class conditional probability density .

[0066] S6: Based on the class-conditional probability density function, the logarithmic marginal density ratio of each component variable is calculated through logarithmic marginal density ratio transformation to obtain the feature-enhanced dataset.

[0067] Log-marginal density ratio transformation refers to a feature enhancement method based on probability density. Its core idea is: for each feature (in this invention, for each constituent variable), calculate its probability density function under the positive and negative class conditions respectively, then substitute the observed values ​​into these two functions and take their natural logarithms, and finally calculate the difference between the two log density values ​​(i.e., positive class log density minus negative class log density).

[0068] It should be noted that step S6 differs from existing component data classification methods that directly use original component values ​​or simple transformed values ​​as features. Instead, it innovatively applies a logarithmic marginal density ratio transformation to the component data, using the class-conditional probability density function obtained in the preceding steps as the computational basis. Within the component data analysis framework, a feature enhancement method based on probabilistic inference and with explicit statistical interpretation is implemented. Component vectors with fixed sum constraints are transformed into real-valued enhanced features that enhance discriminative information, fundamentally optimizing the input quality of subsequent classifiers, thus achieving a leap from "geometric processing" to "statistical discrimination."

[0069] Specifically, the marginal density ratio is a core metric for evaluating the discriminative power of a single feature. In binary classification problems (category labels)... In the vector ∈{0,1}, The first in j Features Its marginal density ratio is specifically defined as follows:

[0070] .

[0071] in, express marginal density ratio, Indicates a given =1 The marginal density function, Indicates a given =0 The marginal density function. Directly reflects the eigenvalue The ability to distinguish between categories. If >1, then More likely to come from category 1, and vice versa. Under the strong assumption that features are independent of each other, based on The constructed classifier is the theoretically optimal univariate classifier (i.e., achieving the minimum Bayes error rate).

[0072] In one possible implementation, S6 specifically includes sub-steps S601 to S603: S601: Based on the class-conditional probability density function, calculate the positive and negative log-density values ​​corresponding to the observed values ​​of each component variable.

[0073] S602: Subtract the negative log density value from the positive log density value to obtain the log density ratio of each component variable.

[0074] Specifically, the logarithmic marginal density ratio transformation is performed as follows: .

[0075] in, Indicates the first The first sample Component variables The log density ratio, express The natural logarithmic value, i.e., the positive class logarithmic density value, express The natural logarithmic value of , i.e., the negative class logarithmic density value.

[0076] S603: Combine the log density ratios of all constituent variables to form a feature-enhanced dataset of the samples.

[0077] Specifically, the data matrix after log density ratio transformation is denoted as... The original component dataset and Perform row merging to obtain the feature-enhanced dataset. .

[0078] In this embodiment of the invention, the class conditional probability density of each constituent variable is transformed into a single discriminative scalar value through logarithmic marginal density ratio transformation, which effectively improves the class separability of features, thereby providing a high-quality input with higher information density and easier processing for subsequent linear classifiers.

[0079] S7: Train the SVM model based on the feature enhancement dataset and the corresponding category labels.

[0080] Among them, the support vector machine algorithm refers to a supervised machine learning method based on statistical learning theory. Its core idea is to find a maximum margin hyperplane in the feature space that can optimally separate samples of different categories.

[0081] In this context, the SVM model refers to the final classifier constructed in this invention.

[0082] In one possible implementation, S7 specifically refers to: Based on the feature-enhanced dataset and the corresponding category labels, an SVM model is trained using the support vector machine algorithm.

[0083] In this embodiment of the invention, a support vector machine is used to process the high-quality dataset after feature enhancement. Through training, high-precision classification performance with strong generalization ability was achieved.

[0084] S8: Obtain target component data.

[0085] It should be noted that the target component data is the new sample data to be classified. Its data structure is consistent with the training data obtained in step S1. Both are multivariate component data composed of multiple component variables that satisfy the sum and constraint. Before classification prediction, it needs to go through the same mapping, expansion, density estimation and feature transformation process in steps S2 to S6 in sequence to be converted into a feature enhancement dataset consistent with the training stage before it can be input into the SVM model.

[0086] S9: Calculate the target feature enhancement dataset for target component data based on the class conditional probability density function.

[0087] In this embodiment of the invention, by applying the logarithmic marginal density ratio transformation to the target data, a discriminative feature representation consistent with the training data is obtained, thereby ensuring the fairness and consistency of the model prediction, effectively avoiding performance degradation caused by inconsistency in the feature space of the input data, and ultimately ensuring the generalization ability and reliability of the classification model in practical applications.

[0088] S10: Input the target feature enhancement dataset into the trained SVM model and output the component data classification results.

[0089] Among them, the component data classification result refers to the category label (such as "Category 1" or "Category 0") output by the model for each target sample after the target component data is input into the trained SVM model, based on the learned discrimination rules.

[0090] In this embodiment of the invention, by inputting the target data into a trained SVM model, reliable classification results can be output directly and efficiently, realizing automated and high-precision category discrimination of unknown component data. This fully verifies the effectiveness and practicality of the end-to-end solution from feature construction to classification decision in practical applications.

[0091] For example, water quality data is fundamental information in the fields of aquatic environmental chemistry analysis and water resource management. Accurate classification of water quality data is of great significance in various research directions, including environmental science, hydrology, and environmental management. Its applications include identifying the chemical types of natural water bodies and their evolution, tracing pollution sources and conducting risk assessments, evaluating the health of aquatic ecosystems, supporting water quality standard setting and management decisions, and revealing the impacts of regional geochemical cycles and human activities. This invention uses the method proposed in this paper to classify a dataset of water chemical components. This dataset records the water chemical components of different rivers and watersheds, containing a total of 14 characteristic variables.

[0092] The dataset samples are derived from three major rivers in Catalonia: the Anoia, Cardener, and Llobregat rivers. Sampling points were set up at different locations along each river, resulting in a total of 485 samples. The class distribution is as follows: 143 samples from the Anoia river, 95 samples from the Cardener river, and 247 samples from the Llobregat river. The attributes and parameters of the water quality chemistry dataset used in this study are described below:

[0093] (1) Sampling and Identification Information: Code (site code), Site (site number), Location (geographical location description), River (river to which it belongs), Date (sampling date) (2) Water quality chemical parameters: Cations: Sodium ions (Na + ), potassium ions (K) + ), magnesium ions (Mg 2+ ), calcium ions (Ca 2 + ), Strontium ion (Sr) 2+ Barium ions (Ba) 2+ ), ammonium ions (NH4+) + Anion: Chloride ion (Cl...)- ), nitrate (NO3) - ), phosphate (PO4) 3- ), sulfate (SO4 2- ), bicarbonate (HCO3) - ).

[0094] (3) Other parameters: hydrogen ion concentration (H+) + ), Total organic carbon (TOC).

[0095] This dataset can reflect the differences in hydrochemical characteristics of different river basins, and is suitable for river type identification and source tracing studies based on hydrochemical composition, providing a reliable experimental data foundation for water quality classification modeling.

[0096] Furthermore, regarding the units, in the original data, the concentrations of major cations and anions are expressed in micromoles per liter (µmol / L), while the unit for total organic carbon (TOC) is milligrams per liter (mg / L). To maintain consistency in data units and the model input scale, and considering the hydrogen ion concentration (H+), + The numerical value was too small and the distribution was close to zero, so H was excluded from feature selection in this study. + For the two TOC items with inconsistent units, the remaining 12 main ion concentrations were retained as classification features. After retaining 12 features, a closure operation was performed on every three features to generate four component variables (each with 3 dimensions), constructing a multivariate component data structure. The sample includes three rivers and different chemical component concentrations for each river.

[0097] Optionally, the three rivers can be divided into three categories based on their names: Anoia, Cardener, and LLobregat, with corresponding sample sizes of 143, 95, and 247, respectively. The categories of Anoia and Cardener are merged and denoted as category 1, while LLobregat is denoted as category 0. The total sample size is n = 485, with the sample size of category 1 being n1 = 238 (143 + 95) and the sample size of category 0 being n0 = 247.

[0098] Specifically, 10-fold cross-validation (repeated 50 times) was used to evaluate the performance of the proposed model (an SVM classifier based on nonparametric density ratio, denoted as NDR-SVM), and it was compared with Kent-SVM, R-SVM, L-SVM, and H-SVM methods. NDR-SVM achieved the best results in accuracy (94.85%), F1 score (95.15%), and FAR (4.44%), especially with a significantly lower FAR than other methods (e.g., R-SVM at 13.17%), thanks to the natural handling of boundary points by the spherical extended kernel density estimation. R-SVM, L-SVM, and H-SVM, due to their direct application of Euclidean space mapping, are more affected by zero-value and definite-sum constraints, resulting in relatively poor performance across various metrics. Among the comparative methods, Kent-SVM also showed a significant improvement over R-SVM, but NDR-SVM further enhanced its boundary handling capability through spherical extended density estimation.

[0099] Kent-SVM refers to performing a square root transformation on the component data to map it to a sphere, assuming that it follows a Kent distribution (an elliptical symmetric distribution on a sphere), constructing features by estimating the Kent distribution parameters, and then inputting them into an SVM for classification.

[0100] R-SVM (Raw-SVM) refers to directly using the original component data as features and inputting it into an SVM for classification.

[0101] Among them, L-SVM (L2-SVM) refers to mapping the component data to a sphere by L2 norm normalization only, and then directly using the spherical coordinates as features input to the SVM.

[0102] H-SVM (Hellinger-SVM) refers to processing component data using the square root transformation (Hellinger transformation) before inputting it into an SVM.

[0103] Furthermore, in comparative experiments using water quality data, the NDR-SVM model proposed in this invention demonstrated the best performance across multiple metrics: accuracy of 94.85%, detection rate (DR) of 94.23%, false alarm rate (FAR) of 4.44%, F1 score of 95.15%, G-mean of 94.89%, and Matthews correlation coefficient (MCC) of 89.67%. In comparison, Kent-SVM achieved an accuracy of 90.68%, a DR of 87.72%, a FAR of 6.56%, an F1 score of 90.09%, a G-mean of 90.54%, and an MCC of 81.41%. R-SVM achieved an accuracy of 87.77%, a DR of 88.80%, a FAR of 13.17%, an F1 score of 87.49%, a G-mean of 87.74%, and an MCC of 75.68%. The L-SVM achieved an accuracy of 87.26%, a DR of 87.71%, a FAR of 13.22%, an F1 score of 86.89%, a G-mean of 87.19%, and a MCC of 74.55%. The H-SVM achieved an accuracy of 87.48%, a DR of 90.36%, a FAR of 15.19%, an F1 score of 87.43%, a G-mean of 87.47%, and a MCC of 75.27%. Experimental results demonstrate that NDR-SVM comprehensively outperforms other comparative methods in classification performance.

[0104] In practical applications, L2 norm normalization maps component data from a simplex to a non-negative sphere, providing a suitable geometric basis for subsequent processing. Then, a finite reflection group is used to symmetrically expand the spherical data, naturally transforming boundary zeros into a symmetrical distribution across the entire sphere, completely eliminating boundary effects. Next, kernel density estimation is performed on the expanded sphere, and the class-conditional probability density of the original component space is reconstructed through a pullback operation. Finally, a logarithmic marginal density ratio transformation is performed based on this probability density function, converting the component vectors into high-quality features with enhanced discriminative information, which are then used to train a support vector machine for classification. This approach handles zero values ​​in the component data naturally and robustly without any artificial padding or truncation. It respects the geometric constraints of the component data throughout, avoiding information distortion caused by inappropriate transformations. Discriminative enhancement is achieved through probability-driven feature transformation, significantly improving the accuracy and generalization ability of subsequent classifiers. This results in a theoretically rigorous, computationally feasible, and comprehensive classification method applicable to multivariate component data, with broad practical value in environmental, geological, and economic fields.

[0105] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this invention, by employing spherical mapping and symmetric extension techniques, component data is mapped from the simplex space to a unit hypersphere and then symmetrically extended. This allows for the direct and natural handling of zero values ​​in the original data without any manual filling operations. This not only avoids the subjective bias and uncertainty introduced by zero-value preprocessing but also effectively enhances features through kernel density estimation based on spherical geometry and logarithmic marginal density ratio transformation. The resulting SVM classification model exhibits higher classification accuracy, stronger stability, and robustness.

[0106] Reference manual attached Figure 2 This paper presents a schematic diagram of the structure of a component data classification system based on non-parametric density ratio provided by the present invention.

[0107] The present invention also provides a component data classification system 20 based on nonparametric density ratio, applied to the above-mentioned component data classification method based on nonparametric density ratio, comprising: Processor 201.

[0108] The memory 202 stores computer-readable instructions that, when executed by the processor 201, implement the component data classification method based on non-parametric density ratio as described in the method embodiment.

[0109] The component data classification system 20 based on non-parametric density ratio provided by the present invention can perform the above-mentioned component data classification method based on non-parametric density ratio and achieve the same or similar technical effects. To avoid duplication, the present invention will not elaborate further.

[0110] It should be understood that the processor in the embodiments of the present invention can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0111] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0112] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0113] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0114] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.

[0115] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0116] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0117] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0118] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0120] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0121] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0122] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the component data classification method based on non-parametric density ratio as described in the method embodiment.

[0123] The present invention provides a computer-readable storage medium that can implement the steps and effects of the component data classification method based on non-parametric density ratio in the above-described method embodiments. To avoid repetition, the present invention will not elaborate further.

[0124] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

[0125] The following points need to be explained: (1) The accompanying drawings of the embodiments of the present invention only involve the structures involved in the embodiments of the present invention. Other structures can refer to the general design.

[0126] (2) For clarity, the thickness of layers or regions is enlarged or reduced in the drawings used to describe embodiments of the invention, i.e., these drawings are not drawn to scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being “above” or “below” another element, the element may be “directly” located “above” or “below” the other element or there may be intermediate elements.

[0127] (3) Where there is no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other to obtain new embodiments.

[0128] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. The scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A component data classification method based on nonparametric density ratio, characterized in that, include: S1: Obtain component data, which includes multiple component variables and their corresponding category labels; S2: By normalizing using the L2 norm, each variable in the component data is mapped to a non-negative sphere to obtain the sample matrix; S3: The finite reflection group generated by the coordinate axis reflection is used to symmetrically extend each component variable of the sample matrix to obtain the extended dataset; S4: Using the spherical kernel density function, the probability density of each of the extended datasets is estimated to obtain the probability density estimation function; S5: Perform a pullback operation on the probability density estimation function to obtain the class conditional probability density function of the component data; S6: Based on the class conditional probability density function, the log density ratio of each constituent variable is calculated through log marginal density ratio transformation to obtain the feature-enhanced dataset; S7: Train the SVM model based on the feature enhancement dataset and the corresponding category labels; S8: Obtain target component data; S9: Based on the class conditional probability density function, calculate the target feature enhancement dataset of the target component data; S10: Input the target feature enhancement dataset into the trained SVM model and output the component data classification results.

2. The component data classification method based on non-parametric density ratio according to claim 1, characterized in that, S2 specifically includes: S201: Calculate the L2 norm of the vector corresponding to each of the variables in the component data; S202: The normalized spherical vector is obtained by dividing the vector of each variable by the corresponding L2 norm; S203: Construct the mapped sample matrix based on all the spherical vectors.

3. The component data classification method based on non-parametric density ratio according to claim 1, characterized in that, S3 specifically includes: S301: Based on the number of components of each of the constituent variables, construct the finite reflection group generated by the reflection of the coordinate axes; S302: Through each reflection operation in the finite reflection group, each sample point of each constituent variable in the sample matrix is ​​mapped to generate all symmetric points of each constituent variable; S303: Merge each original sample point and all the symmetrical points to obtain an extended dataset of the original sample points.

4. The component data classification method based on non-parametric density ratio according to claim 1, characterized in that, S4 specifically includes: S401: Based on the category labels corresponding to the component data, each of the extended datasets is divided into a positive class sample subset and a negative class sample subset; S402: Using the spherical kernel density function, the probability density of the positive class sample subset and the negative class sample subset are estimated respectively to obtain the positive class probability density estimation function and the negative class probability density estimation function.

5. The component data classification method based on non-parametric density ratio according to claim 1, characterized in that, The bandwidth parameter of the spherical kernel density function is optimized using a cross-validation method.

6. The component data classification method based on non-parametric density ratio according to claim 1, characterized in that, Specifically, S5 is: The estimated probability density functions of the extended dataset are summed to obtain the class-conditional probability density function of the component data.

7. The component data classification method based on non-parametric density ratio according to claim 1, characterized in that, S6 specifically includes: S601: Based on the class conditional probability density function, calculate the positive class log density value and the negative class log density value corresponding to the observed values ​​of each component variable; S602: Subtract the negative log density value from the positive log density value to obtain the log density ratio of each of the constituent variables; S603: Combine the log density ratios of all the constituent variables to form the feature-enhanced dataset of the samples.

8. The component data classification method based on non-parametric density ratio according to claim 6, characterized in that, Specifically, S7 is: Based on the enhanced features and corresponding category labels, a classification model is trained using the support vector machine algorithm.

9. A component data classification system based on nonparametric density ratio, characterized in that, include: processor; A memory storing computer-readable instructions, which, when executed by the processor, implement the composition data classification method based on non-parametric density ratio as described in any one of claims 1 to 8.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the composition data classification method based on non-parametric density ratio as described in any one of claims 1 to 8.