Oil Flow Predictor (Barrels Per Day) Using Machine Learning Algorithms – Random Forest and Gradient Boosting Machine. Executives in the Oil & Gas industry are always seeking ways to optimize the production of oil and gas wells and make informed decisions about drilling and exploration. Machine learning can be used to effectively resolve this optimization problem, but would usually involve extensive or complex coding that the typical executive or non-technical staff would not be able to undertake. For example, the code behind this simple Gradio bot does thinngs the typical oil executive knows nothing about in that it loads the data from a CSV file and performs data scaling, PCA dimensionality reduction, DBSCAN clustering, and random forest regression and gradient boosting regression for predicting output variables related to oil and gas production rates – not something the typical executive or non-technical Oil & Gas staff can manage. The analysis was used to gain insights into the factors that affect oil and gas production rates and to predict production rates based on the input variables. Executives are then able to use this knowledge to improve the efficiency of their operations. This Gradio chatbot reads in a CSV file containing well rate data, performs some preprocessing on the data, and then trains and evaluates two regression models, a Random Forest (RF) and a Gradient Boosting Machine (GBM), on the preprocessed data. The input data is preprocessed using Principal Component Analysis (PCA) to reduce the dimensionality of the input features, and then the DBSCAN clustering algorithm is applied to the PCA-transformed data to filter out outlier data points. The remaining data points are used for training and testing the regression models. The RF and GBM models are both trained using the preprocessed input features and corresponding well rates, and their performance is evaluated using the R-squared metric. Finally, the predicted well rates from the RF and GBM models are plotted against the actual well rates for visualization. For example, the following inputs are required for predicting the oil flow rate (Qoil) based on input features (BHP, WHP, WHT, Tsep, Psep, and Choke_in): • BHP: Bottom Hole Pressure • WHP: Well Head Pressure • WHT: Well Head Temperature • Tsep: Separator Temperature • Psep: Separator Pressure • Choke_in: Choke Size These features (BHP, WHP, WHT, Tsep, Psep, and Choke_in) are used as inputs to the machine learning models that were trained in the notebook to predict the oil flow rate (Qoil). We suspect and propose that the same input features (BHP, WHP, WHT, Tsep, Psep, and Choke_in) are provided to the trained model which would then be enabled to predict Qoil or the oil flow rate (number of barrels per day) via the Gradio input interface. The oil executive is able to learn this without having to know machine learning or the complexities of training the model himself.