I am using SubsetFeatures_ga to create a random dataset within a file geodatabase and am trying to save the output feature class in a feature dataset but it keeps getting saved in the root of the file geodatabase. I have ArcMap 10.3.1 installed and am using Python 2.7 to run the code. I have already read this post which simulates the same problem but it was apparently solved by ESRI at ArcMap 10.1.
Here is the code:
import sys, string, os, arcpy
from arcpy import env
env.workspace = "J:/data/database/test.gdb/polygons/"
arcpy.CheckOutExtension("GeoStats")
in_features = "polys"
out_training_feature_class = "polys_train"
out_test_feature_class = ""
size_of_training_dataset = "10"
subset_size_units = "PERCENTAGE_OF_INPUT"
arcpy.SubsetFeatures_ga(in_features,out_training_feature_class,out_test_feature_class,size_of_training_dataset,subset_size_units)
Here is an image of the database structure:
And this is what it looks like after I run my script (you can see how 'polys_train' is output into the root of test.gdb)