A discrepancy principle for the Landweber iteration based on risk minimization