Develop a ML algorithm to determine when the stock gets finished usually and when restock is required.