locked
Two questions about BPM example (Migrated from community.research.microsoft.com) RRS feed

  • Question

  • nTH posted on 04-13-2011 4:07 PM

    I'm running into some difficulty extracting only the array output.  For example I'm trying to extract only the portion where the output is [0] Bernoulli (0.9733).  How would I go about accessing only the Bernoulli outcome?

    My second question is regarding the willbuy example of BPM.  Right now I only have one boolean variable, being willBuy[].  How do I modify the model to handle more than one boolean outcome.  So, for example I want to know the likelihood of willBuy[], but after it I also want to know the outcome of willBuy5years[], based on the same training data.

    Friday, June 3, 2011 6:46 PM

Answers

  • minka replied on 04-19-2011 6:21 AM

    Seems to me that you should have one BPM classifier for each engine model.  You give the same input to each BPM and get the probability of each engine model.

    Friday, June 3, 2011 6:47 PM

All replies

  • John Guiver replied on 04-14-2011 5:55 AM

    The following will give you the posterior y as a .NET array of Bernoullis:

    Bernoulli[] yPost = engine.Infer<Bernoulli[]>(ytest);

    As regards the second question, the simple BPM is a classifier for which observations are booleans. The multi-class BPM allows you to solve problems where the outcome is just one of several different outputs, but I don't think this is what you want.

    When you say 'same data', I assume you mean same inputs. If you consider 'willBuy' and 'willBuy5years' to be independent, the simplest thing to do would be just to make two instances of the model, and query them appropriately. If you consider there is some connection between the two events, then you need to define what that connection is using your domain knowledge and define a model appropriately. For example, you might feel that some of your features commonly affect both outcomes in the same way in which case you might have a shared set of weights for those features, and have independent weights for the other features. If you think this is a good model for your problem, or if you have other ideas for a model, then let me know, and I can help you implement it.

    John

    Friday, June 3, 2011 6:47 PM
  • nTH replied on 04-14-2011 11:05 AM

    Thank you for the response.  Yes, I have debated simply making two instances.  If I end up doing that then I would need to format the output so that each probability coming from each instance is somehow organized correctly in a one dimensional or two dimensional array.  For example my current inputs are various engine components, each of which has a unique whole number associated with it in the bayes point program (so we are working with integers and not string values).   For the output I'm trying to say that some of these input selections have a specific engine model associated.  So for example, I'm trying to get at the following output once various inputs are selected:

    [0] 1968 Chevy Model - .3674

    [1] 1976 Ford Model - .9974

     

    I'm not exactly sure what model to really use for this.

    Friday, June 3, 2011 6:47 PM
  • minka replied on 04-19-2011 6:21 AM

    Seems to me that you should have one BPM classifier for each engine model.  You give the same input to each BPM and get the probability of each engine model.

    Friday, June 3, 2011 6:47 PM