MEMORY AND BELIEFS IN FINANCIAL MARKETS: A MACHINE LEARNING APPROACH