class_docstr: Vowpal Wabbit Class
docstr: Convert dictionary of parameters to vw command line.
  
  Args:
      params (dict): key = parameter, value = value (use True if parameter is just a flag)
  
  Returns:
      list[str]: vw command line parameters as list of strings
docstr_tok: ["Convert","dictionary","of","parameters","to","vw","command","line",".","Args",":","params","(","dict",")",":","key","=","parameter",",","value","=","value","(","use","True","if","parameter","is","just","a","flag",")","Returns",":","list","[","str","]",":","vw","command","line","parameters","as","list","of","strings"]
code: def to_vw_cmd(params):
      """Convert dictionary of parameters to vw command line.
  
      Args:
          params (dict): key = parameter, value = value (use True if parameter is just a flag)
  
      Returns:
          list[str]: vw command line parameters as list of strings
      """
  
      cmd = ["vw"]
      for k, v in params.items():
          if v is False:
              # don't add parameters with a value == False
              continue
  
          # add the correct hyphen to the parameter
          cmd.append(f"-{k}" if len(k) == 1 else f"--{k}")
          if v is not True:
              # don't add an argument for parameters with value == True
              cmd.append("{}".format(v))
  
      return cmd
  
file_path: recommenders/recommenders/models/vowpal_wabbit/vw.py
imports: import os
  from subprocess import run
  from tempfile import TemporaryDirectory
  import pandas
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_TIMESTAMP_COL, DEFAULT_PREDICTION_COL
label_desc: Use image node_id 2 for calling the VW obj's underlying member method code with example usage: obj.to_vw_cmd(params) and returns: cmd