BPt.Select#

class BPt.Select(iterable=(), /)[source]#

The Select object is an BPt specific Input Wrapper designed to allow hyper-parameter searches to include not just choice of hyper-parameter, but also choosing between objects (as well as their relevant distributions).

Select is used to cast lists of base ModelPipeline or Pipeline pieces as different options. Consider a simple example, for specifying a selection between two different Models

model = Select([Model('linear'), Model('random forest')])

In this example, the model passed to Pipeline or Model_Pipeline becomes a meta object for selecting between the two base models. Note: this does require a ParamSearch object be passed to Pipeline. Notably as well, if further param distributions are defined within say the Model(‘random forest’), those will still be optimized, allowing for potentially even a hyper-parameter search to select hyper-parameter distribution… (i.e., if both select options had the same base model obj, but only differed in the passed hyper-param distributions) if one were so inclined…

Other notable features of Select are, you are not limited to passing only two options, you can pass an arbitrary number… you can even, and I’m not even sure I want to tell you this… pass nested calls to Select… i.e., one of the Select options could be another Select, with say another Select…

Lastly, explicitly note that Select is not restricted for use with Models, it can be used on any of the base class:Pipeline piece params (i.e., every param but param_search and cache…).

Notes

This object cannot be used to wrap custom objects.

Methods

append(object, /)

Append object to the end of the list.

clear(/)

Remove all items from list.

copy(/)

Return a shallow copy of the list.

count(value, /)

Return number of occurrences of value.

extend(iterable, /)

Extend list by appending elements from the iterable.

index(value[, start, stop])

Return first index of value.

insert(index, object, /)

Insert object before index.

pop([index])

Remove and return item at index (default last).

remove(value, /)

Remove first occurrence of value.

reverse(/)

Reverse IN PLACE.

sort(*[, key, reverse])

Sort the list in ascending order and return None.