Spaces:
Sleeping
Sleeping
File size: 8,683 Bytes
8d94a86 928d3e1 8d94a86 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# 全局静态变量值存储类
class StaticValue:
# SHAP抽样数量
SAMPLE_NUM = 20
# 超参数文本框的最大组件数量
MAX_PARAMS_NUM = 60
# 颜色和标签显示的最大组件数量
MAX_NUM = 20
# 随机种子 (数据集切分+模型训练)
RANDOM_STATE = 123
# 参数类型
INT = "int"
FLOAT = "float"
BOOL = "bool"
STR = "str"
# 画图颜色组重复次数
COLOR_ITER_NUM = 3
# 颜色组
COLORS = [
"#ca5353",
"#c874a5",
"#b674c8",
"#8274c8",
"#748dc8",
"#74acc8",
"#74c8b7",
"#74c88d",
"#a6c874",
"#e0e27e",
"#df9b77",
"#404040",
"#999999",
"#d4d4d4"
] * COLOR_ITER_NUM
COLORS_0 = [
"#8074C8",
"#7895C1",
"#A8CBDF",
"#992224",
"#B54764",
"#E3625D",
"#EF8B67",
"#F0C284"
] * COLOR_ITER_NUM
COLORS_1 = [
"#4A5F7E",
"#719AAC",
"#72B063",
"#94C6CD",
"#B8DBB3",
"#E29135"
] * COLOR_ITER_NUM
COLORS_2 = [
"#4485C7",
"#D4562E",
"#DBB428",
"#682487",
"#84BA42",
"#7ABBDB",
"#A51C36"
] * COLOR_ITER_NUM
COLORS_3 = [
"#8074C8",
"#7895C1",
"#A8CBDF",
"#F5EBAE",
"#F0C284",
"#EF8B67",
"#E3625D",
"#B54764"
] * COLOR_ITER_NUM
COLORS_4 = [
"#979998",
"#C69287",
"#E79A90",
"#EFBC91",
"#E4CD87",
"#FAE5BB",
"#DDDDDF"
] * COLOR_ITER_NUM
COLORS_5 = [
"#91CCC0",
"#7FABD1",
"#F7AC53",
"#EC6E66",
"#B5CE4E",
"#BD7795",
"#7C7979"
] * COLOR_ITER_NUM
COLORS_6 = [
"#E9687A",
"#F58F7A",
"#FDE2D8",
"#CFCFD0",
"#B6B3D6"
] * COLOR_ITER_NUM
# 文件路径相关静态变量存储类
class FilePath:
png_base = "./buffer/{}.png"
excel_base = "./buffer/{}.xlsx"
# [绘图]
display_dataset = "current_excel_data"
data_distribution_plot = "data_distribution_plot"
descriptive_indicators_plot = "descriptive_indicators_plot"
heatmap_plot = "heatmap_plot"
learning_curve_plot = "learning_curve_plot"
shap_beeswarm_plot = "shap_beeswarm_plot"
data_fit_plot = "data_fit_plot"
waterfall_plot = "waterfall_plot"
force_plot = "force_plot"
dependence_plot = "dependence_plot"
# 绘图Step 15:在这里添加新的绘图方法名称
# 模型名称静态变量存储类
class MN: # ModelName
classification = "classification"
regression = "regression"
# [模型]
linear_regressor = "linear regressor"
polynomial_regressor = "polynomial regressor"
logistic_classifier = "logistic classifier"
decision_tree_classifier = "decision tree classifier"
random_forest_classifier = "random forest classifier"
random_forest_regressor = "random forest regressor"
xgboost_classifier = "xgboost classifier"
lightGBM_classifier = "lightGBM classifier"
gradient_boosting_regressor = "gradient boosting regressor"
svm_classifier = "svm classifier"
svm_regressor = "svm regressor"
knn_classifier = "knn classifier"
knn_regressor = "knn regressor"
naive_bayes_classifier = "naive bayes classifier"
# 模型Step 4:在这里添加新的模型名称
# [绘图]
data_distribution = "data_distribution"
descriptive_indicators = "descriptive_indicators"
heatmap = "heatmap"
learning_curve = "learning_curve"
shap_beeswarm = "shap_beeswarm"
data_fit = "data_fit"
waterfall = "waterfall"
force = "force"
dependence = "dependence"
# 绘图Step 4:在这里添加新的绘图方法名称
# 组件标签名称静态变量存储类
class LN: # LabelName
choose_dataset_radio = "选择所需数据源 [必选]"
display_total_col_num_text = "总列数"
display_total_row_num_text = "总行数"
display_na_list_text = "存在缺失值的列"
del_all_na_col_button = "删除所有存在缺失值的列 [可选]"
display_duplicate_num_text = "重复的行数"
del_col_checkboxgroup = "选择所需删除的列"
del_col_button = "删除 [可选]"
remain_row_slider = "保留的行数"
remain_row_button = "保留 [可选]"
del_duplicate_button = "删除所有重复行 [可选]"
encode_label_checkboxgroup = "选择所需标签编码的字符型数值列"
display_encode_label_dataframe = "标签编码信息"
encode_label_button = "字符型转数值型 [可选]"
change_data_type_to_float_button = "将所有数据强制转换为浮点型(除第1列以外)[必选]"
standardize_data_checkboxgroup = "选择所需标准化的列"
standardize_data_button = "标准化 [可选]"
select_as_y_radio = "选择因变量 [必选]"
choose_assign_radio = "选择任务类型(同时会根据任务类型将第1列数据强制转换)[必选]"
train_size_textbox = "分割出的训练集所占比例"
model_optimize_radio = "选择超参数优化方法"
model_train_input_params_dataframe = "超参数列表"
model_train_button = "训练"
model_train_params_dataframe = "训练后的模型参数"
model_train_metrics_dataframe = "训练后的模型指标"
select_as_model_radio = "选择所需训练的模型"
# [模型]
linear_regression_model_radio = "选择线性回归的模型"
naive_bayes_classification_model_radio = "选择朴素贝叶斯分类的模型"
# 模型Step 5:在这里添加新的模型额外组件名称
title_name_textbox = "标题"
x_label_textbox = "x 轴名称"
y_label_textbox = "y 轴名称"
colors = ["颜色 {}".format(i) for i in range(StaticValue.MAX_NUM)]
labels = ["图例 {}".format(i) for i in range(StaticValue.MAX_NUM)]
# [绘图]
heatmap_is_rotate = "x轴标签是否旋转"
heatmap_checkboxgroup = "选择所需绘制系数热力图的列"
heatmap_button = "绘制系数热力图"
data_distribution_radio = "选择所需绘制数据分布图的列"
data_distribution_is_rotate = "x轴标签是否旋转"
data_distribution_button = "绘制数据分布图"
descriptive_indicators_checkboxgroup = "选择所需绘制箱线统计图的列"
descriptive_indicators_is_rotate = "x轴标签是否旋转"
descriptive_indicators_button = "绘制箱线统计图"
learning_curve_checkboxgroup = "选择所需绘制学习曲线图的模型"
learning_curve_button = "绘制学习曲线图"
shap_beeswarm_radio = "选择所需绘制特征蜂群图的模型"
shap_beeswarm_type = "选择图像类型"
shap_beeswarm_button = "绘制特征蜂群图"
data_fit_checkboxgroup = "选择所需绘制数据拟合图的模型"
data_fit_button = "绘制数据拟合图"
waterfall_radio = "选择所需绘制特征瀑布图的模型"
waterfall_number = "输入相关特征的变量索引"
waterfall_button = "绘制特征瀑布图"
force_radio = "选择所需绘制特征力图的模型"
force_number = "输入相关特征的变量索引"
force_button = "绘制特征力图"
dependence_radio = "选择所需绘制特征依赖图的模型"
dependence_col = "选择相应的列"
dependence_button = "绘制特征依赖图"
# 绘图Step 5:在这里添加新的绘图方法相关组件名称
data_distribution_plot = "数据分布图"
descriptive_indicators_plot = "箱线统计图"
heatmap_plot = "系数热力图"
learning_curve_plot = "学习曲线图"
shap_beeswarm_plot = "特征蜂群图"
data_fit_plot = "数据拟合图"
waterfall_plot = "特征瀑布图"
force_plot = "特征力图"
dependence_plot = "特征依赖图"
# 绘图Step 6:在这里添加新的绘图方法名称
|