Uncertainty is an important indicator that can provide the confidence in the predictions. However, most machine learning methods in classification problems are incapable of predicting an accurate probability that matches the observed distribution of each class. To overcome this problem and improve the uncertainty analysis in lithofacies classification, a novel calibration process is performed on the validation subset using scaling algorithms. The validation subset should be separated from the training data in order to reduce overfitting and avoid unwanted biases. Random forest is selected as the machine learning classifier owing to its relative ease of use, and can handle high-dimensional input features quite well. The proposed approach is applied to two real datasets to demonstrate the improvement in the uncertainty quantification. Reliability diagram shows that the calibrated probability is closer to the diagonal truth, compared with the uncalibrated one. In addition to the visual check, a multiclass Brier score of calibrated model is lower than that by uncalibrated system, which can be referred to as a loss function. For the classification results by calibrated and uncalibrated classifiers on the testing subset, an increase of the Matthews correlation coefficient also means that the calibrated model has a better performance.