] # Apply the PseudoLabeler class to each model model_factory = map(pseudo_label_wrapper, model_factory) # Train each model with different sample rates results = {} num_folds = 5 for model in model_factory: model_name = model.get_model_name() print('%s' % model_name) results[model_name] = list() for sample_rate in sample_rates: model.sample_rate = sample_rate # Calculate the CV-3 R2 score and store it scores = cross_val_score( model, X_train, y_train, cv=num_folds, scoring='neg_mean_squared_error') # n_jobs = 4 results[model_name].append(np.sqrt(scores.mean() * -1)) #Plot the diff between the XGB and Pseudo at sampleRate vs RSME plt.figure(figsize=(16, 18)) i = 1 for model_name, performance in results.items():