Find how you can use AI automate engineering processes in your organization.
There are two ways in which you can use the functionality:
This is a snippet of the functionality’s code from the VIKTOR GitHub repository.
1@SVGAndDataView("ML prediction plot", duration_guess=3) 2def visualize_prediction(self, params, **kwargs): 3 """ 4 Plot predictions of the penetration speed next to the CPT data (qc and fs) 5 """ 6 data_dict = params.section_2.gef_data 7 diameter = params.section_2.diameter 8 model_option = params.section_3.model_option 9 10 # Predict penetration speed with ML model 11 predictions, elevation_df = ML_processing.ML_prediction( 12 data_dict, 13 diameter, 14 model_option 15 ) 16 17 # Plot ML prediction and CPT data 18 fig, axs = plt.subplots(1, 3, sharey=True, figsize=(7, 6)) 19 axs = axs.flatten() 20 21 fig.suptitle('Pile diameter: '+str(diameter)+r' m') 22 axs[0].plot(predictions, elevation_df, color='black', lw=2) 23 axs[0].set_xlim([0, 1.5 * max(predictions)]) 24 axs[0].set_ylabel('Elevation (from mudline) [m]', fontsize=12) 25 axs[0].set_xlabel('Penetration speed [m/s]', fontsize=12) 26 axs[0].grid() 27 28 ... 29 30 plt.tight_layout() 31 32 # Save fig 33 svg_data = StringIO() 34 fig.savefig(svg_data, format='svg') 35 plt.close() 36 37... 38 39 return SVGAndDataResult(svg_data, ...)
The code snippet reveals how the pile drive prediction is visualized (partially). The input variables needed for the prediction, which is the cpt data (data_dict
), the pile diameter (diameter
) and the machine learning model name (model_option
), are fed into the machine learning function to calculate the predicted speed for all depths of the elevations given by the GEF file.
The results that were calculated are subsequently plotted using Matplotlib’s library, and visualized within the VIKTOR environment using the SVGAndDataResult
object. The full code can be found in the repository.
In the video, you can see how pile drive speed is predicted using one of the Machine Learning models in a VIKTOR application.
As you can see in the video, the process of predicting pile drive speed with the Machine Learning model consists of 3 steps.
app/gef/gef_files
for testing purposes.Use our free version to start using this app!