1

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.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Galo Castillo
  • 324
  • 3
  • 7

2 Answers2

0

Do it like that.

from ludwig import visualize
visualize.learning_curves(
  [train_stats],
  TARGET,
  model_names=None,
  output_directory=None,
  file_format='pdf'
)
shahid hamdam
  • 751
  • 1
  • 10
  • 24
0

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'
)
Galo Castillo
  • 324
  • 3
  • 7