BnB

class pyoptex.analysis.estimators.sams.bnb.bnb.BnB[source]

Base branch-and-bround class to retain ntop models (instead of only the best). It is a maximization algorithm.

__init__()[source]

Methods

BnB.branches(node)

Function to generates the branches from a node

BnB.init_queue(top_results, top_scores)

Initializes the branches queue from the top results and scores.

BnB.initialize(nfit)

Initialize a guess for the optimal nodes.

BnB.leaf(node)

Checks whether a node is a leaf.

BnB.loop(top_results, top_scores)

Loops through the branch-and-bound algorithm keeping topn results.

BnB.node_in_results(node, results)

Check whether the node is already in the results.

BnB.postloop(top_results, top_scores)

Callback to run after the branch-and-bound algorithm has run.

BnB.postnew(old, new, top)

Function defining what to do after finding a new optimal node and adding it to the top.

BnB.preloop(top_results, top_scores)

Callback to run before starting the branch-and-bound algorithm (but after intialization).

BnB.prenew(old, new, top)

Function defining what to do after finding a new optimal node and before adding it to the top.

BnB.top(nfit)

Returns the top nfit results using the branch-and-bound algorithm.

BnB.upperbound(node)

Function to compute the upperbound for the maximization branch-and-bound algorithm.