Function to generate polynomial features from some