from cuml.dask.ensemble import RandomForestClassifier as cuRF_mg # cuml Random Forest params cu_rf_params = { ‘n_estimators’: 25, ‘max_depth’: 13, ‘n_bins’: 15, ‘n_streams’: 8 } # Start by setting up the CUDA cluster on the local host cluster = LocalCUDACluster(threads_per_worker=1, n_workers=n_workers) c = Client(cluster) workers = c.has_what().keys() # Shard the data across all workers X_train_df, y_train_df = dask_utils.persist_across_workers(c,[X_train_df,y_train_df],workers=workers) # Build and train the model cu_rf_mg = cuRFC_mg(**cu_rf_params) cu_rf_mg.fit(X_train_df, y_train_df) # Check the accuracy on a test set cu_rf_mg_predict = cu_rf_mg.predict(X_test) acc_score = accuracy_score(cu_rf_mg_predict, y_test, normalize=True) c.close() cluster.close()