code: def create_figures(extension="pdf", directory="../../tex/figures"):
      if extension[0] != ".":
          extension = "." + extension
  
      dpi = 90
  
      # data and linear decision boundary
      features, vectors, labels = features_from_file(
          "data/small_gc_toy.data"
      )
  
      kernel = create_kernel("linear", features)
      svm = svm_train(kernel, labels, 0.7)
  
      pylab.figure(figsize=(8, 6), dpi=dpi)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          title="Linear Separation",
          customwandb=(numpy.array([-0.05, -1.0]), -0.3),
          ylabel="GC Content Before 'AG'",
          xlabel="GC Content After 'AG'",
          show=False,
          showColorbar=showColorbar,
          decisionboundaryonly=True,
      )
      add_percent_ticks()
  
      pylab.savefig(
          os.path.join(
              directory, "data_and_linear_classifier" + extension
          )
      )
      pylab.close()
      #####################################################################################
      # data and svm decision boundary
      features, vectors, labels = features_from_file(
          "data/small_gc_toy.data"
      )
  
      kernel = create_kernel("linear", features)
      svm = svm_train(kernel, labels, 100)
  
      pylab.figure(figsize=(8, 6), dpi=dpi)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          title="Maximum Margin Separation",
          drawarrow=True,
          ylabel="GC Content Before 'AG'",
          xlabel="GC Content After 'AG'",
          show=False,
          showColorbar=showColorbar,
      )
      add_percent_ticks()
  
      pylab.savefig(
          os.path.join(directory, "data_and_svm_classifier" + extension)
      )
      pylab.close()
      #####################################################################################
  
      # the effect of C on the decision surface:
      features, vectors, labels = features_from_file(
          "data/small_gc_toy_outlier.data"
      )
  
      pylab.figure(figsize=(16, 6), dpi=dpi)
      pylab.subplot(121)
      kernel = create_kernel("linear", features)
      svm = svm_train(kernel, labels, 200)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          title="Soft-Margin with C=200",
          ylabel="GC Content Before 'AG'",
          xlabel="GC Content After 'AG'",
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          show=False,
          showmovedpoint=True,
          showColorbar=showColorbar,
      )
      add_percent_ticks()
  
      pylab.subplot(122)
      kernel = create_kernel("linear", features)
      svm = svm_train(kernel, labels, 2)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          title="Soft-Margin with C=2",
          ylabel="GC Content Before 'AG'",
          xlabel="GC Content After 'AG'",
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          show=False,
          showColorbar=showColorbar,
      )
      add_percent_ticks()
      # pylab.subplots_adjust(bottom=0.05, top=0.95)
  
      pylab.savefig(os.path.join(directory, "effect_of_c" + extension))
      pylab.close()
      ####################################################################################
  
      # playing with nonlinear data:
      # the effect of kernel parameters
  
      features, vectors, labels = features_from_file(
          "data/small_gc_toy_outlier.data"
      )
      pylab.figure(figsize=(24, 6), dpi=dpi)
      pylab.subplot(131)
      kernel = create_kernel("linear", features)
      svm = svm_train(kernel, labels, 100)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          title="Linear Kernel",
          ylabel="GC Content Before 'AG'",
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          show=False,
          showColorbar=showColorbar,
      )
      add_percent_ticks()
  
      pylab.subplot(132)
      kernel = create_kernel("poly", features, 2)
      svm = svm_train(kernel, labels, 100)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          title="Polynomial Kernel d=2",
          xlabel="GC Content After 'AG'",
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          show=False,
          showColorbar=showColorbar,
      )
      add_percent_ticks()
  
      pylab.subplot(133)
      kernel = create_kernel("poly", features, 5)
      svm = svm_train(kernel, labels, 10)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          title="Polynomial Kernel d=5",
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          show=False,
          showColorbar=showColorbar,
      )
      add_percent_ticks()
      # pylab.subplots_adjust(bottom=0.05, top=0.95)
  
      pylab.savefig(
          os.path.join(directory, "params_polynomial" + extension)
      )
      pylab.close()
      ####################################################################################
  
      # effects of sigma
      pylab.figure(figsize=(24, 6), dpi=dpi)
      pylab.subplot(131)
      gamma = 0.1
      sigma = 20.0
      kernel = create_kernel("gauss", features, sigma)
      svm = svm_train(kernel, labels, 100)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          title="Gaussian Kernel Sigma=20",
          ylabel="GC Content Before 'AG'",
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          show=False,
          showColorbar=showColorbar,
      )
      add_percent_ticks()
  
      pylab.subplot(132)
      sigma = 1.0
      kernel = create_kernel("gauss", features, sigma)
      svm = svm_train(kernel, labels, 100)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          title="Gaussian Kernel Sigma=1",
          xlabel="GC Content After 'AG'",
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          show=False,
          showColorbar=showColorbar,
      )
      add_percent_ticks()
  
      pylab.subplot(133)
      sigma = 0.05
      kernel = create_kernel("gauss", features, sigma)
      svm = svm_train(kernel, labels, 100)
      decision_boundary_plot(
          svm,
          features,
          vectors,
          labels,
          kernel,
          title="Gaussian Kernel Sigma=0.05",
          fontsize=fontsize,
          contourFontsize=contourFontsize,
          show=False,
          showColorbar=showColorbar,
      )
      add_percent_ticks()
  
      # pylab.subplots_adjust(bottom=0.05, top=0.95)
  
      pylab.savefig(
          os.path.join(directory, "params_gaussian" + extension)
      )
      pylab.close()
  
file_path: shogun/applications/easysvm/tutpaper/svm_params.py
imports: import sys, os
  import numpy
  import shogun
  from shogun import GaussianKernel, LinearKernel, PolyKernel
  from shogun import RealFeatures, BinaryLabels
  from shogun import LibSVM
  from numpy import arange
  import matplotlib
  from matplotlib import pylab
label_desc: Use image node_id 7 for calling a global function with example usage: create_figures(extension, directory) without return types