class_docstr: A convenience class to access UCR/UEA time series datasets.
  
  When using one (or several) of these datasets in research projects, please
  cite [1]_.
  
  This class will attempt to recover from some known misnamed files, like the
  `StarLightCurves` dataset being provided in `StarlightCurves.zip` and
  alike.
  
  Parameters
  ----------
  use_cache : bool (default: True)
      Whether a cached version of the dataset should be used in
      :meth:`~load_dataset`, if one is found.
      Datasets are always cached upon loading, and this parameter only
      determines whether the cached version shall be refreshed upon loading.
  
  Notes
  -----
      Downloading dataset files can be time-consuming, it is recommended
      using `use_cache=True` (default) in order to only experience
      downloading time once per dataset and work on a cached version of the
      datasets afterward.
  
  See Also
  --------
  CachedDatasets : Provides pre-selected datasets for offline use.
  
  References
  ----------
  .. [1] A. Bagnall, J. Lines, W. Vickers and E. Keogh, The UEA & UCR Time
     Series Classification Repository, www.timeseriesclassification.com
class_docstr_tok: ["A","convenience","class","to","access","UCR\/UEA","time","series","datasets",".","When","using","one","(","or","several",")","of","these","datasets","in","research","projects",",","please","cite","[","1","]","_",".","This","class","will","attempt","to","recover","from","some","known","misnamed","files",",","like","the","`","StarLightCurves","`","dataset","being","provided","in","`","StarlightCurves.zip","`","and","alike",".","Parameters","--","--","--","--","--","use_cache",":","bool","(","default",":","True",")","Whether","a","cached","version","of","the","dataset","should","be","used","in",":","meth",":","`","~load_dataset","`",",","if","one","is","found",".","Datasets","are","always","cached","upon","loading",",","and","this","parameter","only","determines","whether","the","cached","version","shall","be","refreshed","upon","loading",".","Notes","--","--","-","Downloading","dataset","files","can","be","time-consuming",",","it","is","recommended","using","`","use_cache=True","`","(","default",")","in","order","to","only","experience","downloading","time","once","per","dataset","and","work","on","a","cached","version","of","the","datasets","afterward",".","See","Also","--","--","--","--","CachedDatasets",":","Provides","pre-selected","datasets","for","offline","use",".","References","--","--","--","--","--","..","[","1","]","A.","Bagnall",",","J",".","Lines",",","W.","Vickers","and","E.","Keogh",",","The","UEA","&","UCR","Time","Series","Classification","Repository",",","www.timeseriesclassification.com"]
docstr: Report baseline performances as provided by UEA/UCR website (for
  univariate datasets only).
  
  Parameters
  ----------
  list_datasets: list or None (default: None)
      A list of strings indicating for which datasets performance should
      be reported.
      If None, performance is reported for all datasets.
  list_methods: list or None (default: None)
      A list of baselines methods for which performance should be
      reported.
      If None, performance for all baseline methods is reported.
  
  Returns
  -------
  dict
      A dictionary in which keys are dataset names and associated values
      are themselves dictionaries that provide accuracy scores for the
      requested methods.
  
  Examples
  --------
  >>> uea_ucr = UCR_UEA_datasets()
  >>> dict_acc = uea_ucr.baseline_accuracy(
  ...         list_datasets=["Adiac", "ChlorineConcentration"],
  ...         list_methods=["C45"])
  >>> len(dict_acc)
  2
  >>> dict_acc["Adiac"]  # doctest: +ELLIPSIS
  {'C45': 0.542199...}
  >>> all_dict_acc = uea_ucr.baseline_accuracy()
  >>> len(all_dict_acc)
  85
docstr_tok: ["Report","baseline","performances","as","provided","by","UEA\/UCR","website","(","for","univariate","datasets","only",")",".","Parameters","--","--","--","--","--","list_datasets",":","list","or","None","(","default",":","None",")","A","list","of","strings","indicating","for","which","datasets","performance","should","be","reported",".","If","None",",","performance","is","reported","for","all","datasets",".","list_methods",":","list","or","None","(","default",":","None",")","A","list","of","baselines","methods","for","which","performance","should","be","reported",".","If","None",",","performance","for","all","baseline","methods","is","reported",".","Returns","--","--","--","-","dict","A","dictionary","in","which","keys","are","dataset","names","and","associated","values","are","themselves","dictionaries","that","provide","accuracy","scores","for","the","requested","methods",".","Examples","--","--","--","--",">",">",">","uea_ucr","=","UCR_UEA_datasets","(",")",">",">",">","dict_acc","=","uea_ucr.baseline_accuracy","(","...","list_datasets=","[","``","Adiac","''",",","``","ChlorineConcentration","''","]",",","...","list_methods=","[","``","C45","''","]",")",">",">",">","len","(","dict_acc",")","2",">",">",">","dict_acc","[","``","Adiac","''","]","#","doctest",":","+ELLIPSIS","{","'C45","'",":","0.542199","...","}",">",">",">","all_dict_acc","=","uea_ucr.baseline_accuracy","(",")",">",">",">","len","(","all_dict_acc",")","85"]
code: def baseline_accuracy(self, list_datasets=None, list_methods=None):
      """Report baseline performances as provided by UEA/UCR website (for
      univariate datasets only).
  
      Parameters
      ----------
      list_datasets: list or None (default: None)
          A list of strings indicating for which datasets performance should
          be reported.
          If None, performance is reported for all datasets.
      list_methods: list or None (default: None)
          A list of baselines methods for which performance should be
          reported.
          If None, performance for all baseline methods is reported.
  
      Returns
      -------
      dict
          A dictionary in which keys are dataset names and associated values
          are themselves dictionaries that provide accuracy scores for the
          requested methods.
  
      Examples
      --------
      >>> uea_ucr = UCR_UEA_datasets()
      >>> dict_acc = uea_ucr.baseline_accuracy(
      ...         list_datasets=["Adiac", "ChlorineConcentration"],
      ...         list_methods=["C45"])
      >>> len(dict_acc)
      2
      >>> dict_acc["Adiac"]  # doctest: +ELLIPSIS
      {'C45': 0.542199...}
      >>> all_dict_acc = uea_ucr.baseline_accuracy()
      >>> len(all_dict_acc)
      85
      """
      with open(self._baseline_scores_filename, "r") as f:
          d_out = dict()
          for perfs_dict in csv.DictReader(f, delimiter=","):
              dataset_name = perfs_dict[""]
              if list_datasets is None or dataset_name in list_datasets:
                  d_out[dataset_name] = {}
                  for m in perfs_dict.keys():
                      if m != "" and (
                          list_methods is None or m in list_methods
                      ):
                          try:
                              d_out[dataset_name][m] = float(
                                  perfs_dict[m]
                              )
                          except (
                              ValueError
                          ):  # Missing score case (score == "")
                              pass
          return d_out
  
file_path: tslearn/tslearn/datasets/ucr_uea.py
imports: import os
  import warnings
  import csv
  import shutil
  from urllib.request import urlretrieve
  from tslearn.utils import _load_arff_uea, _load_txt_uea
  from .datasets import in_file_string_replace, extract_from_zip_url
label_desc: Use image node_id 2 for calling the UCR_UEA_datasets obj's underlying member method code with example usage: obj.baseline_accuracy(list_datasets, list_methods) and returns: d_out