Looking for some vocabulary to help me refine my research so I can tackle this problem.

Here's an overview of the problem statement I'm working on.

At my company we manufacture various products, each product can have a number of different configurations, let's call each unique configuration of a product a PIN (this set up pretty much allows for unlimited customization).

Each product belongs to one of n discrete product classes.

We don't actually know the weights of any particular PIN, however we have years of shipping data and when things get shipped we have a weight associated with the entire shipment.

A shipment can contain several cartons and each carton can contain many different PINs (coming from any one of the n discrete product classes).

I have a nice, clean dataset which contains Shipment ID, Carton number, Product Class, PIN, Number of PINs in Carton, Number of items in Carton, and Total Weight of Carton.

Using this data my job is to estimate the weight of any given PIN.

I don't have a robust enough vocabulary to start my search, and I am hoping someone can help me with either some keywords, or relevant articles that I can look into that might help me make progress against this.

Warning: everything below is literally me thinking out loud

So each PIN is a '/' delimited string (all of them have 11 total '/') which denote the various combinations/configurations a product can take on.

So the easiest version of the problem looks like this - one shipment, with one carton, containing one PIN.

Then its pretty easy to get the weight of one PIN directly.

What I am currently thinking of doing is very similar to that easiest case, identify all shipments with one carton and one PIN.

Aggregate up to the product class level, calculate the mean weight, use that as a starting point.

It's looking like its going to be a situation where I may need to develop 13 separate models for the 13 different product classes


  • 1
    $\begingroup$ This seems like a straightforward row-reduction. If you have more PINs than you do instances of shipment data, then the system is under-determined. In that case, there's no unique solution, but you might be able to make some progress by enforcing that everything have a positive weight, and an assumption that similar PINs have similar weights. Is this correct, or is something else going on? $\endgroup$ – Sycorax Jun 10 '20 at 0:27
  • $\begingroup$ Hi @SycoraxsaysReinstateMonica- Thank you so much for the response! Your assumption is correct, I would expect PINs that belong to the same product class to have a similar weight. The details of the PIN represent various configurations of the product (dimensions, additional features, etc). Thanks for that vocab term, I'll do some research into row-reduction,. $\endgroup$ – TheCuriouslyCodingFoxah Jun 10 '20 at 0:48
  • $\begingroup$ Hi @SycoraxsaysReinstateMonica- Do you happen to have any resources or examples involving a row-reduction problem statement being solved in Python? Thanks in advance! $\endgroup$ – TheCuriouslyCodingFoxah Jun 10 '20 at 16:32
  • 1
    $\begingroup$ All you need to do is solve the linear system $Ax=b$, which might be under-determined in your case. See: numpy.org/doc/stable/reference/generated/… Row-reduction is just an elementary/textbook way to do that. $\endgroup$ – Sycorax Jun 10 '20 at 16:53
  • 1
    $\begingroup$ Probably. The real question is whether or not you have enough pivots. You’ll find out when you try to solve the system, though. $\endgroup$ – Sycorax Jun 10 '20 at 17:27

Consolidating the comments into an answer, this is a linear system. Each shipment has some number cartons which contain some number of PINs. We don't seem to be interested in the cartons themselves, so we can ignore that detail and represent the source data as an $n \times p$ matrix $A$ where there are $p$ products (PINs) and $n$ shipments. Likewise, there are $n$ measurements of the total weight, which we collect in a vector $b$. We know this system is linear because measuring total weight is linear in the number of items: the total weight of 2 items weighing 3 lbs is 6 lbs, etc.

So we need to solve the linear system $Ax=b$ for $x$, where $x$ is a vector collecting the weight of each PIN. This system can only be solved uniquely if $A$ is full-rank (and is not inconsistent). If it's not full rank, you'll add more information to the problem to make it solvable, either by collecting more data (e.g. by getting the weights of the PINs without pivots in $A$ and then appending this data), or using additional knowledge about the problem to sufficiently constrain the solution.

So far, all of this assumes that the weight of a shipment only includes the weight of the PINs, and not extraneous things like packaging, shipment boxes, etc. If this material is included in the total weight $b$, you'll have to account for that in some way, perhaps by adding additional columns for each element of packaging that's included in the weights in $b$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.