It’s fair to say pundits did not expect Donald Trump to win the presidency. Even after polls began to close Tuesday, Hillary Clinton remained the favorite. FiveThirtyEight gave Trump a 31 percent chance of winning, one of the highest chances given by any outlet.

But there is one source that correctly predicted a Trump win weeks in advance. On October 28, MogAI revealed that it foresaw a Trump victory after analyzing over 20 million data points, covering the likes of Facebook, Twitter, YouTube, and Google. This includes engagement stats, like how many people are watching Facebook Live videos.

“If Trump loses, it will defy the data trend for the first time in the last 12 years since Internet engagement began in full earnest,” Sanjiv Rai, founder of Genic.ai and creator of MogIA, said in a report last month.

The system could prove an effective way of gauging popular opinion, beyond the phone and online polls that struggled to accurately identify a Trump win. MogIA will also adapt to varying environments as time goes on.

“While most algorithms suffer from programmers/developer’s biases, MoglA aims at learning from her environment, developing her own rules at the policy layer and develop expert systems without discarding any data,” said Rai.

But it’s not the only system that predicted a Trump win. His campaign’s own data team, noticing a tightening in the polls, was able to predict most of the states correctly. The discrepancy came from how different teams treated “likely voters,” with Cambridge Analytica finding that disenfranchised rural voters played a major part in Trump’s victory.

MogAI has been running since 2004, but the system’s prediction this election cycle will likely increase interest in alternative methods of judging opinion. Trump’s unique campaign, which featured a large amount of negative content engagement, proved a litmus test for the system’s effectiveness during the Republican primary.

“If you look at the primaries, in the primaries, there were immense amounts of negative conversations that happen with regards to Trump,” said Rai. “However, when these conversations started picking up pace, in the final days, it meant a huge game opening for Trump and he won the primaries with a good margin.”

Photos via Getty Images / Ron Jenkins, Getty Images / Chip Somodevilla