Optimal data driven resource allocation under multi-armed bandit observations