Machine Learning
Let's walk through a simple example to understand how Hypster works. We'll create a basic ML classifier configuration.
Prerequisites:
Configurable Machine Learning Classifier
This example demonstrates several key features of Hypster:
Configuration Definition: Using the
@config
decorator to define a configuration spaceParameter Types: Using different HP call types (
select
,number
,int
,bool
)Default Values: Setting sensible defaults for all parameters
Conditional Logic: Different parameters based on model selection
Multiple Instantiations: Creating different configurations from the same space
Understanding the Code
We define a configuration space using the
@config
decoratorThe configuration function takes an
hp
parameter of typeHP
We use various HP calls to define our parameter space:
hp.select()
for categorical choiceshp.number()
for floating-point & integer valueshp.int()
for integer values onlyhp.bool()
for boolean values
The configuration returns a dictionary with our instantiated objects
We can create multiple instances with different configurations
Training and Evaluating
This basic example shows how Hypster makes it easy to:
Define configuration spaces with type-safe parameters
Set reasonable defaults and parameter ranges
Create multiple configurations from the same space
Integrate with existing ML libraries seamlessly
Last updated