class_docstr: CLI describes a command line interface for interacting with igel, there
  are several different functions that can be performed.
class_docstr_tok: ["CLI","describes","a","command","line","interface","for","interacting","with","igel",",","there","are","several","different","functions","that","can","be","performed","."]
code: def __init__(self):
      self.parser = argparse.ArgumentParser(
          description="Igel CLI Runner",
          usage=f"""
   ___           _    ____ _     ___
  |_ _|__ _  ___| |  / ___| |   |_ _|
   | |/ _` |/ _ \\ | | |   | |    | |
   | | (_| |  __/ | | |___| |___ | |
  |___\\__, |\\___|_|  \\____|_____|___|
      |___/
  
  
  igel <command> [<args>]
  
  - Available commands:
     init              initialize a yaml file with default parameters
     fit               fits a model
     evaluate          evaluate the performance of a pre-fitted model
     predict           predicts using a pre-fitted model
     experiment        this command will run fit, evaluate and predict together
     serve             serve the trained model
     gui               open the igel UI (make sure you have nodejs installed)
     help              get help about how to use igel
     info              get info & metadata about igel
     version           get the version of igel installed on your machine
     models            get a list of supported machine learning algorithms/models
     metrics           get a list of all supported metrics
  
  - Available arguments:
  
      # for usage with the fit, evaluate or predict command:
      -dp         Path to your dataset    (dp stand for data_path, you can use --data_path instead)
      -yml        Path to your yaml file  (you can use --yaml_path instead)
  
      # for usage with the experiment command:
      -DP         Paths to data you want to use for fitting,
                  evaluating and predict respectively.    (you can use --data_paths instead)
  
      -yml        Path to the yaml file that will be used when fitting the model.
  
      # for usage with the serve command:
      -res_dir    Path to the model_results directory generated by igel after training the model
  
      # for getting help with the models command:
      -type       type of the model you want to get help on
                  -> whether regression, classification or clustering.    (you can use --model_type instead)
  
      -name       name of the model you want to get help on.    (you can use --model_name instead)
  
  
  Note: you can run the commands without providing additional arguments, which will run interactive mode, where
        you will be prompted to enter your arguments on the fly.
  
  ---------------------------------------------------------------------------------------------------------------
  
  - HowTo:
  
      - you can always type igel -h to print the help
      - you can run igel version to get the version installed
      - you can run igel info to get meta data about the package
  
      -----------------------------------------------------------
  
      you can let igel generate a boilerplate config file for you by running "igel init". This will automatically
      create a yaml file in the working directory with some default parameters to get you started fast
  
      - example for RandomForest regressor: igel init -type regression -model RandomForest
      - you can also run this in interactive mode by just running: igel init
  
      -----------------------------------------------------------
  
      you can get help on supported models by running igel models in your terminal. this will list all supported
      models in a table. Additionally, you will be prompted to enter a model name and type that you want to get
      help about. You can also pass arguments when running the command.
  
      - example for getting help on how to use RandomForest: igel models -type regression -name RandomForest
  
      ------------------------------------------------------------
  
      you can also get help on supported metrics. Just run igel metrics to get all supported metrics
  
      ------------------------------------------------------------
  
      Training/fitting a model is very easy in igel. You can just run igel fit to enter interactive mode, where
      you will be prompted to enter path to your dataset and config file. You can also provide the path to
      your dataset and config file directly if you want by running:
  
      - example: igel fit -dp "path_to_data" -yml "path_to_yaml_file"
  
      This will fit a model and save it in a folder called model_results in your current working directory
  
      -------------------------------------------------------------
  
      Evaluating a model is also very easy. Just run the igel evaluate command to enter interactive mode.
      Otherwise you can always enter the arguments directly.
  
      - example: igel evaluate -dp "path_to_data"
  
      This will evaluate the pre-trained model and save results in an evaluation.json file in the model_results dir.
  
      --------------------------------------------------------------
  
      Using the pre-trained model to generate predictions is straightforward. Just run the igel predict command,
      which will run interactive mode, where you will be prompted to enter path to your predict data. Same as
      other commands, you can also provide arguments directly when running this:
  
      - example: igel predict -dp "path_to_data"
  
      This will generate predictions and save it in a predictions.csv file in the model_results dir.
  
      --------------------------------------------------------------
  
      you can be lazy and run the fit, evaluate and predict command in one simple command called experiment.
      Same as other command, just run igel experiment to enter interactive mode or provide arguments directly.
  
  
      - example: igel experiment -DP "path_to_train_data \\
                                      path_to_evaluation_data \\
                                      path_to_data_you_want_to_predict_on" -yml "path_to_yaml_file"
  
      This will run the fit command using the train data, then evaluate your model using the evaluation data
      and finally generate predictions on the predict data.
  
      ----------------------------------------------------------------
  
      The next step is to use your model in production. Igel helps you with this task too by providing the serve command.
      Running the serve command will tell igel to serve your model. Precisely, igel will automatically build
      a REST server and serve your model on a specific host and port, which you can configure by passing these as
      cli options.
  
      ----------------------------------------------------------------
  
      Finally, if you are a non-technical user and don't want to use the terminal, then consider using the igel UI.
      You can run this from igel by typing igel gui, which will run the igel UI application, where you can use igel
      with a few clicks. Make sure you have nodejs installed for this. Check the official repo for more infos.
  
      ----------------------------------------------------------------
  
  
                      """,
      )
  
      self.parser.add_argument("command", help="Subcommand to run")
      self.cmd = self.parse_command()
      self.args = sys.argv[2:]
      self.dict_args = self.convert_args_to_dict()
      getattr(self, self.cmd.command)()
  
imports: import argparse
  import logging
  import os
  import subprocess
  import sys
  from pathlib import Path
  import igel
  import pandas
  from igel import Igel, metrics_dict, models_dict
  from igel.constants import Constants
  from igel.servers import fastapi_server
label_desc: Use image node_id 1 to create a new CLI object  with example: obj = CLI()