Is it possible to display error messages like in GeNIe when learning?

The engine.
Post Reply
maghnie
Posts: 15
Joined: Fri May 03, 2024 10:45 am

Is it possible to display error messages like in GeNIe when learning?

Post by maghnie »

For example, when trying to train a network using the PC algorithm on a dataset with both continuous and discrete time series, this is the output that I get in GeNIe:
Can't start learning due to problems with data.
## Selected algorithm supports continuous or discrete columns, but they can't be used together.
CONTINUOUS:
<column_names>
DISCRETE:
<other_column_names>
On the other hand, this is the message I get with pysmile:
PC failed: SMILE Error -1 in function PC.Learn
According to the SMILE docs, -1 is just a "general error".

Is there a way to get more info about the error from pysmile?
Or is there a pre-existing function to check a dataset and its compatibility with any of the learning algorithms?

For reference, this is how I'm currently handling errors:

Code: Select all

def learn_with_pc(dataset: pysmile.learning.DataSet) -> BayesianNetwork:
    pc = pysmile.learning.PC()
    try:
        pattern = pc.learn(dataset)
    except pysmile.SMILEException as e:
        logger.error(f"PC failed: {e}")
        return
<...>
shooltz[BayesFusion]
Site Admin
Posts: 1438
Joined: Mon Nov 26, 2007 5:51 pm

Re: Is it possible to display error messages like in GeNIe when learning?

Post by shooltz[BayesFusion] »

The output from GeNIe you've quoted is produced by GeNIe code, which runs before calling into SMILE.

The implementation of PC in core C++ SMILE actually produces limited text output in addition to error code, but it's just a single line (no list of discrete vs continuous columns in the dataset)
Post Reply