Implement API

This commit is contained in:
Kenshin Abe
2024-01-26 19:12:44 +09:00
parent 4828089fdf
commit 94ce9f9fa1
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -271,6 +271,14 @@ def create_app(
)
if plot_type == "contour":
fig = optuna.visualization.plot_contour(study)
elif plot_type == "slice":
fig = optuna.visualization.plot_slice(study)
elif plot_type == "parallel_coordinate":
fig = optuna.visualization.plot_parallel_coordinate(study)
elif plot_type == "rank":
fig = optuna.visualization.plot_rank(study)
elif plot_type == "edf":
fig = optuna.visualization.plot_edf(study)
else:
response.status = 404 # Not found
return {"reason": f"plot_type={plot_type} is not supported."}
+4
View File
@@ -448,6 +448,10 @@ type PlotResponse = {
}
export enum PlotType {
Contour = "contour",
Slice = "slice",
ParallelCoordinate = "parallel_coordinate",
Rank = "rank",
EDF = "edf",
}
export const getPlotAPI = (
studyId: number,