Due to their flexibility and predictive performance, machine-learning basedregression methods have become an important tool for predictive modeling andforecasting. However, most methods focus on estimating the conditional mean orspecific quantiles of the target quantity and do not provide the fullconditional distribution, which contains uncertainty information that might becrucial for decision making. In this article, we provide a general solution bytransforming a conditional distribution estimation problem into a constrainedmulti-class classification problem, in which tools such as deep neuralnetworks. We propose a novel joint binary cross-entropy loss function toaccomplish this goal. We demonstrate its performance in various simulationstudies comparing to state-of-the-art competing methods. Additionally, ourmethod shows improved accuracy in a probabilistic solar energy forecastingproblem.