We study an approach to regression that we call objective-aligned fitting, which is applicable when the regression model is used to predict uncertain parameters of some objective problem. Rather than minimizing a typical loss function, such as squared error, we approximately minimize the objective value of the resulting solutions to the nominal optimization problem. While previous work on objective-aligned fitting has tended to focus on uncertainty in the objective function, we consider the case in which the nominal optimization problem is a two-stage linear program with uncertainty in the right-hand side. We define the objective-aligned loss function for the problem and prove structural properties concerning this loss function. Since the objective-aligned loss function is generally non-convex, we develop a convex approximation. We propose a method for fitting a linear regression model to the convex approximation of the objective-aligned loss. Computational results indicate that this procedure can lead to higher-quality solutions than existing regression procedures.