Browse Source

feat: 添加分类回归算法

pull/213/head
zhaowei 9 months ago
parent
commit
4afeb8b5bc
4 changed files with 18 additions and 8 deletions
  1. +3
    -3
      react-ui/src/pages/AutoML/Instance/index.tsx
  2. +7
    -2
      react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx
  3. +6
    -1
      react-ui/src/pages/AutoML/components/ExperimentResult/index.tsx
  4. +2
    -2
      react-ui/src/pages/AutoML/components/ExperimentVisualResult/index.tsx

+ 3
- 3
react-ui/src/pages/AutoML/Instance/index.tsx View File

@@ -12,7 +12,7 @@ import AutoMLBasic from '../components/AutoMLBasic';
import ExperimentHistory from '../components/ExperimentHistory';
import ExperimentLog from '../components/ExperimentLog';
import ExperimentResult from '../components/ExperimentResult';
import TensorBoard from '../components/TensorBoard';
import ExperimentVisualResult from '../components/ExperimentVisualResult';
import { AutoMLData, AutoMLInstanceData } from '../types';
import styles from './index.less';

@@ -186,13 +186,13 @@ function AutoMLInstance() {
/>
),
},
type === AutoMLType.Text
type === AutoMLType.Text || type === AutoMLType.Video
? {
key: TabKeys.Visual,
label: '可视化结果',
icon: <KFIcon type="icon-Trialliebiao" />,
children: (
<TensorBoard
<ExperimentVisualResult
path={instanceInfo?.run_history_path}
namespace={instanceInfo?.argo_ins_ns}
/>


+ 7
- 2
react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx View File

@@ -27,6 +27,9 @@ const classificationAlgorithms = [
'qda',
'random_forest',
'sgd',
'LightGBMClassification',
'XGBoostClassification',
'StackingClassification',
].map((name) => ({ label: name, value: name }));

// 回归算法
@@ -43,6 +46,8 @@ const regressorAlgorithms = [
'mlp',
'random_forest',
'sgd',
'LightGBMRegression',
'XGBoostRegression',
].map((name) => ({ label: name, value: name }));

// 特征预处理算法
@@ -289,7 +294,7 @@ function ExecuteConfig() {
name="ensemble_nbest"
tooltip="仅集成最佳的N个模型"
>
<InputNumber placeholder="请输入集成最佳模型数量" min={0} precision={0} />
<InputNumber placeholder="请输入集成最佳模型数量" min={1} precision={0} />
</Form.Item>
</Col>
</Row>
@@ -421,7 +426,7 @@ function ExecuteConfig() {
},
]}
>
<InputNumber placeholder="请输入交叉验证折数" min={0} precision={0} />
<InputNumber placeholder="请输入交叉验证折数" min={1} precision={0} />
</Form.Item>
</Col>
</Row>


+ 6
- 1
react-ui/src/pages/AutoML/components/ExperimentResult/index.tsx View File

@@ -1,5 +1,6 @@
import InfoGroup from '@/components/InfoGroup';
import { AutoMLType } from '@/enums';
import TrialFileTree from '@/pages/HyperParameter/components/TrialFileTree';
import { getFileReq } from '@/services/file';
import { to } from '@/utils/promise';
import { Button, Image } from 'antd';
@@ -40,7 +41,11 @@ function ExperimentResult({ fileUrl, imageUrl, modelPath, type }: ExperimentResu
return (
<div className={styles['experiment-result']}>
<InfoGroup title="实验结果" height={420} width="100%">
<div className={styles['experiment-result__text']}>{result}</div>
{type === AutoMLType.Video ? (
<TrialFileTree title=""></TrialFileTree>
) : (
<div className={styles['experiment-result__text']}>{result}</div>
)}
</InfoGroup>
{type === AutoMLType.Table && (
<InfoGroup title="可视化结果" style={{ margin: '16px 0' }}>


react-ui/src/pages/AutoML/components/TensorBoard/index.tsx → react-ui/src/pages/AutoML/components/ExperimentVisualResult/index.tsx View File

@@ -15,7 +15,7 @@ type TensorBoardProps = {
path?: string;
};

function TensorBoard({ namespace, path }: TensorBoardProps) {
function ExperimentVisualResult({ namespace, path }: TensorBoardProps) {
const [tensorboardUrl, setTensorboardUrl] = useState('');
useEffect(() => {
// 运行 TensorBoard
@@ -40,4 +40,4 @@ function TensorBoard({ namespace, path }: TensorBoardProps) {
return <>{tensorboardUrl && <IframePage type={IframePageType.TensorBoard}></IframePage>}</>;
}

export default TensorBoard;
export default ExperimentVisualResult;

Loading…
Cancel
Save