We introduce a new type of shrinkage estimator that is not based on asymptotic optimality, but instead learns a state-dependent shrinkage policy via supervised learning in a contextual bandit setup. The proposed estimator applies to both linear and nonlinear shrinkage and shows improved performance compared to classical shrinkage estimators. Our results demonstrate that our estimator identifies a downward bias in classical shrinkage intensity estimates derived under the i.i.d. assumption and automatically corrects for it in response to prevailing market conditions. Additionally, our data-driven approach enables more efficient implementation of risk-optimized portfolios and is well-suited for real-world investment applications, including portfolios with practical optimization constraints.