Functional effects models: Accounting for preference heterogeneity in panel data with machine learning