def feature_selected_dataset(dataset, selected_feature_names, output_is_tuple=False, num_parallel_calls=None):
    """Create a `Dataset` by selecting features from an existed `Dataset`.
        Arguments:
            dataset: A `dict` structured `Dataset`.
            selected_feature_names: A sequence of `str`, selected feature names.
            output_is_tuple: A `bool`, if true, return a `tuple` structured `Dataset`,
                or else, a `dict` structured one.
            num_parallel_calls: See `tf.data.Dataset.map`.
        Returns:
            A `Dataset`.
    """
    def map_fn(features):
        if output_is_tuple:
            return tuple(map(
                lambda k: features[k],
                selected_feature_names))
        return dict(map(
            lambda k: (k, features[k]),
            selected_feature_names))

    return dataset.map(map_fn, num_parallel_calls=num_parallel_calls)