diff --git a/react-ui/src/pages/AutoML/Instance/index.tsx b/react-ui/src/pages/AutoML/Instance/index.tsx index 60cc2142..933b496e 100644 --- a/react-ui/src/pages/AutoML/Instance/index.tsx +++ b/react-ui/src/pages/AutoML/Instance/index.tsx @@ -28,7 +28,6 @@ function AutoMLInstance() { const [autoMLInfo, setAutoMLInfo] = useState(undefined); const [instanceInfo, setInstanceInfo] = useState(undefined); const params = useParams(); - // const autoMLId = safeInvoke(Number)(params.autoMLId); const instanceId = safeInvoke(Number)(params.id); const evtSourceRef = useRef(null); @@ -187,6 +186,7 @@ function AutoMLInstance() { icon: , children: ( diff --git a/react-ui/src/pages/AutoML/components/ExperimentHistory/index.tsx b/react-ui/src/pages/AutoML/components/ExperimentHistory/index.tsx index 09d0cd6e..0441a623 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentHistory/index.tsx +++ b/react-ui/src/pages/AutoML/components/ExperimentHistory/index.tsx @@ -8,8 +8,9 @@ import TrialStatusCell from '../TrialStatusCell'; import styles from './index.less'; type ExperimentHistoryProps = { - fileUrl?: string; - isClassification: boolean; + calcMetrics?: string; // 计算指标 + fileUrl?: string; // 文件url + isClassification: boolean; // 是否是分类 }; type TableData = { @@ -22,7 +23,7 @@ type TableData = { althorithm?: string; }; -function ExperimentHistory({ fileUrl, isClassification }: ExperimentHistoryProps) { +function ExperimentHistory({ calcMetrics, fileUrl, isClassification }: ExperimentHistoryProps) { const [tableData, setTableData] = useState([]); useEffect(() => { // 获取实验运行历史记录 @@ -33,7 +34,7 @@ function ExperimentHistory({ fileUrl, isClassification }: ExperimentHistoryProps const list: TableData[] = data.map((item) => { return { id: item[0]?.[0], - accuracy: item[1]?.[5]?.accuracy, + accuracy: calcMetrics ? item[1]?.[5]?.[calcMetrics] : undefined, duration: item[1]?.[5]?.duration, train_loss: item[1]?.[5]?.train_loss, status: item[1]?.[2]?.['__enum__']?.split('.')?.[1], @@ -64,12 +65,6 @@ function ExperimentHistory({ fileUrl, isClassification }: ExperimentHistoryProps width: 80, render: tableCellRender(false), }, - { - title: '准确率', - dataIndex: 'accuracy', - key: 'accuracy', - render: tableCellRender(true), - }, { title: '耗时', dataIndex: 'duration', @@ -103,6 +98,15 @@ function ExperimentHistory({ fileUrl, isClassification }: ExperimentHistoryProps }, ]; + if (calcMetrics) { + columns.splice(0, 0, { + title: `指标:${calcMetrics}`, + dataIndex: 'accuracy', + key: 'accuracy', + render: tableCellRender(true), + }); + } + return (
diff --git a/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx b/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx index b4e7f24b..e2f9d31c 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx +++ b/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx @@ -188,6 +188,7 @@ function ExperimentList({ type }: ExperimentListProps) { if (expanded) { setExpandedRowKeys([record.id]); getExperimentInsList(record.id, 0); + refreshExperimentList(); } else { setExpandedRowKeys([]); } diff --git a/react-ui/src/pages/Experiment/index.jsx b/react-ui/src/pages/Experiment/index.jsx index 9b7cab84..b3a288b1 100644 --- a/react-ui/src/pages/Experiment/index.jsx +++ b/react-ui/src/pages/Experiment/index.jsx @@ -206,6 +206,7 @@ function Experiment() { setExpandedRowKeys(null); } else { getQueryByExperiment(record.id, 0); + refreshExperimentList(); } };