Code refactoring

Code refactoring train_test_stat2.py