A General Approach to Some Screening and Classification Problems