Trump’s algorithm is to say semi-random things until his crowd roars its approval, then he iteratively modifies those statements, seeking more and more approval, until he maxes out and tries a new tack.
This is one of the core strategies of machine-learning: random-walking to find a promising path, hill-climbing to optimize it, then de-optimizing in order to ensure that you haven’t plateaued at a local maximum (think of how an ant tries various directions to find a food source, then lays down a chemical trail that other ants reinforce as they follow it, but some will diverge randomly so that other, richer/closer food sources aren’t bypassed).
It also betrays one of the core problems with machine learning: bias in the sample-set. The people that Trump relies upon to give him his success feedback are the people who show up for Trump rallies, who are the most extreme, least-representative group of potential Trump voters. The more Trump optimizes for this limited group, the more he de-optimizes for the rest of the world.
Biased training data is a huge (ahem, yuge) problem for machine-learning. Cities that use data from racist frisking practices to determine who the police should stop end up producing algorithmic racism; court systems that use racist sentencing records to train a model that makes sentencing recommendations get algorithmic racism, too.
Trump is a salesman — he