This Harry Potter hat sorted Hillary Clinton and Donald Trump into Hogwarts houses

Ryan Anderson shows off the real-life Harry Potter sorting hat he made with help from his young daughters.
Ryan Anderson shows off the real-life Harry Potter sorting hat he made with help from his young daughters. Screengrab, YouTube

Ryan Anderson, a solutions architect for IBM Watson, scored some serious dad points when he made his two grade-school daughters a real-life Harry Potter sorting hat.

Like in the books and movies, the hat magically assigns the “wearer” to one of the four houses at Hogwarts that best matches his or her character traits.

“I was thinking of fun projects and, coincidentally, I have a couple daughters and they are mad keen on ‘Harry Potter’ — they’ve read the books like five times,” Anderson, who lives in the San Francisco area, told TechInsider.

The hat works just like it did when Daniel Radcliffe, aka Harry Potter, used it in the movie: Someone can put it on or, with Anderson’s hat, just talk to it.

Anderson’s hat uses Watson’s Natural Language Classifier, and Speech to Text, to interpret the “intent” behind a given set of text.

With help from his daughters, he associated key words with each of the four Hogwarts houses by “setting a ground truth,” explains The Science Explorer.

For instance, Anderson coded “honesty” as a characteristic of Hufflepuff. So if someone describes themselves as honest, or uses a similar word, the sorting hat would “place” them in Hufflepuff.

In a blog post about the project, Anderson said the hat can differentiate “between a ‘Brave Gryffindor, Brainy Ravenclaw, Loyal Hufflepuff, and Nasty Slytherin.’”

Harry Potter was assigned to Gryffindor.

Anderson tested out the hat’s software program on a handful of famous people, including presidential candidates Hillary Clinton and Donald Trump, inputting information from their Wikipedia pages.

With 92 percent certainty, the hat placed Clinton into Ravenclaw, for “witty and clever” students, according to The Daily Mail.

The hat was less certain about what to do with Trump, assigning him to Gryffindor for the “brave and bold” with 48 percent certainty.

It was more clear about Stephen Hawking, sorting the theoretical physicist into “brainy” Ravenclaw with 97 percent certainty.

This isn’t the first time the presidential candidates have been linked to Harry Potter. Twitter cast Ted Cruz and Bernie Sanders in roles earlier this year.

Anderson brought his sorting hat to life with animatronics, giving it a voice, moving mouth and color-changing LED eyes.

“I may, time permitting, for next Halloween give it more personality and make it more dynamic,” he told Tech Insider.