'Python Kernel Density Plotting

I am currently using Scikit's kernelDensity to compute the gaussian kernel likelihoods of a dataset.

I am using the score_samples function to compute the log-likelihood of each sample under the model.

However, I want to plot these likelihoods for one feature instead of the full 6 features per sample contained in the dataset.

To summarize, each sample in my dataset contains 6 features. While those are useful when using the KernelDensity function to train, I would like to only extract the score_sample for one particular feature, and I can't seem to find a method for doing so.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source