Modified the predict and predic_proba function to hanlde sparse input