I would like to find how to change my data structure to make it compatible with a ML model, with the following constraints :

  • A Product is defined by {id, price, continuousVariable1, ..., continuousVariable10}
  • The training set is train.csv. Each line contains a date, a Product, and a list of Products (competing products)
  • For each row of train.csv, the size of the list of Products may change.

It would be easy if I had only one competing products : I could put all columns in the same file. But I have many competing products. The output variable is the product price.


I my opinion, the best way is if you create a column for every(!) product. Yes, u will get a high dimensional sparse Matrix but it should solve you problem quickly.

| improve this answer | |

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.