def _convert_feature_to_featurebase(
    feature: LiteFeature,
    dataframe: pd.DataFrame,
    cache: FeatureCache,
) -> FeatureBase:
    """
    Recursively transforms a LiteFeature object into a Featurebase object

    Args:
        feature (LiteFeature)
        base_features (List[FeatureBase])
        cache (FeatureCache) already converted features

    Returns:
       FeatureBase
    """

    def get_base_features(
        feature: LiteFeature,
    ) -> List[FeatureBase]:
        new_base_features: List[FeatureBase] = []
        for bf in feature.base_features:
            fb = rfunc(bf)
            if bf.is_multioutput():
                idx = bf.idx
                # if its multioutput, you can index on the FeatureBase
                new_base_features.append(fb[idx])
            else:
                new_base_features.append(fb)

        return new_base_features

    def rfunc(feature: LiteFeature) -> FeatureBase:
        # if feature has already been converted, return from cache
        if feature.id in cache:
            return cache[feature.id]

        # if depth is 0, we are at an origin feature
        if feature.depth == 0:
            fb = IdentityFeature(dataframe.ww[feature.name])
            cache[feature.id] = fb
            return fb

        base_features = get_base_features(feature)

        fb = _feature_to_transform_feature(feature, base_features)
        cache[feature.id] = fb
        return fb

    return rfunc(feature)

    Recursively transforms a LiteFeature object into a Featurebase object

    Args:
        feature (LiteFeature)
        base_features (List[FeatureBase])
        cache (FeatureCache) already converted features

    Returns:
       FeatureBase
    
featuretools/feature_discovery/convertors.py