Q-matrix optimization for cognitive diagnostic assessment