Search code examples
pythonmachine-learningludwig

How to visualize ludwig library models learning curves programatically?


I am using Uber's ludwig library to train neural network models. I want to programatically (via python code, using the documentation's example) visualize the learning curves of my models to analyze their performance using the following code:

import ludwig
ludwig.visualize.learning_curves(
  [train_stats],
  TARGET,
  model_names=None,
  output_directory=None,
  file_format='pdf'
)

However, I am obtaining the following error when running the code:

AttributeError: module 'ludwig' has no attribute 'visualize'

I know that I can generate the visualization via command line. However, I need to do it programatically.


Solution

  • I was able to run the same code without changing it. I just updated the version of ludwig but I am not sure if that was the solution to my problem. I kept using this piece of code and it worked:

    import ludwig
    ludwig.visualize.learning_curves(
      [train_stats],
      TARGET,
      model_names=None,
      output_directory=None,
      file_format='pdf'
    )