Machine learning may someday allow physicians to prescribe the best treatment for dementia, according to a study.