TransWikia.com

Predicting algorithm elapsed time using a Gaussian Process

Data Science Asked on February 5, 2021

I am new to the Gaussian Processes. I have a simple problem: given some training data of an algorithm performance given its problem size, I want to predict how long it will take (in seconds) to complete.

I have as an input 2 integer parameters that define the problem the algorithm tries to solve and should hint something about the difficulty of the problem. The output is the algorithm elapsed time. I have around 2k runs of that algorithm with different values of the input parameters. The input parameters (let’s name them x1 and x2) can have the following values: for x1 it can either be 3, 5, 10, 15, or 20. For x2 it can either be 0, 1, 2, 3, 4, or 5. The output is time in seconds.

Note that I have simplified the details of the problem to something simple to describe. It might not make sense as an application of GP but that’s because I have simplified the problem. In principle, the algorithm is stochastic and it’s not clear whether it will find a solution or not. Therefore, starting with an easy problem of predicting the time it will take to finish is a good start for me.

I am using Sklearn and its GaussianProcessRegressor object.

I will provide the code I have so far:

# Training data and test data split
training_x, training_y = get_training_data() # 95% of the data
testing_x, testing_y = get_test_data() # 5% of the data
kernel= RationalQuadratic(alpha=1, length_scale=1)
model = GaussianProcessRegressor(kernel)
model.fit(training_x, training_y)
prediction, err = model.predict(testing_x, return_std=True)
print(model.score(testing_x, testing_y)

The score I get back is 0.39 which I find quite bad. I was expecting something higher given that the input space is not large and that the output (time in seconds) is not varying much from run to run.

I am posting this question here in case you can provide me with some pointers to what I should look up or if you spot something I do fundamentally wrong.

Thank you in advance for your time.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP