  This study presents machine learning models that forecast and categorize lost
circulation severity preemptively using a large class imbalanced drilling
dataset. We demonstrate reproducible core techniques involved in tackling a
large drilling engineering challenge utilizing easily interpretable machine
learning approaches.
  We utilized a 65,000+ records data with class imbalance problem from Azadegan
oilfield formations in Iran. Eleven of the dataset's seventeen parameters are
chosen to be used in the classification of five lost circulation events. To
generate classification models, we used six basic machine learning algorithms
and four ensemble learning methods. Linear Discriminant Analysis (LDA),
Logistic Regression (LR), Support Vector Machines (SVM), Classification and
Regression Trees (CART), k-Nearest Neighbors (KNN), and Gaussian Naive Bayes
(GNB) are the six fundamental techniques. We also used bagging and boosting
ensemble learning techniques in the investigation of solutions for improved
predicting performance. The performance of these algorithms is measured using
four metrics: accuracy, precision, recall, and F1-score. The F1-score weighted
to represent the data imbalance is chosen as the preferred evaluation
criterion.
  The CART model was found to be the best in class for identifying drilling
fluid circulation loss events with an average weighted F1-score of 0.9904 and
standard deviation of 0.0015. Upon application of ensemble learning techniques,
a Random Forest ensemble of decision trees showed the best predictive
performance. It identified and classified lost circulation events with a
perfect weighted F1-score of 1.0. Using Permutation Feature Importance (PFI),
the measured depth was found to be the most influential factor in accurately
recognizing lost circulation events while drilling.
