private double[] getFeatureVector(Instance inputInstance) {

        if (convertNomToBin && nomToBinFilter != null) {
            try {
                nomToBinFilter.input(inputInstance);
                inputInstance = nomToBinFilter.output();
                inputInstance.setDataset(null);
            } catch (Exception ex) {
                throw new InvalidDataException("The input instance for prediction is invalid. " +
                        "Instance is not consistent with the data the model was built for.");
            }
        }

        // check if number in attributes is at least equal to model input
        int numAttributes = inputInstance.numAttributes();
        int modelInputDim = perceptrons.get(0).getWeights().length - 1;
        if (numAttributes < modelInputDim) {
            throw new InvalidDataException("Input instance do not have enough attributes " +
                    "to be processed by the model. Instance is not consistent with the data the model was built for.");
        }

        // if instance has more attributes than model input, we assume that true outputs
        // are there, so we remove them
        List<Integer> labelIndices = new ArrayList<Integer>();
        boolean labelsAreThere = false;
        if (numAttributes > modelInputDim) {
            for (int index : this.labelIndices) {
                labelIndices.add(index);
            }

            labelsAreThere = true;
        }

        double[] inputPattern = new double[modelInputDim];
        int indexCounter = 0;
        for (int attrIndex = 0; attrIndex < numAttributes; attrIndex++) {
            if (labelsAreThere && labelIndices.contains(attrIndex)) {
                continue;
            }
            inputPattern[indexCounter] = inputInstance.value(attrIndex);
            indexCounter++;
        }

        return inputPattern;
    }