A Feature-based Generalizable Prediction Model for Both Perceptual and Abstract Reasoning