Physics, Data Science, Least Squares, Chemometrics, Spectroscopy.
columns with w values. # This def returns an array of n values. Each value is the similarity score for the sample_spectrum and a component spectrum. similarity = np.dot(inv(np.dot(components, components.T)) , np.dot(components, sample_spectrum)) return similarity Next, some spectra to play with are