Portfolio optimization using classification and functional data analysis techniques