An artificial intelligence (AI) system that accurately predicted the outcomes of the last three US presidential elections has put Republican candidate Donald Trump ahead of Democratic rival Hillary Clinton in the race for the White House. The AI system called MogIA was created in 2004 by Sanjiv Rai, founder of Indian startup Genic.ai.

After taking in 20 million data points from public platforms including Google, Facebook, Twitter and YouTube, the AI system then analyzed the information to generate predictions. The system also takes data such as engagement with tweets and Facebook Live videos into account as well.

Rai said MogIA is based on Mowgli, the young "man cub" from Rudyard Kipling's novel "The Jungle Book," since his AI system also learns from the environment.

Having already correctly predicted the winners of the Democratic and Republican primaries, the system found that people are 25% more engaged with Trump than they were with Barack Obama at his peak in 2008 - the year he was elected president.

"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," Rai told CNBC.

Most national polls, on the other hand, put Clinton far ahead of her Republican opponent. Real Clear Politics' latest major poll averages gives Clinton 5.2 point lead ahead of Trump.

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

However, Rai did admit that the AI system did have its limitations since the sentiment around social media posts are difficult for the machine to analyse. For example, a person engaging with Donald Trump on Twitter does not necessarily mean they will vote for him. He also added that there are currently far more people on social media than there were in the previous elections.

Rai said his system could be improved by analysing more granular data to track overall engagement more precisely and "determine progressively lesser bias despite the weightage of negative or positive conversations."

"In the primaries, there were immense amounts of negative conversations that happened with regards to Trump," Rai said. "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."

In September, Professor Allan Lichtman, who correctly predicted the winner of every presidential election since 1984, told The Washington Post that Trump is most likely to win based on a system of true/false statement that he calls "Keys to the White House."

Last week, Clinton warned voters against complacency and told them to pay no attention to the polls. "No complacency here," Clinton said at a rally in Tampa, Florida. "Nobody flagging. We've got to get everybody out to vote.

"I feel good. But I am really determined that nobody is going to rest or stop or in any way think this election is over before it's actually over," she said.