Interpretable two-step prediction method and its application to agricultural and medical data