Posts

Showing posts with the label jupyter-notebook

Logging while nbconvert execute

Image
Clash Royale CLAN TAG #URR8PPP Logging while nbconvert execute I have a Jupyter notebook that needs to run from the command line. For this I have the following command: jupyter nbconvert --execute my_jupyter_notebook.ipynb --to python This command creates a python script and then executes it. However, I'm using the logging library in Python to log certain events. When it executes the script from the command above, nothing can be seen on the terminal. However, when I execute manually the converted jupyter, like below, I can see all the logs on my terminal: python3 my_jupyter_notebook.py I've tried adding extra arguments like --debug and --stdout but those just output all the code, not just the logs. Is it possible to output on the terminal the results of logging while doing an nbconvert execute command? 1 Answer 1 Here is a code that catch warning and exception produced during execution of n...

Trying to plot with more than one parameter using BaysianOptimization

Image
Clash Royale CLAN TAG #URR8PPP Trying to plot with more than one parameter using BaysianOptimization I am new to python and Bayesian Optimization. I'm using this example to find the maximum value of the "target" polynomial function. The example uses only one "x" parameter for the function and produces a plot that looks like this: . But I want to use a function with two "x" and "z" parameters. After adding a second "z" parameter, the code (below) appears to still calculate and identify the max correctly, but does not plot the results, and produces this error: ValueError: XA and XB must have the same number of columns (i.e. feature dimension.) I've been playing with the code and searching for days, but still haven't figured out why it's doing this. Does anyone know how to get this code to plot when using two parameters in the "target" function? I'm using Python 3.6.4 with Anaconda and Jupyter. Here is my code...