Current methods to decontaminate bottom hole oil samples from Oil-Based Mud (OBM) poses many challenges as it requires analytical solutions. The existing analytical practices are highly subjective, as contamination results can differ depending on the approach determined by the user. The proposed method involves training a newly developed machine learning model to seek contamination patterns in an oil or gas condensate sample and highlight the contaminated samples. A python-based program that utilizes machine learning techniques to predict the concentration of OBM contamination in hydrocarbon fluids was constructed. The proposed procedure involved collecting 397 records of analyzed liquid C1 – C44 weight percent and whether they were reported as contaminated with OBM or not. The records were normalized and standardized on a column-basis, to preserve the confidentiality of the data. The model then, was trained on different algorithms, then was subjected to real cases to determine the model’s prediction accuracy. The train/test ratio was chosen to be 80/20 across different algorithms. The model was subjected to different algorithms. The algorithms were logistic regression, manual logistic regression, linear support vector machine (SVM), kernel SVM, Decision Tree, and Random Forest. The Manual Logistic Regression (MLR) algorithm resulted in an accuracy of 97%, and an F-1 Score of 94%. This shows that the MLR algorithm is the most suitable to be used in this prediction scheme. Moreover, this algorithm can be used as a quick method to get a sense of whether the fluid is contaminated or not. This illustrates the model’s significance in OBM contamination detection and making it the tool to be used in deciding the validity of a hydrocarbon sample. The current methods that are used to analytically decontaminate a fluid are based on analytical approaches, which depend on the person interpreting the results. Machine learning will resolve the issue of subjectivity in determining the contamination existence, increase the efficiency of the process, and is one step forward towards digital transformation.