public static Integer findTargetIndex(MiningSchema miningSchema) {
    List<MiningField> miningFields = miningSchema.getMiningFields();
    for (int i = 0; i < miningFields.size(); i++) {
      if (miningFields.get(i).getUsageType() == MiningField.UsageType.PREDICTED) {
        return i;
      }
    }
    return null;
  }
public static Integer findTargetIndex ( MiningSchema miningSchema ) { List < MiningField > miningFields = miningSchema . getMiningFields ( ) ; for ( int i = 0 ; i < miningFields . size ( ) ; i ++ ) { if ( miningFields . get ( i ) . getUsageType ( ) == MiningField . UsageType . PREDICTED ) { return i ; } } return null ; }
@param miningSchema {@link MiningSchema} from a model
@return index of the {@link MiningField.UsageType#PREDICTED} feature