class_docstr: Plots training parameters (loss, f-score, and accuracy) and training weights over time.
  
  Input files are the output files 'loss.tsv' and 'weights.txt' from
  training either a sequence tagger or text classification model.
class_docstr_tok: ["Plots","training","parameters","(","loss",",","f-score",",","and","accuracy",")","and","training","weights","over","time",".","Input","files","are","the","output","files","'loss.tsv","'","and","'weights.txt","'","from","training","either","a","sequence","tagger","or","text","classification","model","."]
code: def plot_learning_rate(
      self,
      file_name: Union[str, Path],
      skip_first: int = 10,
      skip_last: int = 5,
  ):
      file_name = Path(file_name)
  
      lrs, losses = self._extract_learning_rate(file_name)
      lrs = (
          lrs[skip_first:-skip_last]
          if skip_last > 0
          else lrs[skip_first:]
      )
      losses = (
          losses[skip_first:-skip_last]
          if skip_last > 0
          else losses[skip_first:]
      )
  
      fig, ax = plt.subplots(1, 1)
      ax.plot(lrs, losses)
      ax.set_ylabel("Loss")
      ax.set_xlabel("Learning Rate")
      ax.set_xscale("log")
      ax.xaxis.set_major_formatter(plt.FormatStrFormatter("%.0e"))
  
      # plt.show()
  
      # save plot
      plt.tight_layout(pad=1.0)
      path = file_name.parent / "learning_rate.png"
      plt.savefig(path, dpi=300)
      log.info(
          f"Learning_rate plots are saved in {path}"
      )  # to let user know the path of the save plots
      plt.show(
          block=True
      )  # to have the plots displayed when user run this module
      plt.close(fig)
  
file_path: flair/flair/visual/training_curves.py
imports: import csv
  import logging
  import math
  from collections import defaultdict
  from pathlib import Path
  from typing import Dict, List, Union
  import matplotlib.pyplot
  import numpy
label_desc: Use image node_id 6 for calling the Plotter obj's underlying member method code with example usage: obj.plot_learning_rate(file_name, skip_first, skip_last) without return types