1
0

gui.py 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297
  1. import os
  2. import tkinter
  3. from tkinter.scrolledtext import ScrolledText
  4. import tkinter.messagebox
  5. from newtkinter import askopenfilename, asksaveasfilename, askdirectory
  6. import chardet
  7. import webbrowser
  8. import machinelearning.controller
  9. import machinelearning.template
  10. calculation_list = []
  11. calculation_method = []
  12. PATH = os.getcwd()
  13. sheet_list = []
  14. merge_list = []
  15. learner_controller = machinelearning.controller.MachineLearner()
  16. SCREEN = tkinter.Tk()
  17. gui_width = 13 # 标准宽度
  18. gui_height = 2
  19. row = 0
  20. column = 0
  21. bg_color = "#FFFAFA" # 主颜色
  22. botton_color = "#FFFAFA" # 按钮颜色
  23. word_color = "#000000" # 文字颜色
  24. SCREEN["bg"] = bg_color
  25. FONT = ("黑体", 11) # 设置字体
  26. def machine_learning():
  27. global SCREEN
  28. SCREEN.mainloop()
  29. def add_reverse_fast_fourier2(): # 添加Lenear的核心
  30. add_leaner("[2]Reverse_Fast_Fourier")
  31. def add_reverse_fast_fourier(): # 添加Lenear的核心
  32. add_leaner("Reverse_Fast_Fourier")
  33. def add_fast_fourier(): # 添加Lenear的核心
  34. add_leaner("Fast_Fourier")
  35. def curve_fitting():
  36. file_dir = askopenfilename(title="导入参数")
  37. with open(file_dir, "r") as f:
  38. learner_controller.add_curve_fitting(f.read())
  39. update_leaner()
  40. def show_clustering_score():
  41. show_score(2)
  42. def show_regression_score():
  43. show_score(1)
  44. def show_class_score():
  45. show_score(0)
  46. def show_score(func):
  47. learner = get_learner(True)
  48. save_dir = askdirectory(title="选择保存位置")
  49. data = learner_controller.model_evaluation(
  50. learner, save_dir, get_name(False, True), get_name(False, False), func
  51. )
  52. webbrowser.open(data[0])
  53. webbrowser.open(data[1]) # 还可以打开文件管理器
  54. update_sheet_box()
  55. def calculation():
  56. global calculation_list, calculation_method, calculation_type
  57. func = calculation_type.get()
  58. if len(calculation_list) == 2 and 1 in calculation_method:
  59. learner_controller.calculation_matrix(
  60. calculation_list, calculation_method, func
  61. )
  62. update_sheet_box()
  63. def add_calculation_core(num, type_):
  64. global calculation_list, calculation_method
  65. if len(calculation_list) == 2:
  66. del calculation_list[0]
  67. del calculation_method[0]
  68. calculation_list.append(num)
  69. calculation_method.append(type_)
  70. def update_calculation_box():
  71. global calculation_list, calculation_method, calculation_box
  72. calculation_box.delete(0, tkinter.END)
  73. a = ["第一参数", "第二参数"]
  74. b = ["参数", "矩阵"]
  75. calculation_box.insert(
  76. tkinter.END,
  77. *[
  78. f"{a[i]} {calculation_list[i]} {b[calculation_method[i]]}"
  79. for i in range(len(calculation_list))
  80. ],
  81. )
  82. def add_calculation_number():
  83. global calculation_box, calculation_type, value
  84. num = eval(value.get(), {})
  85. add_calculation_core(num, 0)
  86. update_calculation_box()
  87. def add_calculation_object():
  88. name = get_name()
  89. add_calculation_core(name, 1)
  90. update_calculation_box()
  91. def del_leaner():
  92. learn = get_learner(True)
  93. set_learne = get_learner(False) # 获取学习器Learner
  94. if set_learne != learn:
  95. learner_controller.del_leaner(learn)
  96. update_leaner()
  97. def global_seeting():
  98. global global_settings
  99. args = [bool(i.get()) for i in global_settings]
  100. machinelearning.template.set_global(*args)
  101. def reshape():
  102. global learner_controller, processing_type, shape
  103. numpy_shape = eval(f"[{shape.get()}]")[0]
  104. learner_controller.reshape(get_name(), numpy_shape)
  105. update_sheet_box()
  106. def transpose():
  107. global learner_controller, processing_type, shape
  108. try:
  109. func = eval(f"[{shape.get()}]")
  110. except BaseException:
  111. func = None
  112. learner_controller.transpose(get_name(), func)
  113. update_sheet_box()
  114. def del_ndim():
  115. global learner_controller
  116. learner_controller.del_ndim(get_name())
  117. update_sheet_box()
  118. def reval():
  119. global learner_controller, processing_type
  120. reval_type = processing_type.get()
  121. learner_controller.reval(get_name(), reval_type)
  122. update_sheet_box()
  123. def two_split():
  124. global learner_controller, processing_type, shape
  125. split_type = processing_type.get()
  126. learner_controller.two_split(get_name(), shape.get(), split_type)
  127. update_sheet_box()
  128. def split():
  129. global learner_controller, processing_type, shape
  130. split_type = processing_type.get()
  131. try:
  132. split_shape_list = eval(f"[{shape.get()}]", {})[0]
  133. except BaseException:
  134. split_shape_list = 2
  135. learner_controller.split(get_name(), split_shape_list, split_type)
  136. update_sheet_box()
  137. def merge():
  138. global merge_list, learner_controller, processing_type
  139. if len(merge_list) < 1:
  140. return False
  141. merge_type = processing_type.get()
  142. learner_controller.merge(merge_list, merge_type)
  143. update_sheet_box()
  144. def update_merge_box():
  145. global merge_list, merge_box
  146. merge_box.delete(0, tkinter.END)
  147. merge_box.insert(tkinter.END, *merge_list)
  148. def merge_del():
  149. global merge_list, merge_box
  150. del merge_list[merge_box.curselection()[0]]
  151. update_merge_box()
  152. def merge_add():
  153. global merge_list
  154. name = get_name()
  155. merge_list.append(name)
  156. update_merge_box()
  157. def visualization_results():
  158. learner = get_learner(True)
  159. save_dir = askdirectory(title="选择保存位置")
  160. data = learner_controller.model_visualization(learner, save_dir)
  161. webbrowser.open(data[0])
  162. webbrowser.open(data[1]) # 还可以打开文件管理器
  163. update_sheet_box()
  164. def get_learner_parameters():
  165. global learner_parameters
  166. return learner_parameters.get("0.0", tkinter.END)
  167. def score_learner():
  168. learner = get_learner()
  169. socore = learner_controller.score(
  170. get_name(False, True), get_name(False, False), learner
  171. )
  172. tkinter.messagebox.showinfo("测试完成", f"针对测试数据评分结果为:{socore}")
  173. def predict_learner():
  174. learner = get_learner()
  175. data = learner_controller.predict(get_name(False, True), learner)
  176. title = f"CoTan数据处理 学习器:{learner}"
  177. creat_text_sheet(data, title)
  178. update_sheet_box()
  179. def fit_learner():
  180. learner = get_learner()
  181. try:
  182. split = float(data_split.get())
  183. if split < 0 or 1 < split:
  184. raise Exception
  185. except BaseException:
  186. split = 0.3
  187. socore = learner_controller.fit_model(
  188. get_name(False, True),
  189. get_name(False, False),
  190. learner,
  191. Text=get_learner_parameters(),
  192. split=split,
  193. )
  194. tkinter.messagebox.showinfo(
  195. "训练完成",
  196. f"针对训练数据({(1 - split) * 100}%)评分结果为:{socore[0]}\n"
  197. f"针对测试数据评分({split * 100}%)结果为:{socore[1]}",
  198. )
  199. def set_x_data():
  200. global x_data
  201. x_data.set(get_name())
  202. def set_y_data():
  203. global y_data
  204. y_data.set(get_name())
  205. def set_learner():
  206. global learner_output
  207. learner_output.set(get_learner(True))
  208. def get_learner(return_box=False):
  209. global learn_dict, learner_box, learner_output
  210. if return_box:
  211. try:
  212. return list(learn_dict.keys())[learner_box.curselection()[0]]
  213. except BaseException:
  214. try:
  215. return list(learn_dict.keys)[0]
  216. except BaseException:
  217. return get_learner(False)
  218. else:
  219. try:
  220. return learner_output.get()
  221. except BaseException:
  222. return None
  223. def add_statistics(): # 添加Lenear的核心
  224. add_leaner("Statistics")
  225. def add_correlation():
  226. add_leaner("Correlation")
  227. def add_matrix_scatter():
  228. add_leaner("MatrixScatter")
  229. def add_view_data():
  230. learner_controller.add_view_data(get_learner(), parameters=get_learner_parameters())
  231. update_leaner()
  232. def add_cluster_tree():
  233. add_leaner("ClusterTree")
  234. def add_feature_y_x():
  235. add_leaner("FeatureY-X")
  236. def add_numpy_to_heatmap():
  237. add_leaner("HeatMap")
  238. def add_predictive_heatmap_more(): # 添加Lenear的核心
  239. learner_controller.add_predictive_heat_map_more(
  240. get_learner(), parameters=get_learner_parameters()
  241. )
  242. update_leaner()
  243. def add_predictive_heatmap(): # 添加Lenear的核心
  244. learner_controller.add_predictive_heat_map(
  245. get_learner(), parameters=get_learner_parameters()
  246. )
  247. update_leaner()
  248. def add_feature_scatter_class_all():
  249. add_leaner("FeatureScatterClass_all")
  250. def add_feature_scatter_all():
  251. add_leaner("FeatureScatter_all")
  252. def add_feature_scatter_class():
  253. add_leaner("FeatureScatterClass")
  254. def add_feature_scatter():
  255. add_leaner("FeatureScatter")
  256. def add_class_bar():
  257. add_leaner("ClassBar")
  258. def add_dbscan():
  259. add_leaner("DBSCAN")
  260. def add_agglomerative():
  261. add_leaner("Agglomerative")
  262. def add_k_means():
  263. add_leaner("k-means")
  264. def add_mlp_class():
  265. add_leaner("MLP_class")
  266. def add_mlp():
  267. add_leaner("MLP")
  268. def add_svr():
  269. add_leaner("SVR")
  270. def add_svc():
  271. add_leaner("SVC")
  272. def add_gradient_tree():
  273. add_leaner("GradientTree")
  274. def add_gradient_tree_class():
  275. add_leaner("GradientTree_class")
  276. def add_tsne():
  277. add_leaner("t-SNE")
  278. def add_nmf():
  279. add_leaner("NMF")
  280. def add_lda():
  281. add_leaner("LDA")
  282. def add_kpca():
  283. add_leaner("KPCA")
  284. def add_rpca():
  285. add_leaner("RPCA")
  286. def add_pca():
  287. add_leaner("PCA")
  288. def add_missed():
  289. add_leaner("Missed")
  290. def add_label():
  291. add_leaner("Label")
  292. def add_one_hot_encoder():
  293. add_leaner("OneHotEncoder")
  294. def add_discretization():
  295. add_leaner("Discretization")
  296. def add_binarizer():
  297. add_leaner("Binarizer")
  298. def add_regularization():
  299. add_leaner("Regularization")
  300. def add_fuzzy_quantization():
  301. add_leaner("Fuzzy_quantization")
  302. def add_mapzoom():
  303. add_leaner("Mapzoom")
  304. def add_sigmod_scaler():
  305. add_leaner("sigmodScaler")
  306. def add_decimal_scaler():
  307. add_leaner("decimalScaler")
  308. def add_atan_scaler():
  309. add_leaner("atanScaler")
  310. def add_log_scaler():
  311. add_leaner("LogScaler")
  312. def add_min_max_scaler():
  313. add_leaner("MinMaxScaler")
  314. def add_z_score():
  315. add_leaner("Z-Score")
  316. def add_forest():
  317. add_leaner("Forest")
  318. def add_forest_class():
  319. add_leaner("Forest_class")
  320. def add_tree_class():
  321. add_leaner("Tree_class")
  322. def add_tree():
  323. add_leaner("Tree")
  324. def add_select_k_best():
  325. add_leaner("SelectKBest")
  326. def add_knn_class():
  327. add_leaner("Knn_class")
  328. def add_logistic_regression():
  329. add_leaner("LogisticRegression")
  330. def add_lasso():
  331. add_leaner("Lasso")
  332. def add_variance():
  333. add_leaner("Variance")
  334. def add_knn():
  335. add_leaner("Knn")
  336. def add_ridge():
  337. add_leaner("Ridge")
  338. def add_line():
  339. add_leaner("Line")
  340. def add_select_from_model(): # 添加Lenear的核心
  341. learner_controller.add_select_from_model(
  342. get_learner(), parameters=get_learner_parameters()
  343. )
  344. update_leaner()
  345. def add_leaner(learner_type): # 添加Lenear的核心
  346. learner_controller.add_learner(learner_type, parameters=get_learner_parameters())
  347. update_leaner()
  348. def update_leaner():
  349. global learn_dict, learner_box
  350. learn_dict = learner_controller.return_learner()
  351. learner_box.delete(0, tkinter.END)
  352. learner_box.insert(tkinter.END, *learn_dict.keys())
  353. def to_html_one():
  354. global PATH, to_html_type
  355. html_dir = f"{PATH}/$Show_Sheet.html"
  356. try:
  357. name = get_name()
  358. if name is None:
  359. raise Exception
  360. learner_controller.to_html_one(name, html_dir)
  361. webbrowser.open(html_dir)
  362. except BaseException:
  363. # pass
  364. raise
  365. def to_html():
  366. global PATH, to_html_type
  367. html_dir = f"{PATH}/$Show_Sheet.html"
  368. try:
  369. name = get_name()
  370. if name is None:
  371. raise Exception
  372. learner_controller.to_html(name, html_dir, to_html_type.get())
  373. webbrowser.open(html_dir)
  374. except BaseException:
  375. pass
  376. def to_csv():
  377. global SCREEN, sep, encoding, dtype_str
  378. save_dir = asksaveasfilename(title="选择保存的CSV", filetypes=[("CSV", ".csv")])
  379. csv_sep = sep.get()
  380. name = get_name()
  381. learner_controller.to_csv(save_dir, name, csv_sep)
  382. update_sheet_box()
  383. def add_csv():
  384. global SCREEN, sep, encoding, dtype_str, sheet_name
  385. csv_dir = askopenfilename(title="选择载入的CSV", filetypes=[("CSV", ".csv")])
  386. if csv_dir == "":
  387. return False
  388. the_sep = sep.get()
  389. the_encoding = encoding.get()
  390. must_str = bool(dtype_str.get())
  391. name = sheet_name.get().replace(" ", "")
  392. if name == "":
  393. name = os.path.splitext(os.path.split(csv_dir)[1])[0]
  394. if the_encoding == "":
  395. with open(csv_dir, "rb") as f:
  396. the_encoding = chardet.detect(f.read())["encoding"]
  397. if the_sep == "":
  398. the_sep = ","
  399. learner_controller.read_csv(
  400. csv_dir, name, the_encoding, must_str, the_sep,
  401. )
  402. update_sheet_box()
  403. def add_python():
  404. global SCREEN, sep, encoding, dtype_str
  405. python_dir = askopenfilename(
  406. title="选择载入的py", filetypes=[("Python", ".py"), ("Txt", ".txt")]
  407. )
  408. name = sheet_name.get().replace(" ", "")
  409. if name == "":
  410. name = os.path.splitext(os.path.split(python_dir)[1])[0]
  411. with open(python_dir, "r") as f:
  412. learner_controller.add_python(f.read(), name)
  413. update_sheet_box()
  414. def get_name(get_from_box=True, is_x_data=True): # 获得名字统一接口
  415. global sheet_list, sheet_box, x_data
  416. if get_from_box:
  417. try:
  418. return sheet_list[sheet_box.curselection()[0]]
  419. except BaseException:
  420. try:
  421. return sheet_list[0]
  422. except BaseException:
  423. return None
  424. else:
  425. try:
  426. if is_x_data:
  427. return x_data.get()
  428. else:
  429. return y_data.get()
  430. except BaseException:
  431. return None
  432. def update_sheet_box():
  433. global SCREEN, sheet_box, sheet_list
  434. sheet_list = list(learner_controller.get_form().keys())
  435. sheet_box.delete(0, tkinter.END)
  436. sheet_box.insert(tkinter.END, *sheet_list)
  437. def creat_text_sheet(data, name):
  438. global bg_color
  439. new_top = tkinter.Toplevel(bg=bg_color)
  440. new_top.title(name)
  441. new_top.geometry("+10+10") # 设置所在位置
  442. text = ScrolledText(new_top, font=("黑体", 13), height=50)
  443. text.pack(fill=tkinter.BOTH)
  444. text.insert("0.0", data)
  445. text.config(state=tkinter.DISABLED)
  446. new_top.resizable(width=False, height=False)
  447. SCREEN.title("CoTan机器学习")
  448. SCREEN.resizable(width=False, height=False)
  449. SCREEN.geometry("+10+10") # 设置所在位置
  450. tkinter.Button(
  451. SCREEN,
  452. bg=botton_color,
  453. fg=word_color,
  454. text="导入CSV",
  455. command=add_csv,
  456. font=FONT,
  457. width=gui_width,
  458. height=gui_height,
  459. ).grid(
  460. column=column,
  461. row=row,
  462. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  463. )
  464. tkinter.Button(
  465. SCREEN,
  466. bg=botton_color,
  467. fg=word_color,
  468. text="导入Py",
  469. command=add_python,
  470. font=FONT,
  471. width=gui_width,
  472. height=gui_height,
  473. ).grid(
  474. column=column + 1,
  475. row=row,
  476. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  477. )
  478. tkinter.Button(
  479. SCREEN,
  480. bg=botton_color,
  481. fg=word_color,
  482. text="导出CSV",
  483. command=to_csv,
  484. font=FONT,
  485. width=gui_width,
  486. height=gui_height,
  487. ).grid(
  488. column=column + 2,
  489. row=row,
  490. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  491. )
  492. row += 1
  493. tkinter.Label(
  494. SCREEN,
  495. text="表格名称:",
  496. bg=bg_color,
  497. fg=word_color,
  498. font=FONT,
  499. width=gui_width,
  500. height=gui_height,
  501. ).grid(
  502. column=column, row=row
  503. ) # 设置说明
  504. sheet_name = tkinter.Entry(SCREEN, width=gui_width)
  505. sheet_name.grid(
  506. column=column + 1, row=row, columnspan=2, sticky=tkinter.E + tkinter.W
  507. )
  508. row += 1
  509. tkinter.Button(
  510. SCREEN,
  511. bg=botton_color,
  512. fg=word_color,
  513. text="删除表格",
  514. font=FONT,
  515. width=gui_width,
  516. height=gui_height,
  517. ).grid(
  518. column=column,
  519. row=row,
  520. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  521. )
  522. tkinter.Button(
  523. SCREEN,
  524. bg=botton_color,
  525. fg=word_color,
  526. text="查看表格",
  527. command=to_html,
  528. font=FONT,
  529. width=gui_width,
  530. height=gui_height,
  531. ).grid(
  532. column=column + 1,
  533. row=row,
  534. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  535. )
  536. tkinter.Button(
  537. SCREEN,
  538. bg=botton_color,
  539. fg=word_color,
  540. text="查看单一表格",
  541. command=to_html_one,
  542. font=FONT,
  543. width=gui_width,
  544. height=gui_height,
  545. ).grid(
  546. column=column + 2,
  547. row=row,
  548. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  549. )
  550. row += 1
  551. to_html_type = tkinter.IntVar() # 正,负,0
  552. lable = ["选项卡型", "可移动型", "自适应型"] # 复选框
  553. for i in range(3):
  554. tkinter.Radiobutton(
  555. SCREEN,
  556. bg=bg_color,
  557. fg=word_color,
  558. activebackground=bg_color,
  559. activeforeground=word_color,
  560. selectcolor=bg_color,
  561. text=lable[i],
  562. variable=to_html_type,
  563. value=i,
  564. ).grid(column=column + i, row=row, sticky=tkinter.W)
  565. dtype_str = tkinter.IntVar()
  566. row += 1
  567. tkinter.Label(
  568. SCREEN,
  569. text="编码方式:",
  570. bg=bg_color,
  571. fg=word_color,
  572. font=FONT,
  573. width=gui_width,
  574. height=gui_height,
  575. ).grid(
  576. column=column, row=row
  577. ) # 设置说明
  578. encoding = tkinter.Entry(SCREEN, width=gui_width)
  579. encoding.grid(column=column + 1, row=row, sticky=tkinter.E + tkinter.W)
  580. buttom = tkinter.Checkbutton(
  581. SCREEN,
  582. bg=bg_color,
  583. fg=word_color,
  584. activebackground=bg_color,
  585. activeforeground=word_color,
  586. selectcolor=bg_color,
  587. text="字符串类型",
  588. variable=dtype_str,
  589. )
  590. buttom.grid(column=column + 2, row=row, sticky=tkinter.W)
  591. row += 1
  592. tkinter.Label(
  593. SCREEN,
  594. text="CSV分隔符:",
  595. bg=bg_color,
  596. fg=word_color,
  597. font=FONT,
  598. width=gui_width,
  599. height=gui_height,
  600. ).grid(
  601. column=column, row=row
  602. ) # 设置说明
  603. sep = tkinter.Entry(SCREEN, width=gui_width)
  604. sep.grid(column=column + 1, columnspan=2, row=row, sticky=tkinter.E + tkinter.W)
  605. row += 1
  606. sheet_box = tkinter.Listbox(
  607. SCREEN, width=gui_width * 3, height=gui_height * 10
  608. ) # 显示符号
  609. sheet_box.grid(
  610. column=column,
  611. row=row,
  612. columnspan=3,
  613. rowspan=10,
  614. sticky=tkinter.E + tkinter.W + tkinter.S + tkinter.N,
  615. )
  616. # 422
  617. row += 10
  618. tkinter.Button(
  619. SCREEN,
  620. bg=botton_color,
  621. fg=word_color,
  622. text="添加数据",
  623. command=merge_add,
  624. font=FONT,
  625. width=gui_width,
  626. height=gui_height,
  627. ).grid(
  628. column=column,
  629. row=row,
  630. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  631. )
  632. tkinter.Button(
  633. SCREEN,
  634. bg=botton_color,
  635. fg=word_color,
  636. text="删除数据",
  637. command=merge_del,
  638. font=FONT,
  639. width=gui_width,
  640. height=gui_height,
  641. ).grid(
  642. column=column + 1,
  643. row=row,
  644. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  645. )
  646. tkinter.Button(
  647. SCREEN,
  648. bg=botton_color,
  649. fg=word_color,
  650. text="组合数据",
  651. command=merge,
  652. font=FONT,
  653. width=gui_width,
  654. height=gui_height,
  655. ).grid(
  656. column=column + 2,
  657. row=row,
  658. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  659. )
  660. row += 1
  661. merge_box = tkinter.Listbox(
  662. SCREEN, width=gui_width * 3, height=gui_height * 3
  663. ) # 显示符号
  664. merge_box.grid(
  665. column=column,
  666. row=row,
  667. columnspan=3,
  668. rowspan=3,
  669. sticky=tkinter.E + tkinter.W + tkinter.S + tkinter.N,
  670. )
  671. row += 3
  672. processing_type = tkinter.IntVar() # 正,负,0
  673. lable = ["横向处理", "纵向处理", "深度处理"] # 复选框
  674. for i in range(3):
  675. tkinter.Radiobutton(
  676. SCREEN,
  677. bg=bg_color,
  678. fg=word_color,
  679. activebackground=bg_color,
  680. activeforeground=word_color,
  681. selectcolor=bg_color,
  682. text=lable[i],
  683. variable=processing_type,
  684. value=i,
  685. ).grid(column=column + i, row=row, sticky=tkinter.W)
  686. row += 1
  687. tkinter.Button(
  688. SCREEN,
  689. bg=botton_color,
  690. fg=word_color,
  691. text="数据切片",
  692. command=two_split,
  693. font=FONT,
  694. width=gui_width,
  695. height=gui_height,
  696. ).grid(
  697. column=column,
  698. row=row,
  699. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  700. )
  701. tkinter.Button(
  702. SCREEN,
  703. bg=botton_color,
  704. fg=word_color,
  705. text="数据分割",
  706. command=split,
  707. font=FONT,
  708. width=gui_width,
  709. height=gui_height,
  710. ).grid(
  711. column=column + 1,
  712. row=row,
  713. columnspan=2,
  714. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  715. )
  716. row += 1
  717. tkinter.Label(
  718. SCREEN,
  719. text="重塑形状:",
  720. bg=bg_color,
  721. fg=word_color,
  722. font=FONT,
  723. width=gui_width,
  724. height=gui_height,
  725. ).grid(column=column, row=row)
  726. shape = tkinter.Entry(SCREEN, width=gui_width)
  727. shape.grid(column=column + 1, row=row, sticky=tkinter.E + tkinter.W)
  728. tkinter.Button(
  729. SCREEN,
  730. bg=botton_color,
  731. fg=word_color,
  732. text="矩阵重塑",
  733. command=reshape,
  734. font=FONT,
  735. width=gui_width,
  736. height=gui_height,
  737. ).grid(
  738. column=column + 2,
  739. row=row,
  740. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  741. )
  742. row += 1
  743. tkinter.Button(
  744. SCREEN,
  745. bg=botton_color,
  746. fg=word_color,
  747. text="矩阵伸展",
  748. command=reval,
  749. font=FONT,
  750. width=gui_width,
  751. height=gui_height,
  752. ).grid(
  753. column=column,
  754. row=row,
  755. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  756. )
  757. tkinter.Button(
  758. SCREEN,
  759. bg=botton_color,
  760. fg=word_color,
  761. text="矩阵降维",
  762. command=del_ndim,
  763. font=FONT,
  764. width=gui_width,
  765. height=gui_height,
  766. ).grid(
  767. column=column + 1,
  768. row=row,
  769. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  770. )
  771. tkinter.Button(
  772. SCREEN,
  773. bg=botton_color,
  774. fg=word_color,
  775. text="矩阵转置",
  776. command=transpose,
  777. font=FONT,
  778. width=gui_width,
  779. height=gui_height,
  780. ).grid(
  781. column=column + 2,
  782. row=row,
  783. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  784. )
  785. column += 3
  786. tkinter.Label(SCREEN, text="", bg=bg_color, fg=word_color, font=FONT, width=1).grid(
  787. column=column, row=row
  788. ) # 设置说明
  789. column += 1
  790. row = 0
  791. tkinter.Label(
  792. SCREEN,
  793. text="【机器学习】",
  794. bg=bg_color,
  795. fg=word_color,
  796. font=FONT,
  797. width=gui_width * 3,
  798. height=gui_height,
  799. ).grid(
  800. column=column,
  801. columnspan=3,
  802. row=row,
  803. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  804. ) # 设置说明
  805. row += 1
  806. x_data = tkinter.StringVar()
  807. put = tkinter.Entry(SCREEN, width=gui_width * 2, textvariable=x_data)
  808. put.grid(column=column, row=row, columnspan=2, sticky=tkinter.E + tkinter.W)
  809. put["state"] = "readonly"
  810. tkinter.Button(
  811. SCREEN,
  812. bg=botton_color,
  813. fg=word_color,
  814. text="选用X集",
  815. command=set_x_data,
  816. font=FONT,
  817. width=gui_width,
  818. height=gui_height,
  819. ).grid(column=column + 2, row=row, sticky=tkinter.E + tkinter.W)
  820. y_data = tkinter.StringVar()
  821. row += 1
  822. put = tkinter.Entry(SCREEN, width=gui_width * 2, textvariable=y_data)
  823. put.grid(column=column, row=row, columnspan=2, sticky=tkinter.E + tkinter.W)
  824. put["state"] = "readonly"
  825. tkinter.Button(
  826. SCREEN,
  827. bg=botton_color,
  828. fg=word_color,
  829. text="选用Y集",
  830. command=set_y_data,
  831. font=FONT,
  832. width=gui_width,
  833. height=gui_height,
  834. ).grid(column=column + 2, row=row, sticky=tkinter.E + tkinter.W)
  835. learner_output = tkinter.StringVar()
  836. row += 1
  837. put = tkinter.Entry(SCREEN, width=gui_width * 2, textvariable=learner_output)
  838. put.grid(column=column, row=row, columnspan=2, sticky=tkinter.E + tkinter.W)
  839. put["state"] = "readonly"
  840. tkinter.Button(
  841. SCREEN,
  842. bg=botton_color,
  843. fg=word_color,
  844. text="选用学习器",
  845. command=set_learner,
  846. font=FONT,
  847. width=gui_width,
  848. height=gui_height,
  849. ).grid(column=column + 2, row=row, sticky=tkinter.E + tkinter.W)
  850. row += 1
  851. tkinter.Label(
  852. SCREEN,
  853. text="测试数据分割:",
  854. bg=bg_color,
  855. fg=word_color,
  856. font=FONT,
  857. width=gui_width,
  858. height=gui_height,
  859. ).grid(column=column, row=row)
  860. data_split = tkinter.Entry(SCREEN, width=gui_width * 2)
  861. data_split.grid(
  862. column=column + 1, row=row, columnspan=2, sticky=tkinter.E + tkinter.W
  863. )
  864. row += 1
  865. learner_box = tkinter.Listbox(SCREEN, width=gui_width * 3, height=gui_height * 5)
  866. learner_box.grid(
  867. column=column,
  868. row=row,
  869. columnspan=3,
  870. rowspan=5,
  871. sticky=tkinter.E + tkinter.W + tkinter.S + tkinter.N,
  872. )
  873. row += 5
  874. tkinter.Button(
  875. SCREEN,
  876. bg=botton_color,
  877. fg=word_color,
  878. text="导入学习器",
  879. font=FONT,
  880. width=gui_width,
  881. height=gui_height,
  882. ).grid(
  883. column=column,
  884. row=row,
  885. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  886. )
  887. tkinter.Button(
  888. SCREEN,
  889. bg=botton_color,
  890. fg=word_color,
  891. text="查看数据",
  892. command=visualization_results,
  893. font=FONT,
  894. width=gui_width,
  895. height=gui_height,
  896. ).grid(
  897. column=column + 1,
  898. row=row,
  899. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  900. )
  901. tkinter.Button(
  902. SCREEN,
  903. bg=botton_color,
  904. fg=word_color,
  905. text="删除学习器",
  906. command=del_leaner,
  907. font=FONT,
  908. width=gui_width,
  909. height=gui_height,
  910. ).grid(
  911. column=column + 2,
  912. row=row,
  913. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  914. )
  915. row += 1
  916. tkinter.Button(
  917. SCREEN,
  918. bg=botton_color,
  919. fg=word_color,
  920. text="训练机器",
  921. command=fit_learner,
  922. font=FONT,
  923. width=gui_width,
  924. height=gui_height,
  925. ).grid(
  926. column=column,
  927. row=row,
  928. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  929. )
  930. tkinter.Button(
  931. SCREEN,
  932. bg=botton_color,
  933. fg=word_color,
  934. text="测试机器",
  935. command=score_learner,
  936. font=FONT,
  937. width=gui_width,
  938. height=gui_height,
  939. ).grid(
  940. column=column + 1,
  941. row=row,
  942. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  943. )
  944. tkinter.Button(
  945. SCREEN,
  946. bg=botton_color,
  947. fg=word_color,
  948. text="数据预测",
  949. command=predict_learner,
  950. font=FONT,
  951. width=gui_width,
  952. height=gui_height,
  953. ).grid(
  954. column=column + 2,
  955. row=row,
  956. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  957. )
  958. row += 1
  959. tkinter.Button(
  960. SCREEN,
  961. bg=botton_color,
  962. fg=word_color,
  963. text="单一变量特征选择",
  964. command=add_select_k_best,
  965. font=FONT,
  966. width=gui_width,
  967. height=gui_height,
  968. ).grid(
  969. column=column,
  970. row=row,
  971. columnspan=2,
  972. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  973. )
  974. tkinter.Button(
  975. SCREEN,
  976. bg=botton_color,
  977. fg=word_color,
  978. text="映射标准化",
  979. command=add_mapzoom,
  980. font=FONT,
  981. width=gui_width,
  982. height=gui_height,
  983. ).grid(
  984. column=column + 2,
  985. row=row,
  986. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  987. )
  988. row += 1
  989. tkinter.Button(
  990. SCREEN,
  991. bg=botton_color,
  992. fg=word_color,
  993. text="方差特征选择",
  994. command=add_variance,
  995. font=FONT,
  996. width=gui_width,
  997. height=gui_height,
  998. ).grid(
  999. column=column,
  1000. row=row,
  1001. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1002. )
  1003. tkinter.Button(
  1004. SCREEN,
  1005. bg=botton_color,
  1006. fg=word_color,
  1007. text="使用学习器筛选",
  1008. command=add_select_from_model,
  1009. font=FONT,
  1010. width=gui_width,
  1011. height=gui_height,
  1012. ).grid(
  1013. column=column + 1,
  1014. row=row,
  1015. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1016. )
  1017. tkinter.Button(
  1018. SCREEN,
  1019. bg=botton_color,
  1020. fg=word_color,
  1021. text="模糊量化标准化",
  1022. command=add_fuzzy_quantization,
  1023. font=FONT,
  1024. width=gui_width,
  1025. height=gui_height,
  1026. ).grid(
  1027. column=column + 2,
  1028. row=row,
  1029. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1030. )
  1031. row += 1
  1032. tkinter.Button(
  1033. SCREEN,
  1034. bg=botton_color,
  1035. fg=word_color,
  1036. text="Z-score",
  1037. command=add_z_score,
  1038. font=FONT,
  1039. width=gui_width,
  1040. height=gui_height,
  1041. ).grid(
  1042. column=column,
  1043. row=row,
  1044. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1045. )
  1046. tkinter.Button(
  1047. SCREEN,
  1048. bg=botton_color,
  1049. fg=word_color,
  1050. text="离差标准化",
  1051. command=add_min_max_scaler,
  1052. font=FONT,
  1053. width=gui_width,
  1054. height=gui_height,
  1055. ).grid(
  1056. column=column + 1,
  1057. row=row,
  1058. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1059. )
  1060. tkinter.Button(
  1061. SCREEN,
  1062. bg=botton_color,
  1063. fg=word_color,
  1064. text="Log变换",
  1065. command=add_log_scaler,
  1066. font=FONT,
  1067. width=gui_width,
  1068. height=gui_height,
  1069. ).grid(
  1070. column=column + 2,
  1071. row=row,
  1072. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1073. )
  1074. row += 1
  1075. tkinter.Button(
  1076. SCREEN,
  1077. bg=botton_color,
  1078. fg=word_color,
  1079. text="atan变换",
  1080. command=add_atan_scaler,
  1081. font=FONT,
  1082. width=gui_width,
  1083. height=gui_height,
  1084. ).grid(
  1085. column=column,
  1086. row=row,
  1087. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1088. )
  1089. tkinter.Button(
  1090. SCREEN,
  1091. bg=botton_color,
  1092. fg=word_color,
  1093. text="小数定标准化",
  1094. command=add_decimal_scaler,
  1095. font=FONT,
  1096. width=gui_width,
  1097. height=gui_height,
  1098. ).grid(
  1099. column=column + 1,
  1100. row=row,
  1101. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1102. )
  1103. tkinter.Button(
  1104. SCREEN,
  1105. bg=botton_color,
  1106. fg=word_color,
  1107. text="Sigmod变换",
  1108. command=add_sigmod_scaler,
  1109. font=FONT,
  1110. width=gui_width,
  1111. height=gui_height,
  1112. ).grid(
  1113. column=column + 2,
  1114. row=row,
  1115. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1116. )
  1117. row += 1
  1118. tkinter.Button(
  1119. SCREEN,
  1120. bg=botton_color,
  1121. fg=word_color,
  1122. text="正则化",
  1123. command=add_regularization,
  1124. font=FONT,
  1125. width=gui_width,
  1126. height=gui_height,
  1127. ).grid(
  1128. column=column,
  1129. row=row,
  1130. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1131. )
  1132. tkinter.Button(
  1133. SCREEN,
  1134. bg=botton_color,
  1135. fg=word_color,
  1136. text="二值离散",
  1137. command=add_binarizer,
  1138. font=FONT,
  1139. width=gui_width,
  1140. height=gui_height,
  1141. ).grid(
  1142. column=column + 1,
  1143. row=row,
  1144. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1145. )
  1146. tkinter.Button(
  1147. SCREEN,
  1148. bg=botton_color,
  1149. fg=word_color,
  1150. text="多值离散",
  1151. command=add_discretization,
  1152. font=FONT,
  1153. width=gui_width,
  1154. height=gui_height,
  1155. ).grid(
  1156. column=column + 2,
  1157. row=row,
  1158. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1159. )
  1160. row += 1
  1161. tkinter.Button(
  1162. SCREEN,
  1163. bg=botton_color,
  1164. fg=word_color,
  1165. text="独热编码",
  1166. command=add_one_hot_encoder,
  1167. font=FONT,
  1168. width=gui_width,
  1169. height=gui_height,
  1170. ).grid(
  1171. column=column,
  1172. row=row,
  1173. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1174. )
  1175. tkinter.Button(
  1176. SCREEN,
  1177. bg=botton_color,
  1178. fg=word_color,
  1179. text="数字编码",
  1180. command=add_label,
  1181. font=FONT,
  1182. width=gui_width,
  1183. height=gui_height,
  1184. ).grid(
  1185. column=column + 1,
  1186. row=row,
  1187. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1188. )
  1189. tkinter.Button(
  1190. SCREEN,
  1191. bg=botton_color,
  1192. fg=word_color,
  1193. text="缺失填充",
  1194. command=add_missed,
  1195. font=FONT,
  1196. width=gui_width,
  1197. height=gui_height,
  1198. ).grid(
  1199. column=column + 2,
  1200. row=row,
  1201. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1202. )
  1203. row += 1
  1204. tkinter.Button(
  1205. SCREEN,
  1206. bg=botton_color,
  1207. fg=word_color,
  1208. text="PCA降维",
  1209. command=add_pca,
  1210. font=FONT,
  1211. width=gui_width,
  1212. height=gui_height,
  1213. ).grid(
  1214. column=column,
  1215. row=row,
  1216. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1217. )
  1218. tkinter.Button(
  1219. SCREEN,
  1220. bg=botton_color,
  1221. fg=word_color,
  1222. text="RPCA降维",
  1223. command=add_rpca,
  1224. font=FONT,
  1225. width=gui_width,
  1226. height=gui_height,
  1227. ).grid(
  1228. column=column + 1,
  1229. row=row,
  1230. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1231. )
  1232. tkinter.Button(
  1233. SCREEN,
  1234. bg=botton_color,
  1235. fg=word_color,
  1236. text="KPCA升维",
  1237. command=add_kpca,
  1238. font=FONT,
  1239. width=gui_width,
  1240. height=gui_height,
  1241. ).grid(
  1242. column=column + 2,
  1243. row=row,
  1244. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1245. )
  1246. row += 1
  1247. tkinter.Button(
  1248. SCREEN,
  1249. bg=botton_color,
  1250. fg=word_color,
  1251. text="LDA降维",
  1252. command=add_lda,
  1253. font=FONT,
  1254. width=gui_width,
  1255. height=gui_height,
  1256. ).grid(
  1257. column=column,
  1258. row=row,
  1259. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1260. )
  1261. tkinter.Button(
  1262. SCREEN,
  1263. bg=botton_color,
  1264. fg=word_color,
  1265. text="NMF降维",
  1266. command=add_nmf,
  1267. font=FONT,
  1268. width=gui_width,
  1269. height=gui_height,
  1270. ).grid(
  1271. column=column + 1,
  1272. row=row,
  1273. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1274. )
  1275. tkinter.Button(
  1276. SCREEN,
  1277. bg=botton_color,
  1278. fg=word_color,
  1279. text="t-SNE",
  1280. command=add_tsne,
  1281. font=FONT,
  1282. width=gui_width,
  1283. height=gui_height,
  1284. ).grid(
  1285. column=column + 2,
  1286. row=row,
  1287. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1288. )
  1289. row += 1
  1290. tkinter.Button(
  1291. SCREEN,
  1292. bg=botton_color,
  1293. fg=word_color,
  1294. text="线性回归",
  1295. command=add_line,
  1296. font=FONT,
  1297. width=gui_width,
  1298. height=gui_height,
  1299. ).grid(
  1300. column=column,
  1301. row=row,
  1302. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1303. )
  1304. tkinter.Button(
  1305. SCREEN,
  1306. bg=botton_color,
  1307. fg=word_color,
  1308. text="岭回归",
  1309. command=add_ridge,
  1310. font=FONT,
  1311. width=gui_width,
  1312. height=gui_height,
  1313. ).grid(
  1314. column=column + 1,
  1315. row=row,
  1316. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1317. )
  1318. tkinter.Button(
  1319. SCREEN,
  1320. bg=botton_color,
  1321. fg=word_color,
  1322. text="Lasso",
  1323. command=add_lasso,
  1324. font=FONT,
  1325. width=gui_width,
  1326. height=gui_height,
  1327. ).grid(
  1328. column=column + 2,
  1329. row=row,
  1330. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1331. )
  1332. row += 1
  1333. tkinter.Button(
  1334. SCREEN,
  1335. bg=botton_color,
  1336. fg=word_color,
  1337. text="逻辑回归",
  1338. command=add_logistic_regression,
  1339. font=FONT,
  1340. width=gui_width,
  1341. height=gui_height,
  1342. ).grid(
  1343. column=column,
  1344. row=row,
  1345. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1346. )
  1347. tkinter.Button(
  1348. SCREEN,
  1349. bg=botton_color,
  1350. fg=word_color,
  1351. text="K邻近预测",
  1352. command=add_knn,
  1353. font=FONT,
  1354. width=gui_width,
  1355. height=gui_height,
  1356. ).grid(
  1357. column=column + 1,
  1358. row=row,
  1359. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1360. )
  1361. tkinter.Button(
  1362. SCREEN,
  1363. bg=botton_color,
  1364. fg=word_color,
  1365. text="K邻近分类",
  1366. command=add_knn_class,
  1367. font=FONT,
  1368. width=gui_width,
  1369. height=gui_height,
  1370. ).grid(
  1371. column=column + 2,
  1372. row=row,
  1373. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1374. )
  1375. row += 1
  1376. tkinter.Button(
  1377. SCREEN,
  1378. bg=botton_color,
  1379. fg=word_color,
  1380. text="梯度回归树回归",
  1381. command=add_gradient_tree,
  1382. font=FONT,
  1383. width=gui_width,
  1384. height=gui_height,
  1385. ).grid(
  1386. column=column,
  1387. row=row,
  1388. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1389. )
  1390. tkinter.Button(
  1391. SCREEN,
  1392. bg=botton_color,
  1393. fg=word_color,
  1394. text="决策树回归",
  1395. command=add_tree,
  1396. font=FONT,
  1397. width=gui_width,
  1398. height=gui_height,
  1399. ).grid(
  1400. column=column + 1,
  1401. row=row,
  1402. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1403. )
  1404. tkinter.Button(
  1405. SCREEN,
  1406. bg=botton_color,
  1407. fg=word_color,
  1408. text="决策树分类",
  1409. command=add_tree_class,
  1410. font=FONT,
  1411. width=gui_width,
  1412. height=gui_height,
  1413. ).grid(
  1414. column=column + 2,
  1415. row=row,
  1416. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1417. )
  1418. row += 1
  1419. tkinter.Button(
  1420. SCREEN,
  1421. bg=botton_color,
  1422. fg=word_color,
  1423. text="梯度回归树分类",
  1424. command=add_gradient_tree_class,
  1425. font=FONT,
  1426. width=gui_width,
  1427. height=gui_height,
  1428. ).grid(
  1429. column=column,
  1430. row=row,
  1431. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1432. )
  1433. tkinter.Button(
  1434. SCREEN,
  1435. bg=botton_color,
  1436. fg=word_color,
  1437. text="随机森林回归",
  1438. command=add_forest,
  1439. font=FONT,
  1440. width=gui_width,
  1441. height=gui_height,
  1442. ).grid(
  1443. column=column + 1,
  1444. row=row,
  1445. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1446. )
  1447. tkinter.Button(
  1448. SCREEN,
  1449. bg=botton_color,
  1450. fg=word_color,
  1451. text="随机森林分类",
  1452. command=add_forest_class,
  1453. font=FONT,
  1454. width=gui_width,
  1455. height=gui_height,
  1456. ).grid(
  1457. column=column + 2,
  1458. row=row,
  1459. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1460. )
  1461. column += 3
  1462. tkinter.Label(SCREEN, text="", bg=bg_color, fg=word_color, font=FONT, width=1).grid(
  1463. column=column, row=row
  1464. ) # 设置说明
  1465. column += 1
  1466. row = 0
  1467. tkinter.Button(
  1468. SCREEN,
  1469. bg=botton_color,
  1470. fg=word_color,
  1471. text="多层感知机回归",
  1472. command=add_mlp,
  1473. font=FONT,
  1474. width=gui_width,
  1475. height=gui_height,
  1476. ).grid(
  1477. column=column,
  1478. row=row,
  1479. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1480. )
  1481. tkinter.Button(
  1482. SCREEN,
  1483. bg=botton_color,
  1484. fg=word_color,
  1485. text="多层感知机分类",
  1486. command=add_mlp_class,
  1487. font=FONT,
  1488. width=gui_width,
  1489. height=gui_height,
  1490. ).grid(
  1491. column=column + 1,
  1492. row=row,
  1493. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1494. )
  1495. tkinter.Button(
  1496. SCREEN,
  1497. bg=botton_color,
  1498. fg=word_color,
  1499. text="随机森林分类",
  1500. command=add_forest_class,
  1501. font=FONT,
  1502. width=gui_width,
  1503. height=gui_height,
  1504. ).grid(
  1505. column=column + 2,
  1506. row=row,
  1507. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1508. )
  1509. row += 1
  1510. tkinter.Button(
  1511. SCREEN,
  1512. bg=botton_color,
  1513. fg=word_color,
  1514. text="支持向量机分类:SVC",
  1515. command=add_svc,
  1516. font=FONT,
  1517. width=gui_width,
  1518. height=gui_height,
  1519. ).grid(
  1520. column=column,
  1521. row=row,
  1522. columnspan=2,
  1523. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1524. )
  1525. tkinter.Button(
  1526. SCREEN,
  1527. bg=botton_color,
  1528. fg=word_color,
  1529. text="回归:SVR",
  1530. command=add_svr,
  1531. font=FONT,
  1532. width=gui_width,
  1533. height=gui_height,
  1534. ).grid(
  1535. column=column + 2,
  1536. row=row,
  1537. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1538. )
  1539. row += 1
  1540. tkinter.Button(
  1541. SCREEN,
  1542. bg=botton_color,
  1543. fg=word_color,
  1544. text="k-means",
  1545. command=add_k_means,
  1546. font=FONT,
  1547. width=gui_width,
  1548. height=gui_height,
  1549. ).grid(
  1550. column=column,
  1551. row=row,
  1552. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1553. )
  1554. tkinter.Button(
  1555. SCREEN,
  1556. bg=botton_color,
  1557. fg=word_color,
  1558. text="凝聚聚类",
  1559. command=add_agglomerative,
  1560. font=FONT,
  1561. width=gui_width,
  1562. height=gui_height,
  1563. ).grid(
  1564. column=column + 1,
  1565. row=row,
  1566. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1567. )
  1568. tkinter.Button(
  1569. SCREEN,
  1570. bg=botton_color,
  1571. fg=word_color,
  1572. text="DBSCAN",
  1573. command=add_dbscan,
  1574. font=FONT,
  1575. width=gui_width,
  1576. height=gui_height,
  1577. ).grid(
  1578. column=column + 2,
  1579. row=row,
  1580. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1581. )
  1582. row += 1
  1583. tkinter.Button(
  1584. SCREEN,
  1585. bg=botton_color,
  1586. fg=word_color,
  1587. text="特征分类图",
  1588. command=add_class_bar,
  1589. font=FONT,
  1590. width=gui_width,
  1591. height=gui_height,
  1592. ).grid(
  1593. column=column,
  1594. row=row,
  1595. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1596. )
  1597. tkinter.Button(
  1598. SCREEN,
  1599. bg=botton_color,
  1600. fg=word_color,
  1601. text="临近特征回归图",
  1602. command=add_feature_scatter,
  1603. font=FONT,
  1604. width=gui_width,
  1605. height=gui_height,
  1606. ).grid(
  1607. column=column + 1,
  1608. row=row,
  1609. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1610. )
  1611. tkinter.Button(
  1612. SCREEN,
  1613. bg=botton_color,
  1614. fg=word_color,
  1615. text="临近特征分类图",
  1616. command=add_feature_scatter_class,
  1617. font=FONT,
  1618. width=gui_width,
  1619. height=gui_height,
  1620. ).grid(
  1621. column=column + 2,
  1622. row=row,
  1623. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1624. )
  1625. row += 1
  1626. tkinter.Button(
  1627. SCREEN,
  1628. bg=botton_color,
  1629. fg=word_color,
  1630. text="所有特征回归图",
  1631. command=add_feature_scatter_all,
  1632. font=FONT,
  1633. width=gui_width,
  1634. height=gui_height,
  1635. ).grid(
  1636. column=column,
  1637. row=row,
  1638. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1639. )
  1640. tkinter.Button(
  1641. SCREEN,
  1642. bg=botton_color,
  1643. fg=word_color,
  1644. text="所有特征分类图",
  1645. command=add_feature_scatter_class_all,
  1646. font=FONT,
  1647. width=gui_width,
  1648. height=gui_height,
  1649. ).grid(
  1650. column=column + 1,
  1651. row=row,
  1652. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1653. )
  1654. tkinter.Button(
  1655. SCREEN,
  1656. bg=botton_color,
  1657. fg=word_color,
  1658. text="临近特征预测图",
  1659. command=add_predictive_heatmap,
  1660. font=FONT,
  1661. width=gui_width,
  1662. height=gui_height,
  1663. ).grid(
  1664. column=column + 2,
  1665. row=row,
  1666. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1667. )
  1668. row += 1
  1669. tkinter.Button(
  1670. SCREEN,
  1671. bg=botton_color,
  1672. fg=word_color,
  1673. text="所有特征预测图",
  1674. command=add_predictive_heatmap_more,
  1675. font=FONT,
  1676. width=gui_width,
  1677. height=gui_height,
  1678. ).grid(
  1679. column=column,
  1680. row=row,
  1681. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1682. )
  1683. tkinter.Button(
  1684. SCREEN,
  1685. bg=botton_color,
  1686. fg=word_color,
  1687. text="矩阵热力图",
  1688. command=add_numpy_to_heatmap,
  1689. font=FONT,
  1690. width=gui_width,
  1691. height=gui_height,
  1692. ).grid(
  1693. column=column + 1,
  1694. row=row,
  1695. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1696. )
  1697. tkinter.Button(
  1698. SCREEN,
  1699. bg=botton_color,
  1700. fg=word_color,
  1701. text="数据y-x散点图",
  1702. command=add_feature_y_x,
  1703. font=FONT,
  1704. width=gui_width,
  1705. height=gui_height,
  1706. ).grid(
  1707. column=column + 2,
  1708. row=row,
  1709. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1710. )
  1711. row += 1
  1712. tkinter.Button(
  1713. SCREEN,
  1714. bg=botton_color,
  1715. fg=word_color,
  1716. text="聚类树状图",
  1717. command=add_cluster_tree,
  1718. font=FONT,
  1719. width=gui_width,
  1720. height=gui_height,
  1721. ).grid(
  1722. column=column,
  1723. row=row,
  1724. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1725. )
  1726. tkinter.Button(
  1727. SCREEN,
  1728. bg=botton_color,
  1729. fg=word_color,
  1730. text="获取数据",
  1731. command=add_view_data,
  1732. font=FONT,
  1733. width=gui_width,
  1734. height=gui_height,
  1735. ).grid(
  1736. column=column + 1,
  1737. row=row,
  1738. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1739. )
  1740. tkinter.Button(
  1741. SCREEN,
  1742. bg=botton_color,
  1743. fg=word_color,
  1744. text="矩阵散点图",
  1745. command=add_matrix_scatter,
  1746. font=FONT,
  1747. width=gui_width,
  1748. height=gui_height,
  1749. ).grid(
  1750. column=column + 2,
  1751. row=row,
  1752. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1753. )
  1754. row += 1
  1755. tkinter.Button(
  1756. SCREEN,
  1757. bg=botton_color,
  1758. fg=word_color,
  1759. text="特征相关性",
  1760. command=add_correlation,
  1761. font=FONT,
  1762. width=gui_width,
  1763. height=gui_height,
  1764. ).grid(
  1765. column=column,
  1766. row=row,
  1767. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1768. )
  1769. tkinter.Button(
  1770. SCREEN,
  1771. bg=botton_color,
  1772. fg=word_color,
  1773. text="曲线拟合",
  1774. command=curve_fitting,
  1775. font=FONT,
  1776. width=gui_width,
  1777. height=gui_height,
  1778. ).grid(
  1779. column=column + 1,
  1780. row=row,
  1781. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1782. )
  1783. tkinter.Button(
  1784. SCREEN,
  1785. bg=botton_color,
  1786. fg=word_color,
  1787. text="快速傅里叶",
  1788. command=add_fast_fourier,
  1789. font=FONT,
  1790. width=gui_width,
  1791. height=gui_height,
  1792. ).grid(
  1793. column=column + 2,
  1794. row=row,
  1795. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1796. )
  1797. row += 1
  1798. tkinter.Button(
  1799. SCREEN,
  1800. bg=botton_color,
  1801. fg=word_color,
  1802. text="数据统计",
  1803. command=add_statistics,
  1804. font=FONT,
  1805. width=gui_width,
  1806. height=gui_height,
  1807. ).grid(
  1808. column=column,
  1809. row=row,
  1810. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1811. )
  1812. tkinter.Button(
  1813. SCREEN,
  1814. bg=botton_color,
  1815. fg=word_color,
  1816. text="双逆向傅里叶",
  1817. command=add_reverse_fast_fourier2,
  1818. font=FONT,
  1819. width=gui_width,
  1820. height=gui_height,
  1821. ).grid(
  1822. column=column + 1,
  1823. row=row,
  1824. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1825. )
  1826. tkinter.Button(
  1827. SCREEN,
  1828. bg=botton_color,
  1829. fg=word_color,
  1830. text="逆向傅里叶",
  1831. command=add_reverse_fast_fourier,
  1832. font=FONT,
  1833. width=gui_width,
  1834. height=gui_height,
  1835. ).grid(
  1836. column=column + 2,
  1837. row=row,
  1838. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1839. )
  1840. row += 1
  1841. tkinter.Button(
  1842. SCREEN,
  1843. bg=botton_color,
  1844. fg=word_color,
  1845. text="分类模型评估",
  1846. command=show_class_score,
  1847. font=FONT,
  1848. width=gui_width,
  1849. height=gui_height,
  1850. ).grid(
  1851. column=column,
  1852. row=row,
  1853. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1854. )
  1855. tkinter.Button(
  1856. SCREEN,
  1857. bg=botton_color,
  1858. fg=word_color,
  1859. text="回归模型评估",
  1860. command=show_regression_score,
  1861. font=FONT,
  1862. width=gui_width,
  1863. height=gui_height,
  1864. ).grid(
  1865. column=column + 1,
  1866. row=row,
  1867. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1868. )
  1869. tkinter.Button(
  1870. SCREEN,
  1871. bg=botton_color,
  1872. fg=word_color,
  1873. text="聚类模型评估",
  1874. command=show_clustering_score,
  1875. font=FONT,
  1876. width=gui_width,
  1877. height=gui_height,
  1878. ).grid(
  1879. column=column + 2,
  1880. row=row,
  1881. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1882. )
  1883. row += 1
  1884. tkinter.Label(
  1885. SCREEN,
  1886. text="【学习器配置】",
  1887. bg=bg_color,
  1888. fg=word_color,
  1889. font=FONT,
  1890. width=gui_width * 3,
  1891. height=gui_height,
  1892. ).grid(
  1893. column=column,
  1894. columnspan=3,
  1895. row=row,
  1896. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1897. ) # 设置说明
  1898. row += 1
  1899. global_settings = []
  1900. lable = ["聚类仅邻近特征", "导出单独页面", "导出表格CSV"] # 复选框
  1901. for i in range(3):
  1902. global_settings.append(tkinter.IntVar())
  1903. tkinter.Checkbutton(
  1904. SCREEN,
  1905. bg=bg_color,
  1906. fg=word_color,
  1907. activebackground=bg_color,
  1908. activeforeground=word_color,
  1909. selectcolor=bg_color,
  1910. text=lable[i],
  1911. variable=global_settings[-1],
  1912. command=global_seeting,
  1913. ).grid(column=column + i, row=row, sticky=tkinter.W)
  1914. row += 1
  1915. lable = ["导出模型", "压缩为tar.gz", "创建新目录"] # 复选框
  1916. for i in range(3):
  1917. global_settings.append(tkinter.IntVar())
  1918. tkinter.Checkbutton(
  1919. SCREEN,
  1920. bg=bg_color,
  1921. fg=word_color,
  1922. activebackground=bg_color,
  1923. activeforeground=word_color,
  1924. selectcolor=bg_color,
  1925. text=lable[i],
  1926. variable=global_settings[-1],
  1927. command=global_seeting,
  1928. ).grid(column=column + i, row=row, sticky=tkinter.W)
  1929. for i in global_settings[1:]:
  1930. i.set(1)
  1931. global_seeting()
  1932. row += 1
  1933. learner_parameters = tkinter.Text(
  1934. SCREEN, width=gui_width * 3, height=gui_height * 6
  1935. )
  1936. learner_parameters.grid(
  1937. column=column,
  1938. row=row,
  1939. columnspan=3,
  1940. rowspan=6,
  1941. sticky=tkinter.E + tkinter.W + tkinter.N + tkinter.S,
  1942. )
  1943. row += 6
  1944. tkinter.Label(
  1945. SCREEN,
  1946. text="【矩阵运算】",
  1947. bg=bg_color,
  1948. fg=word_color,
  1949. font=FONT,
  1950. width=gui_width * 3,
  1951. height=gui_height,
  1952. ).grid(
  1953. column=column,
  1954. columnspan=3,
  1955. row=row,
  1956. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  1957. ) # 设置说明
  1958. row += 1
  1959. calculation_box = tkinter.Listbox(
  1960. SCREEN, width=gui_width * 3, height=gui_height * 1
  1961. )
  1962. calculation_box.grid(
  1963. column=column,
  1964. row=row,
  1965. columnspan=3,
  1966. rowspan=1,
  1967. sticky=tkinter.E + tkinter.W + tkinter.S + tkinter.N,
  1968. )
  1969. row += 1
  1970. tkinter.Label(
  1971. SCREEN,
  1972. text="运算类型:",
  1973. bg=bg_color,
  1974. fg=word_color,
  1975. font=FONT,
  1976. width=gui_width,
  1977. height=gui_height,
  1978. ).grid(column=column, row=row)
  1979. calculation_type = tkinter.Entry(SCREEN, width=gui_width * 2)
  1980. calculation_type.grid(
  1981. column=column + 1, row=row, columnspan=2, sticky=tkinter.E + tkinter.W
  1982. )
  1983. row += 1
  1984. tkinter.Label(
  1985. SCREEN,
  1986. text="键入参数:",
  1987. bg=bg_color,
  1988. fg=word_color,
  1989. font=FONT,
  1990. width=gui_width,
  1991. height=gui_height,
  1992. ).grid(column=column, row=row)
  1993. value = tkinter.Entry(SCREEN, width=gui_width * 2)
  1994. value.grid(column=column + 1, row=row, columnspan=2, sticky=tkinter.E + tkinter.W)
  1995. row += 1
  1996. tkinter.Button(
  1997. SCREEN,
  1998. bg=botton_color,
  1999. fg=word_color,
  2000. text="选择参数",
  2001. command=add_calculation_object,
  2002. font=FONT,
  2003. width=gui_width,
  2004. height=gui_height,
  2005. ).grid(
  2006. column=column,
  2007. row=row,
  2008. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  2009. )
  2010. tkinter.Button(
  2011. SCREEN,
  2012. bg=botton_color,
  2013. fg=word_color,
  2014. text="键入参数",
  2015. command=add_calculation_number,
  2016. font=FONT,
  2017. width=gui_width,
  2018. height=gui_height,
  2019. ).grid(
  2020. column=column + 1,
  2021. row=row,
  2022. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  2023. )
  2024. tkinter.Button(
  2025. SCREEN,
  2026. bg=botton_color,
  2027. fg=word_color,
  2028. text="矩阵运算",
  2029. command=calculation,
  2030. font=FONT,
  2031. width=gui_width,
  2032. height=gui_height,
  2033. ).grid(
  2034. column=column + 2,
  2035. row=row,
  2036. sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
  2037. )