A substance fingerprinting method for drilling and production planning in a formation that comprises: a downhole tool performing a compositional analysis on a sample of a substance related to one or more characteristics of the formation and providing data sample points of the sample; storing the sample points within a data set; a downhole controller associating the data set with position and orientation of the downhole tool to form a three-dimensional image map of the borehole wall; applying a dimensionality reduction transform to the sample points of the compositional analysis to obtain a low-dimensionality representation, wherein said applying includes: identifying kernels that represent clusters within the data set; applying evolutionary computation to directly-encoded low-dimensionality coordinates for the kernels to select a bit-restricted initial encoding; refining the initial low-dimensionality coordinates for the kernels using a particle-swarm optimization by comparing the low-dimensionality coordinates for the kernels with a fitness value of a fitness function and, if better positions of the low-dimensionality coordinates for the kernels are determined based on the comparison, the low-dimensionality coordinates for the kernels are adjusted; using the adjusted low-dimensionality representation to match the sample points with data points of one or more closely-related substances stored in the data set; and identifying the one or more characteristics of the sample based on properties of the closely-related substances. a downhole tool performing a compositional analysis on a sample of a substance related to one or more characteristics of the formation and providing data sample points of the sample; storing the sample points within a data set; a downhole controller associating the data set with position and orientation of the downhole tool to form a three-dimensional image map of the borehole wall; applying a dimensionality reduction transform to the sample points of the compositional analysis to obtain a low-dimensionality representation, wherein said applying includes: identifying kernels that represent clusters within the data set; applying evolutionary computation to directly-encoded low-dimensionality coordinates for the kernels to select a bit-restricted initial encoding; refining the initial low-dimensionality coordinates for the kernels using a particle-swarm optimization by comparing the low-dimensionality coordinates for the kernels with a fitness value of a fitness function and, if better positions of the low-dimensionality coordinates for the kernels are determined based on the comparison, the low-dimensionality coordinates for the kernels are adjusted; using the adjusted low-dimensionality representation to match the sample points with data points of one or more closely-related substances stored in the data set; and identifying the one or more characteristics of the sample based on properties of the closely-related substances. identifying kernels that represent clusters within the data set; applying evolutionary computation to directly-encoded low-dimensionality coordinates for the kernels to select a bit-restricted initial encoding; refining the initial low-dimensionality coordinates for the kernels using a particle-swarm optimization by comparing the low-dimensionality coordinates for the kernels with a fitness value of a fitness function and, if better positions of the low-dimensionality coordinates for the kernels are determined based on the comparison, the low-dimensionality coordinates for the kernels are adjusted; using the adjusted low-dimensionality representation to match the sample points with data points of one or more closely-related substances stored in the data set; and identifying the one or more characteristics of the sample based on properties of the closely-related substances.