class_docstr: Elastic Ensemble post processor.
  
  Parameters
  ----------
  results_path: str
      path to folder storing the results to be read into the ensemble
  dataset_name: str
      the name of the dataset that this ensemble will post process results for
  distance_measures: 'all' or list of Strings, default 'all'
      'all' sets classifier to use all default constituent classifiers, else a list is
      provided of classifiers to include. Note these names must match the names of the
      subdirs in the folder located at results_parh
  resample_id: int, default = 0
      to identify the deterministic seed used for resampling experiments. A
      resampled_id of 0 demonstrates default train/test split were used to create
      results
  alpha: float or double, default=1.0.
      Used to exponentiate the confidence of constituent classifiers when making
      test predictions
docstr: Write the results to file.
  
  Probably could be replaced with data_io.write_results_UEA
  
  Parameters
  ----------
  output_results_path : str
      path to where output results will be written
  output_classifier_name : str
      the name of the composite ensemble classifier in the output files
  write_train : boolean
      true will write train files for the ensemble, false will skip training files
  write_test : boolean
      true will write test files for the ensemble, false will skip test files
  overwrite: boolean
      if true, any existing train/test files will be over-written. False
      prevents file overwriting
docstr_tok: ["Write","the","results","to","file",".","Probably","could","be","replaced","with","data_io.write_results_UEA","Parameters","--","--","--","--","--","output_results_path",":","str","path","to","where","output","results","will","be","written","output_classifier_name",":","str","the","name","of","the","composite","ensemble","classifier","in","the","output","files","write_train",":","boolean","true","will","write","train","files","for","the","ensemble",",","false","will","skip","training","files","write_test",":","boolean","true","will","write","test","files","for","the","ensemble",",","false","will","skip","test","files","overwrite",":","boolean","if","true",",","any","existing","train\/test","files","will","be","over-written",".","False","prevents","file","overwriting"]
code: def write_files(
      self,
      output_results_path,
      output_classifier_name="EE",
      write_train=True,
      write_test=True,
      overwrite=False,
  ):
      """Write the results to file.
  
      Probably could be replaced with data_io.write_results_UEA
  
      Parameters
      ----------
      output_results_path : str
          path to where output results will be written
      output_classifier_name : str
          the name of the composite ensemble classifier in the output files
      write_train : boolean
          true will write train files for the ensemble, false will skip training files
      write_test : boolean
          true will write test files for the ensemble, false will skip test files
      overwrite: boolean
          if true, any existing train/test files will be over-written. False
          prevents file overwriting
      """
      if write_train is False and write_test is False:
          return
  
      if not overwrite:
          if write_train:
              full_path = (
                  str(output_results_path)
                  + "/"
                  + str(output_classifier_name)
                  + "/Predictions/"
                  + str(self.dataset_name)
                  + "/trainFold"
                  + str(self.resample_id)
                  + ".csv"
              )
              if os.path.exists(full_path):
                  write_train = False
  
          if write_test is True:
              full_path = (
                  str(output_results_path)
                  + "/"
                  + str(output_classifier_name)
                  + "/Predictions/"
                  + str(self.dataset_name)
                  + "/testFold"
                  + str(self.resample_id)
                  + ".csv"
              )
              if os.path.exists(full_path):
                  # noqa: T201
                  print(
                      full_path
                      + " already exists and overwrite set to false, not writing Test"
                  )
                  write_test = False
  
      if write_train is False and write_test is False:
          return
      if write_train:
          train_probs = self.ee_train_dists
          train_preds = self.classes_[np.argmax(train_probs, axis=1)]
          acc = accuracy_score(
              self.actual_train_class_vals, train_preds
          )
          second = str(self.distance_measures)
          third = (
              str(acc)
              + ",NA,NA,-1,-1,"
              + str(len(self.classes_))
              + ","
              + str(self.classes_)
          )
          write_results_to_uea_format(
              second_line=second,
              third_line=third,
              output_path=output_results_path,
              classifier_name=output_classifier_name,
              resample_seed=self.resample_id,
              predicted_class_vals=train_preds,
              predicted_probs=train_probs,
              dataset_name=self.dataset_name,
              actual_class_vals=self.actual_train_class_vals,
              split="TRAIN",
          )
  
      if write_test:
          test_probs = self.ee_test_dists
          test_preds = self.classes_[np.argmax(test_probs, axis=1)]
          acc = accuracy_score(self.actual_test_class_vals, test_preds)
          second = str(self.distance_measures)
          third = (
              str(acc)
              + ",NA,NA,-1,-1,"
              + str(len(self.classes_))
              + ","
              + str(self.classes_)
          )
          write_results_to_uea_format(
              second_line=second,
              third_line=third,
              output_path=output_results_path,
              classifier_name=output_classifier_name,
              resample_seed=self.resample_id,
              predicted_class_vals=test_preds,
              predicted_probs=test_probs,
              dataset_name=self.dataset_name,
              actual_class_vals=self.actual_test_class_vals,
              split="TEST",
          )
  
imports: import os
  import numpy
  from sklearn.metrics import accuracy_score
  from sktime.datasets import write_results_to_uea_format
label_desc: Use image node_id 2 for calling the ElasticEnsemblePostProcess obj's underlying member method code with example usage: obj.write_files(output_results_path, output_classifier_name, write_train, write_test, overwrite) without return types