private List<Pair<Object, Double>> getMostInfluentialFeatures(Label clazz, FeatureVector featureVector) {
        assert this.model instanceof NaiveBayesModel;
        NaiveBayesModel myModel = (NaiveBayesModel) this.model;
        List<Pair<Object, Double>> mostInfluentialFeatures = new ArrayList<>();
        for (Object feature : featureVector) {
            double classConditional = myModel.computeClassConditionalProbability(feature, clazz);
            if (useLogits)
                classConditional = -Math.log(classConditional);
            mostInfluentialFeatures.add(Pair.of(feature, classConditional));
        }
        // sort the list
        // TODO understand logits!!
        //  remove 1 counts!
        if (useLogits)
            mostInfluentialFeatures.sort(Comparator.comparing(Pair::getRight));
        else
            mostInfluentialFeatures.sort((o1, o2) -> o2.getRight().compareTo(o1.getRight()));
        return mostInfluentialFeatures.subList(0, mostInfluentialFeatures.size() <= numberOfInfluentialFeatures ? mostInfluentialFeatures.size() - 1 : numberOfInfluentialFeatures);
    }
private List<Pair<Object, Double>> getMostInfluentialFeatures(Label clazz, FeatureVector featureVector) {
        assert this.model instanceof NaiveBayesModel;
        NaiveBayesModel myModel = (NaiveBayesModel) this.model;
        List<Pair<Object, Double>> mostInfluentialFeatures = new ArrayList<>();
        for (Object feature : featureVector) {
            double classConditional = myModel.computeClassConditionalProbability(feature, clazz);
            if (useLogits)
                classConditional = -Math.log(classConditional);
            mostInfluentialFeatures.add(Pair.of(feature, classConditional));
        }
       
       
       
        if (useLogits)
            mostInfluentialFeatures.sort(Comparator.comparing(Pair::getRight));
        else
            mostInfluentialFeatures.sort((o1, o2) -> o2.getRight().compareTo(o1.getRight()));
        return mostInfluentialFeatures.subList(0, mostInfluentialFeatures.size() <= numberOfInfluentialFeatures ? mostInfluentialFeatures.size() - 1 : numberOfInfluentialFeatures);
    }
private list<pair<object, double>> getmostinfluentialfeatures(label clazz, featurevector featurevector) { assert this.model instanceof naivebayesmodel; naivebayesmodel mymodel = (naivebayesmodel) this.model; list<pair<object, double>> mostinfluentialfeatures = new arraylist<>(); for (object feature : featurevector) { double classconditional = mymodel.computeclassconditionalprobability(feature, clazz); if (uselogits) classconditional = -math.log(classconditional); mostinfluentialfeatures.add(pair.of(feature, classconditional)); } if (uselogits) mostinfluentialfeatures.sort(comparator.comparing(pair::getright)); else mostinfluentialfeatures.sort((o1, o2) -> o2.getright().compareto(o1.getright())); return mostinfluentialfeatures.sublist(0, mostinfluentialfeatures.size() <= numberofinfluentialfeatures ? mostinfluentialfeatures.size() - 1 : numberofinfluentialfeatures); }