|
|
|
@@ -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<TableData[]>([]); |
|
|
|
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 ( |
|
|
|
<div className={styles['experiment-history']}> |
|
|
|
<div className={styles['experiment-history__content']}> |
|
|
|
|