class_docstr: An object to generate an HTML table from a SQLite result
class_docstr_tok: ["An","object","to","generate","an","HTML","table","from","a","SQLite","result"]
docstr: Get a single column of the results
  
  Examples
  --------
  >>> from sklearn_evaluation import SQLiteTracker
  >>> tracker = SQLiteTracker("experiments.db")
  >>> exp1 = tracker.new_experiment()
  >>> exp1.log("accuracy", 0.8) # doctest: +SKIP
  >>> exp1.log_confusion_matrix([1, 1, 0, 0], [1, 0, 1, 0]) # doctest: +SKIP
  >>> exp2 = tracker.new_experiment()
  >>> exp2.log("accuracy", 1.0) # doctest: +SKIP
  >>> exp2.log_confusion_matrix([1, 1, 0, 0], [1, 1, 0, 0]) # doctest: +SKIP
  >>> results = tracker.query('''
  ... SELECT uuid,
  ...        json_extract(parameters, '$.accuracy') AS accuracy,
  ...        json_extract(parameters, '$.confusion_matrix') AS confusion_matrix
  ... FROM experiments
  ... ''', as_frame=False, render_plots=False)
  >>> results.get("confusion_matrix") # doctest: +SKIP
docstr_tok: ["Get","a","single","column","of","the","results","Examples","--","--","--","--",">",">",">","from","sklearn_evaluation","import","SQLiteTracker",">",">",">","tracker","=","SQLiteTracker","(","``","experiments.db","''",")",">",">",">","exp1","=","tracker.new_experiment","(",")",">",">",">","exp1.log","(","``","accuracy","''",",","0.8",")","#","doctest",":","+SKIP",">",">",">","exp1.log_confusion_matrix","(","[","1",",","1",",","0",",","0","]",",","[","1",",","0",",","1",",","0","]",")","#","doctest",":","+SKIP",">",">",">","exp2","=","tracker.new_experiment","(",")",">",">",">","exp2.log","(","``","accuracy","''",",","1.0",")","#","doctest",":","+SKIP",">",">",">","exp2.log_confusion_matrix","(","[","1",",","1",",","0",",","0","]",",","[","1",",","1",",","0",",","0","]",")","#","doctest",":","+SKIP",">",">",">","results","=","tracker.query","(","``","'","...","SELECT","uuid",",","...","json_extract","(","parameters",",","'","$",".accuracy","'",")","AS","accuracy",",","...","json_extract","(","parameters",",","'","$",".confusion_matrix","'",")","AS","confusion_matrix","...","FROM","experiments","...","``","'",",","as_frame=False",",","render_plots=False",")",">",">",">","results.get","(","``","confusion_matrix","''",")","#","doctest",":","+SKIP"]
code: def get(self, key, index_by=None):
      """Get a single column of the results
  
      Examples
      --------
      >>> from sklearn_evaluation import SQLiteTracker
      >>> tracker = SQLiteTracker("experiments.db")
      >>> exp1 = tracker.new_experiment()
      >>> exp1.log("accuracy", 0.8) # doctest: +SKIP
      >>> exp1.log_confusion_matrix([1, 1, 0, 0], [1, 0, 1, 0]) # doctest: +SKIP
      >>> exp2 = tracker.new_experiment()
      >>> exp2.log("accuracy", 1.0) # doctest: +SKIP
      >>> exp2.log_confusion_matrix([1, 1, 0, 0], [1, 1, 0, 0]) # doctest: +SKIP
      >>> results = tracker.query('''
      ... SELECT uuid,
      ...        json_extract(parameters, '$.accuracy') AS accuracy,
      ...        json_extract(parameters, '$.confusion_matrix') AS confusion_matrix
      ... FROM experiments
      ... ''', as_frame=False, render_plots=False)
      >>> results.get("confusion_matrix") # doctest: +SKIP
      """
      if key not in self.columns:
          raise KeyError(f"{key} does not appear in the results")
  
      if index_by is not None and index_by not in self.columns:
          raise KeyError(f"{index_by} does not appear in the results")
  
      if index_by is None:
          idx_id = 0
      else:
          idx_id = self.columns.index(index_by)
  
      idx = self.columns.index(key)
      values = [row[idx] for row in self.rows]
      ids = [format_id(row[idx_id]) for row in self.rows]
  
      e, ids_out = add_compare_tab(
          elements=values, ids=ids, scores_arg=None
      )
      e = [
          unserialize_if_plot(item, return_instance=False) for item in e
      ]
      mapping = {k: v for k, v in zip(ids_out, e)}
      html = tabs_html_from_content(ids_out, e)
  
      return HTMLMapping(mapping, html)
  
imports: from collections.abc import Mapping
  from uuid import uuid4
  import sqlite3
  import json
  import importlib
  import pandas
  from jinja2 import Template
  from sklearn_evaluation.table import Table
  from sklearn_evaluation.report.serialize import try_serialize_figures, figure2html
  from sklearn_evaluation.telemetry import SKLearnEvaluationLogger
  from sklearn_evaluation.nb.NotebookCollection import add_compare_tab, tabs_html_from_content, HTMLMapping
  from sklearn_evaluation import plot
label_desc: Use image node_id 4 for calling the Results obj's underlying member method code with example usage: obj.get(key, index_by) and returns: HTMLMapping