Generating variables to be named, filled in and operated on the fly in Python
Just a little something to clean up the code.

The lines inside your for loop e.g

open_cost_mat_train = np.append(open_cost_mat_train,i)


do not require an assignment on the left, np.append modifies the array being passed in. I'm not sure if that's what you want, but maybe you should inspect the arrays after the loop to ensure they contain what you expect.

If you're worried about modifying arrays by mistake or require a original copy, it may be worth cloning them before running any operations on them. 

copy_array = original_array.copy() will clone a numpy array. 

Another way to verify you're passing the right parameters could be to check their names. They seem to be labelled logically with a number at the end, so it seems closed_cost_mat_train_2 should always go with closed_cost_category_path_2. See here, the inspect module looks like a good choice for this.

Docs for the numpy functions:

[1] numpy.append 

[2] numpy.copy