# Estimating a metric of a mixture

I'm looking for a general approach to solve a problem that is best demonstrated by the following example.

You mix six different batches of orange juice and you know the acidity, the sugar content, the concentration of volatile particles in each batch of the juice, the growing location of the fruits, and other data. You mix those batches, sell the product, and measure how well it was accepted by the market. Tomorrow, you decide to mix four other batches, the next day you will mix two batches, etc: the number of components in your product isn't constant. The goal is to take the information about each component and to predict the outcome metric.

If we could compute the average value of each input parameter, I would start by computing the average value of each parameter in the mix, and trying to use it as the X data in an ML algorithm. However, some of the parameters cannot be added. In our example, such a parameter can be the plantation age, plantation location, cultivar of the fruit, etc

What are the approaches to solve this problem? Does it belong to a certain studies problem class ?

## 1 Answer

However, some of the parameters cannot be added. In our example, such a parameter can be the plantation age, plantation location, cultivar of the fruit, etc

Can you explain why these can't be added?

There exist many ways to encode categorical information, such as plantation location, such that a ML model can interpret it. In my use-cases, in supply-chain, I deal with thousands of unique location observations, where in I use a geo-encoding API to return latitude/longitude pairs to feed into my models.

In your case, where in you only have 6-factorial observations (that may be wrong), what I would do is to generally categorize your categorical features. So for location, instead of "Florida," I would say "South-East," and then lump all south-eastern locations together. Since you'll have low cardinality in feature size, binary or one-hot encoding may be useful for you.

• So, what you suggest is to use the existing dummy encoding and use averages on them? Sounds legit. Thanks Apr 26 '20 at 8:13
• @BorisGorelik That wasn't what I was originally suggesting, but now that you bring it up that may be a better alternative still. Group features together, and use their averages as your encoder. Apr 26 '20 at 20:36