code: def confidence_filtering_data_vs_acc_plot(
      accuracies,
      dataset_kepts,
      model_names=None,
      dotted=False,
      decimal_digits=0,
      y_label="accuracy",
      title=None,
      filename=None,
      callbacks=None,
  ):
      assert len(accuracies) == len(dataset_kepts)
  
      sns.set_style("whitegrid")
  
      colors = plt.get_cmap("tab10").colors
  
      max_dataset_kept = max(
          max(dataset_kept) for dataset_kept in dataset_kepts
      )
  
      x_ticks_minor = np.linspace(0.0, max_dataset_kept, num=21)
      x_ticks_major = np.linspace(0.0, max_dataset_kept, num=11)
      x_ticks_major_labels = [
          "{value:3.{decimal_digits}f}%".format(
              decimal_digits=decimal_digits, value=x * 100
          )
          for x in x_ticks_major
      ]
      y_ticks_minor = np.linspace(0.0, 1.0, num=21)
      y_ticks_major = np.linspace(0.0, 1.0, num=11)
  
      fig, ax = plt.subplots()
  
      if title is not None:
          ax.set_title(title)
  
      ax.grid(which="both")
      ax.grid(which="minor", alpha=0.5)
      ax.grid(which="major", alpha=0.75)
      ax.set_xticks(x_ticks_major)
      ax.set_xticks(x_ticks_minor, minor=True)
      ax.set_xticklabels(x_ticks_major_labels)
      ax.set_xlim(0, max_dataset_kept)
      ax.set_xlabel("data coverage")
  
      ax.set_ylim(0, 1)
      ax.set_yticks(y_ticks_major)
      ax.set_yticks(y_ticks_minor, minor=True)
      ax.set_ylabel(y_label)
  
      for i in range(len(accuracies)):
          curr_dotted = (
              dotted[i]
              if isinstance(dotted, (list, tuple)) and i < len(dotted)
              else dotted
          )
          algorithm_name = (
              model_names[i] + " "
              if model_names is not None and i < len(model_names)
              else ""
          )
          ax.plot(
              dataset_kepts[i],
              accuracies[i],
              label=algorithm_name,
              color=colors[i],
              linewidth=3,
              linestyle=":" if curr_dotted else "-",
          )
  
      ax.legend(frameon=True, loc=3)
      plt.tight_layout()
      visualize_callbacks(callbacks, plt.gcf())
      if filename:
          plt.savefig(filename)
      else:
          plt.show()
  
imports: import copy
  import logging
  from collections import Counter
  from sys import platform
  from typing import Dict, List
  import numpy
  import pandas
  import ptitprince
  from packaging import version
  from ludwig.constants import SPACE, TRAINING, VALIDATION
label_desc: Use image node_id 10 for calling a global function with example usage: confidence_filtering_data_vs_acc_plot(accuracies, dataset_kepts, model_names, dotted, decimal_digits, y_label, title, filename, callbacks) without return types