Answers.Body: <p>Since your process is additive (emission spectrums?), this can be solved with <a href="https://en.wikipedia.org/wiki/Non-negative_least_squares" rel="nofollow noreferrer">non-negative least squares</a>. You could try <a href="https://en.wikipedia.org/wiki/Ordinary_least_squares#Matrix/vector_formulation" rel="nofollow noreferrer">ordinal least squares</a> as well, but it may give you negative concentrations. I don't think you need any fancy neural networks or ML here.</p>
  <p>The constrained formulation is <span class="math-container">$ \arg \min_x || Ax - y ||_2^2$</span>, <span class="math-container">$x \ge 0$</span>, you &quot;encode&quot; the known spectrum data to <span class="math-container">$A$</span> and the measured spectrum is <span class="math-container">$y$</span>, then <span class="math-container">$x$</span> gives you the concentrations.</p>
  <p>If you measured the absorption spectrum instead, you'd need a different formulation.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-15T16:58:18.143Z
Answers.Text: There can be many compounds in the mix. The goal is to identify them and their strengths. Would this method work?
Answers.UserDisplayName: David293836
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-15T17:07:33.227Z
Answers.Text: Yes, `A` is a `n x m` matrix where `n` is the number of measured wavelengths and `m` is the number of known compounds. Vector `x` has the length `m` and `y` has `n`. `x` is zero (or close to zero) for compounds not present in the mix, and positive for existing ones. I'm not sure what would happen if there are unknown compounds present though. At least the prediction error would be large.
Answers.UserDisplayName: NikoNyrh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-16T01:06:24.310Z
Answers.Text: To clarify, what do you mean by "the goal is to identify them" [the compounds]? Since we assume that the mixture consists only of known compounds, isn't it enough to determine their strengths (which may be zero for many of them, for a given sample)? For example there is no need to detect whether there are any unknown compounds in the mix.
Answers.UserDisplayName: NikoNyrh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-16T19:04:42.180Z
Answers.Text: Good question. If there is presence of unknown compound(s), this ML/DS/AI module needs to alert such event.
Answers.UserDisplayName: David293836
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-15T16:30:36.293Z
Answers.LastActivityDate: 2024-03-15T16:30:36.293Z
Answers.UserDisplayName: NikoNyrh
Body: <p>I have a set of known frequency spectrum data for this set of chemical compounds. Then the unknown Y is the mixture of some of these compounds. The task is to determine what compounds are in this mixture and their strengths. For example, S1 is the unit spectrum of the first compound and S2 is the unit spectrum of the 2nd compound. If the mixture has A units of the first compound and B units of the 2nd compound, the resulting Spectrum = A<em>S1 + B</em>S2.</p>
  <p>I have seen examples of multi-class multi-label classification models, and multi-outputs regression models. But I need a model that can do both. Any suggestions?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-03-15T10:05:48.793Z
Comments.Text: spectrum as image can be classified using any image classification method..
Comments.UserDisplayName: Nikos M.
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-03-15T16:55:50.723Z
Comments.Text: Yes, but this task requires the model to predict the strength of "dog" and the strength of "cat". Common image classification models cannot do that.
Comments.UserDisplayName: David293836
Tags: <machine-learning><pattern-recognition><model-request>
Title: What ML/DL algorithms for frequency spectrum pattern classifications?
UserDisplayName: David293836
ThreadText: # What ML/DL algorithms for frequency spectrum pattern classifications?
  
  (Asked by: username_0 on 2024-03-14)
  
  I have a set of known frequency spectrum data for this set of chemical compounds. Then the unknown Y is the mixture of some of these compounds. The task is to determine what compounds are in this mixture and their strengths. For example, S1 is the unit spectrum of the first compound and S2 is the unit spectrum of the 2nd compound. If the mixture has A units of the first compound and B units of the 2nd compound, the resulting Spectrum = A*S1 + B*S2.
  
  I have seen examples of multi-class multi-label classification models, and multi-outputs regression models. But I need a model that can do both. Any suggestions?
  
  **Tags:** machine-learning, pattern-recognition, model-request
  > **Comments:**
  > **username_1**: spectrum as image can be classified using any image classification method..  
  > **username_0**: Yes, but this task requires the model to predict the strength of "dog" and the strength of "cat". Common image classification models cannot do that.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2024-03-15. Score: 1
  
  Since your process is additive (emission spectrums?), this can be solved with [non-negative least squares](https://en.wikipedia.org/wiki/Non-negative_least_squares). You could try [ordinal least squares](https://en.wikipedia.org/wiki/Ordinary_least_squares#Matrix/vector_formulation) as well, but it may give you negative concentrations. I don't think you need any fancy neural networks or ML here.
  
  The constrained formulation is $ \arg \min\_x || Ax - y ||\_2^2$, $x \ge 0$, you "encode" the known spectrum data to $A$ and the measured spectrum is $y$, then $x$ gives you the concentrations.
  
  If you measured the absorption spectrum instead, you'd need a different formulation.
  
  > **Comments:**
  > **username_0**: There can be many compounds in the mix. The goal is to identify them and their strengths. Would this method work?  
  > **username_2**: Yes, `A` is a `n x m` matrix where `n` is the number of measured wavelengths and `m` is the number of known compounds. Vector `x` has the length `m` and `y` has `n`. `x` is zero (or close to zero) for compounds not present in the mix, and positive for existing ones. I'm not sure what would happen if there are unknown compounds present though. At least the prediction error would be large.  
  > **username_2**: To clarify, what do you mean by "the goal is to identify them" [the compounds]? Since we assume that the mixture consists only of known compounds, isn't it enough to determine their strengths (which may be zero for many of them, for a given sample)? For example there is no need to detect whether there are any unknown compounds in the mix.  
  > **username_0**: Good question. If there is presence of unknown compound(s), this ML/DS/AI module needs to alert such event.  
  
  ---
  
  