mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-22 13:20:38 +08:00
Merge pull request #70 from optuna/support-pruned-trials-without-report
Fix a bug to crash when trials are pruned with no intermediate values
This commit is contained in:
@@ -187,7 +187,9 @@ const plotHistory = (
|
||||
}
|
||||
|
||||
let filteredTrials = study.trials.filter(
|
||||
(t) => t.state === "Complete" || t.state === "Pruned"
|
||||
(t) =>
|
||||
t.state === "Complete" ||
|
||||
(t.state === "Pruned" && t.values && t.values.length > 0)
|
||||
)
|
||||
if (filterCompleteTrial) {
|
||||
filteredTrials = filteredTrials.filter((t) => t.state !== "Complete")
|
||||
|
||||
@@ -31,7 +31,9 @@ const plotIntermediateValue = (trials: Trial[]) => {
|
||||
}
|
||||
|
||||
const filteredTrials = trials.filter(
|
||||
(t) => t.state === "Complete" || t.state === "Pruned"
|
||||
(t) =>
|
||||
t.state === "Complete" ||
|
||||
(t.state === "Pruned" && t.values && t.values.length > 0)
|
||||
)
|
||||
const plotData: Partial<plotly.PlotData>[] = filteredTrials.map((trial) => {
|
||||
return {
|
||||
|
||||
@@ -32,7 +32,9 @@ const plotCoordinate = (trials: Trial[], objectiveId: number) => {
|
||||
}
|
||||
|
||||
const filteredTrials = trials.filter(
|
||||
(t) => t.state === "Complete" || t.state === "Pruned"
|
||||
(t) =>
|
||||
t.state === "Complete" ||
|
||||
(t.state === "Pruned" && t.values && t.values.length > 0)
|
||||
)
|
||||
|
||||
// Intersection param names
|
||||
|
||||
@@ -103,7 +103,7 @@ const plotParetoFront = (
|
||||
},
|
||||
}
|
||||
|
||||
const trials: Trial[] = study !== null ? study.trials : []
|
||||
const trials: Trial[] = study ? study.trials : []
|
||||
const completedTrials = trials.filter((t) => t.state === "Complete")
|
||||
|
||||
if (completedTrials.length === 0) {
|
||||
|
||||
@@ -140,7 +140,8 @@ const plotSlice = (
|
||||
|
||||
const filteredTrials = trials.filter(
|
||||
(t) =>
|
||||
(t.state === "Complete" || t.state === "Pruned") &&
|
||||
(t.state === "Complete" ||
|
||||
(t.state === "Pruned" && t.values && t.values.length > 0)) &&
|
||||
t.params.find((p) => p.name == selected) !== undefined
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user