(X, y)
return X[y_pred == 1], y[y_pred == 1]
This will be our function used to resample our dataset.
This will be our function used to resample our dataset.
This will be our function used to resample our dataset .
def outlier_rejection(X, y):
    """This will be our function used to resample our dataset."""
    model = IsolationForest(max_samples=100, contamination=0.4, random_state=rng)
    model.fit(X)
    y_pred = model.predict(X)
    return X[y_pred == 1], y[y_pred == 1]
def outlier_rejection ( X , y ) : model = IsolationForest ( max_samples = 100 , contamination = 0.4 , random_state = rng ) model . fit ( X ) y_pred = model . predict ( X ) return X [ y_pred == 1 ] , y [ y_pred == 1 ]