Turns out the np.array was there for a reason (but not a good one)
"source": [
"# Definition of the train and test patch IDs, take 80 % for train\n",
"test_ID = [0, 8, 16, 19, 20]\n",
+ "test_eopatches = [sampled_eopatches[i] for i in test_ID]\n",
"train_ID = [i for i in range(len(patchIDs)) if i not in test_ID]\n",
+ "train_eopatches = [sampled_eopatches[i] for i in train_ID]\n",
"\n",
"# Set the features and the labels for train and test sets\n",
- "features_train = np.array([eopatch.data['FEATURES_SAMPLED'] for eopatch in sampled_eopatches[train_ID]])\n",
- "labels_train = np.array([eopatch.mask_timeless['LULC_ERODED_SAMPLED'] for eopatch in sampled_eopatches[train_ID]])\n",
+ "features_train = np.array([eopatch.data['FEATURES_SAMPLED'] for eopatch in train_eopatches])\n",
+ "labels_train = np.array([eopatch.mask_timeless['LULC_ERODED_SAMPLED'] for eopatch in train_eopatches])\n",
"\n",
- "features_test = np.array([eopatch.data['FEATURES_SAMPLED'] for eopatch in sampled_eopatches[test_ID]])\n",
- "labels_test = np.array([eopatch.mask_timeless['LULC_ERODED_SAMPLED'] for eopatch in sampled_eopatches[test_ID]])\n",
+ "features_test = np.array([eopatch.data['FEATURES_SAMPLED'] for eopatch in test_eopatches])\n",
+ "labels_test = np.array([eopatch.mask_timeless['LULC_ERODED_SAMPLED'] for eopatch in test_eopatches])\n",
"\n",
"# Get shape\n",
"p1, t, w, h, f = features_train.shape\n",
