Indeed, it may end up as a negative-margin business: If history is any guide, some companies will be willing to sell at a loss to gain market share, and there will be investors willing to finance them, at least for a while.
Pattern-based analytics can reveal deep insight into what customers are buying, and leverages that to offer and guide customers to the best choices based on availability and product margin.