Details
Description
According to the reference of python, os.removedirs doesn't work if there are any files in the directory we want to remove.
https://docs.python.org/3/library/os.html#os.removedirs
Instead of that, using shutil.rmtree() would be better to remove a temporary directory to test for saving model.
https://github.com/apache/spark/blob/branch-1.4/python%2Fpyspark%2Fmllib%2Fregression.py#L137