문제

I have an anomaly detection model, that I run per store with a bunch of features. I intend to run this code, everyday, per store. Now, lets say I have 8000 stores, I would imagine, I should write a for loop and iterate and create the model per store:

final is the dataframe that consists of all the stores

Something like:

for store in final['StoreNbr'].unique():
   run the model. 

My input features include: Store number, Cashier, etcc (many other features). Can I use one hot encoding for the StoreNbr column and then run the model once as opposed to a for loop and running the model per storenbr?

도움이 되었습니까?

해결책

If you want to train the data each day and have a new model per store and per day, you should not use One Hot Encoding. If you do One Hot Encoding you will get one single trained model which will learn from the data you have in all the stores. I suppose you do not want one trained model but one model for each store.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 datascience.stackexchange
scroll top