-
Notifications
You must be signed in to change notification settings - Fork 74
Optimizer Evaluation Tools #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9c17281
c5fd2b8
860b966
88e6afe
db98517
a939e85
eaa8002
c891d99
6d1eb1c
4c3cd00
b16e483
8f14329
15fe771
fb2755b
44e212c
5ee66e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
from mlos.global_values import serialize_to_bytes_string | ||
from mlos.Grpc import OptimizerService_pb2, OptimizerService_pb2_grpc | ||
from mlos.Grpc.OptimizerService_pb2 import Empty, OptimizerConvergenceState, OptimizerInfo, OptimizerHandle, OptimizerList, Observations, Features,\ | ||
ObjectiveValues | ||
ObjectiveValues, SimpleBoolean, SimpleString | ||
from mlos.Optimizers.BayesianOptimizer import BayesianOptimizer, bayesian_optimizer_config_store | ||
from mlos.Optimizers.OptimizationProblem import OptimizationProblem | ||
from mlos.Optimizers.RegressionModels.Prediction import Prediction | ||
|
@@ -118,6 +118,16 @@ def CreateOptimizer(self, request: OptimizerService_pb2.CreateOptimizerRequest, | |
self.logger.info(f"Created optimizer {optimizer_id}.") | ||
return OptimizerService_pb2.OptimizerHandle(Id=optimizer_id) | ||
|
||
def IsTrained(self, request, context): # pylint: disable=unused-argument | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit confused by the camel case for method names but it seems consistent in this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, they come from .proto file. I believe gRPC demands consistent naming even between languages. I think Google's style guide recommends CamelCase for message types, couldn't find what they recommend for function names but it seemed sensible to stick to CamelCase there too. |
||
with self.exclusive_optimizer(optimizer_id=request.Id) as optimizer: | ||
is_trained = optimizer.trained | ||
return SimpleBoolean(Value=is_trained) | ||
|
||
def ComputeGoodnessOfFitMetrics(self, request, context): | ||
with self.exclusive_optimizer(optimizer_id=request.Id) as optimizer: | ||
gof_metrics = optimizer.compute_surrogate_model_goodness_of_fit() | ||
return SimpleString(Value=gof_metrics.to_json()) | ||
|
||
def Suggest(self, request, context): # pylint: disable=unused-argument | ||
self.logger.info("Suggesting") | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.