smash.Samples.to_dataframe#

Samples.to_dataframe()[source]#

Convert the Samples object to a pandas.DataFrame.

Returns:
respandas.DataFrame

It returns the Samples object as a pandas.DataFrame.

Examples

>>> from smash.factory import generate_samples
>>> problem = {"num_vars": 2, "names": ["cp", "llr"], "bounds": [[1, 200], [1, 500]]}

Generate samples

>>> sample = generate_samples(problem, n=5, random_state=1)

Convert the result to a pandas.DataFrame

>>> sample.to_dataframe()
           cp         llr
0   83.987379   47.076959
1  144.344574   93.943845
2    1.022761  173.434803
3   61.164182  198.986970
4   30.204422  269.869550