Learning preferences from choices and rankings