How to Solve NameError: name 'RandomUnderSampler' is not defined -- imblearn

Solution: Import the 'RandomUnderSampler' module

To Solve the error, add the following line to the top of your code.

from imblearn.under_sampling import RandomUnderSampler

 

For more information:
Python imblearn RandomUnderSampler