Views
No views yet
(WCT/100)*0.433 + (1-(WCT/100))*0.273Fluid gradient * Depth1import pickle
2import pandas as pd
3
4# Load your test data
5test_df = pd.read_csv('your_test_data.csv') # or other source
6
7# Calculate derived features
8test_df['Fluid gradient'] = (test_df['WCT']/100)*0.433 + (1-(test_df['WCT']/100))*0.273
9test_df['Ph'] = test_df['Fluid gradient'] * test_df['Depth']
10
11# Features to scale (must match training)
12scaled_features = ['Qo', 'GOR', 'THT', 'Pwh(psi)', 'Ph', 'Depth']
13
14# Load model and scaler
15with open('modelBIGDATA5US1P57.pkl', 'rb') as file:
16 saved_data = pickle.load(file)
17 model = saved_data['model']
18 scaler = saved_data['scaler']
19
20# Make predictions
21X_test_scaled = scaler.transform(test_df[scaled_features])
22test_df['Predicted_BHP'] = model.predict(X_test_scaled)
23