# Random Search Algorithm¶

## `orion.algo.random` – Random sampler as optimization algorithm¶

class `orion.algo.random.``Random`(space, seed=None)[source]

Implement a algorithm that samples randomly from the problem’s space.

Attributes: `configuration` Return tunable elements of this algorithm in a dictionary form appropriate for saving. `is_done` Return True, if an algorithm holds that there can be no further improvement. `should_suspend` Allow algorithm to decide whether a particular running trial is still worth to complete its evaluation, based on information provided by the `judge` method. `space` Domain of problem associated with this algorithm’s instance. `state_dict` Return a state dict that can be used to reset the state of the algorithm.

Methods

 `judge`(self, point, measurements) Inform an algorithm about online measurements of a running trial. `observe`(self, points, results) Observe evaluation results corresponding to list of points in space. `score`(self, point) Allow algorithm to evaluate point based on a prediction about this parameter set’s performance. `seed_rng`(self, seed) Seed the state of the random number generator. `set_state`(self, state_dict) Reset the state of the algorithm based on the given state_dict `suggest`(self[, num]) Suggest a num of new sets of parameters.
`observe`(self, points, results)[source]

Observe evaluation results corresponding to list of points in space.

A simple random sampler though does not take anything into account.

`seed_rng`(self, seed)[source]

Seed the state of the random number generator.

Parameters: seed – Integer seed for the random number generator.
`set_state`(self, state_dict)[source]

Reset the state of the algorithm based on the given state_dict

Parameters: state_dict – Dictionary representing state of an algorithm
`state_dict`

Return a state dict that can be used to reset the state of the algorithm.

`suggest`(self, num=1)[source]

Suggest a num of new sets of parameters. Randomly draw samples from the import space and return them.

Parameters: num – how many sets to be suggested.

Note

New parameters must be compliant with the problem’s domain `orion.algo.space.Space`.