e = np.reshape(m, (-1, 1))
// These lists are assembled separately in case any custom features have the
// same name as an MLTSP feature, in which case we use the custom features
obs_feature_lists = {}
science_feature_lists = {}
custom_feature_lists = {}
for i in range(m.shape[1]): // featurize each channel
obs_features = oft.generate_obs_features(t, m[:,i], e[:,i], features_to_use)
science_features = sft.generate_science_features(t, m[:,i], e[:,i],
features_to_use)
if custom_script_path:
custom_features = cft.generate_custom_features(custom_script_path,
t, m[:,i], e[:,i], features_already_known=dict(
list(obs_features.items()) + list(science_features.items()) +
list(meta_features.items())))
custom_features = {key: custom_features[key] for key in
custom_features.keys() if key in features_to_use}
else:
custom_features = {}
for feature, value in obs_features.items():
obs_feature_lists.get(feature, []).append(value)
for feature, value in science_features.items():
science_feature_lists.get(feature, []).append(value)
for feature, value in custom_features.items():
custom_feature_lists.get(feature, []).append(value)
all_feature_lists = obs_feature_lists
all_feature_lists.update(science_feature_lists)
all_feature_lists.update(custom_feature_lists)
return all_feature_lists
def assemble_featureset(feature_dicts, targets=None, metadata=None, names=None):