Joe Biden’s Super Tuesday comeback surge caught most political pundits by surprise. The former vice president was virtually left for dead after losing the first three contests.

But if they had listened to “Polly” — an artificial intelligence (AI) device created by Advanced Symbolics Inc. (ASI) — they would have seen it all coming, including Biden’s shocking win over Sen. Elizabeth Warren in her home state.

Polly successfully predicted the winners in five of the seven states ASI was monitoring on Super Tuesday — California, Massachusetts, Maine, Texas, North Carolina, Minnesota and Colorado — with Texas being a tie and the non-monitored states having too large a margin of error to make a prediction, according to ASI’s chief scientist Kenton White.

Polly’s predictions that Biden would beat Sen. Bernie Sanders in two New England states — Massachusetts and Maine — ran contrary to virtually all available polling and contradicted betting market predictions that Sanders would win both.

Warren’s third-place finish left CNN’s Dana Bash shocked: “She lost to a man who never even campaigned in her state. She’s the senior senator in Massachusetts. … It’s an embarrassing defeat.” But Polly predicted it, and without using conventional polling.

How?

“The secret sauce behind Polly is that we create very rigorous representative samples of people from online sources,” White told InsideSources. “This is from places like Twitter, Facebook and Reddit. We can create samples at a scale that is hundreds of thousands [of people].

“How Polly makes her forecast, is that when we collect the samples we also know what these people have posted in the past five years or so,” White said. “We know how past elections went down, we know how people in the sample were talking in the past primaries and how those primaries played out in various states. And from that we can learn how to interpret what people are saying and apply it to the primaries.”

And Polly really scored when it came to Warren’s home state, predicting Biden’s win in Massachusetts over Sanders and Warren weeks ago. “Her” sample in the Bay State was 10,000, White said.

“Polly also considered the impact of [Pete] Buttigieg and [Sen. Amy] Klobuchar’s endorsement of Biden and accurately accounted for the endorsement in Super Tuesday states,” White said. “In the end, she saw Biden’s rise in Massachusetts before his victory in South Carolina and the following endorsements.”

Polly’s record of predictions is impressive, if mixed. She got Sanders and Buttigieg just about right in the New Hampshire primary and nailed Sanders’ big lead in Nevada — though she missed the rest of the field. (Biden got 20 percent and finished second in the Silver State, though Polly predicted he would finish fifth.) Polly also correctly predicted the Brexit vote in the U.K.,  the 2016 U.S. elections and the 2019 Federal Election in Canada.

Meanwhile, oddsmakers got Super Tuesday all wrong. Since political betting is prohibited in the United States, much of the data comes from British oddsmakers. A group called Oddschecker had Sanders sweeping most Super Tuesday states — before the primaries.

“Super Tuesday produced the latest surprise in the Democratic primaries as Joe Biden hugely outperformed expectations to secure eight states, a figure that could rise to nine with Maine still too close to call at the time of writing,” Oddschecker’s spokesman Pete Watt told InsideSources, before the former VP’s win in the Pine Tree State was announced. “Just one week ago, Bernie Sanders was the favorite to win every single state apart from Alabama, according to Oddschecker data.

However, the weekend saw the former VP win convincingly in South Carolina and this was followed by the decision of a trio of moderate candidates to drop out and coalesce around him,” Watt said. “As a result, Mr. Biden was made favorite in Arkansas, North Carolina, Oklahoma, Tennessee and Virginia as bookmakers sought to take evasive action and minimize their losses in the event of an overall Biden victory.”

While academics debate the accuracy of predictive markets and political betting, a spokesman for PredictIt, a major player in the industry, told the Washington Post that his site’s handicappers are correct 70 to 80 percent of the time. And there’s some evidence that betting markets are more accurate than polling.

“However, even they failed to predict just how well Biden would do on the day, with one of the biggest shocks coming in Massachusetts as Biden won what had been deemed a two-horse race between Sanders and his progressive rival Elizabeth Warren,” Watt said.