The estimation of orientation distribution functions (ODFs) from diffusion MRI data is an important step in diffusion tractography, but existing estimation methods often depend on signal modeling assumptions that are violated by real data, lack theoretical characterization, and/or are only applicable to a small range of q-space sampling patterns. As a result, existing ODF estimation methods may be suboptimal. In this work, we propose a novel ODF estimation approach that learns a linear ODF estimator from training data. The training set contains ideal data samples paired with corresponding ideal ODFs, and the learning procedure reduces to a simple linear least-squares problem. This approach can accommodate arbitrary q-space sampling schemes, can be characterized theoretically, and is theoretically demonstrated to generalize far beyond the training set. The proposed approach is evaluated with simulated and in vivo diffusion data, where it is demonstrated to outperform common alternatives.