import SubAreaTitle from '@/components/SubAreaTitle';
import {
AutoMLEnsembleClass,
AutoMLResamplingStrategy,
AutoMLTaskType,
resamplingStrategyOptions,
} from '@/enums';
import { Col, Form, Input, InputNumber, Radio, Row, Select, Switch } from 'antd';
// 分类算法
const classificationAlgorithms = [
'adaboost',
'bernoulli_nb',
'decision_tree',
'extra_trees',
'gaussian_nb',
'gradient_boosting',
'k_nearest_neighbors',
'lda',
'liblinear_svc',
'libsvm_svc',
'mlp',
'multinomial_nb',
'passive_aggressive',
'qda',
'random_forest',
'sgd',
].map((name) => ({ label: name, value: name }));
// 回归算法
const regressorAlgorithms = [
'adaboost',
'ard_regression',
'decision_tree',
'extra_trees',
'gaussian_process',
'gradient_boosting',
'k_nearest_neighbors',
'liblinear_svr',
'libsvm_svr',
'mlp',
'random_forest',
'sgd',
].map((name) => ({ label: name, value: name }));
// 特征预处理算法
const featureAlgorithms = [
'densifier',
'extra_trees_preproc_for_classification',
'extra_trees_preproc_for_regression',
'fast_ica',
'feature_agglomeration',
'kernel_pca',
'kitchen_sinks',
'liblinear_svc_preprocessor',
'no_preprocessing',
'nystroem_sampler',
'pca',
'polynomial',
'random_trees_embedding',
'select_percentile_classification',
'select_percentile_regression',
'select_rates_classification',
'select_rates_regression',
'truncatedSVD',
].map((name) => ({ label: name, value: name }));
// 分类指标
export const classificationMetrics = [
'accuracy',
'balanced_accuracy',
'roc_auc',
'average_precision',
'log_loss',
'precision_macro',
'precision_micro',
'precision_samples',
'precision_weighted',
'recall_macro',
'recall_micro',
'recall_samples',
'recall_weighted',
'f1_macro',
'f1_micro',
'f1_samples',
'f1_weighted',
].map((name) => ({ label: name, value: name }));
// 回归指标
export const regressionMetrics = [
'mean_absolute_error',
'mean_squared_error',
'root_mean_squared_error',
'mean_squared_log_error',
'median_absolute_error',
'r2',
].map((name) => ({ label: name, value: name }));
function ExecuteConfig() {
const form = Form.useFormInstance();
const task_type = Form.useWatch('task_type', form);
const include_classifier = Form.useWatch('include_classifier', form);
const exclude_classifier = Form.useWatch('exclude_classifier', form);
const include_regressor = Form.useWatch('include_regressor', form);
const exclude_regressor = Form.useWatch('exclude_regressor', form);
const include_feature_preprocessor = Form.useWatch('include_feature_preprocessor', form);
const exclude_feature_preprocessor = Form.useWatch('exclude_feature_preprocessor', form);
return (
<>