MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / MachineLearningGUI

Function MachineLearningGUI

DemoPrograms/Demo_Machine_Learning.py:12–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def MachineLearningGUI():
13 sg.set_options(text_justification='right')
14
15 flags = [[sg.CB('Normalize', size=(12, 1), default=True), sg.CB('Verbose', size=(20, 1))],
16 [sg.CB('Cluster', size=(12, 1)), sg.CB(
17 'Flush Output', size=(20, 1), default=True)],
18 [sg.CB('Write Results', size=(12, 1)), sg.CB(
19 'Keep Intermediate Data', size=(20, 1))],
20 [sg.CB('Normalize', size=(12, 1), default=True),
21 sg.CB('Verbose', size=(20, 1))],
22 [sg.CB('Cluster', size=(12, 1)), sg.CB(
23 'Flush Output', size=(20, 1), default=True)],
24 [sg.CB('Write Results', size=(12, 1)), sg.CB('Keep Intermediate Data', size=(20, 1))], ]
25
26 loss_functions = [[sg.Rad('Cross-Entropy', 'loss', size=(12, 1)), sg.Rad('Logistic', 'loss', default=True, size=(12, 1))],
27 [sg.Rad('Hinge', 'loss', size=(12, 1)),
28 sg.Rad('Huber', 'loss', size=(12, 1))],
29 [sg.Rad('Kullerback', 'loss', size=(12, 1)),
30 sg.Rad('MAE(L1)', 'loss', size=(12, 1))],
31 [sg.Rad('MSE(L2)', 'loss', size=(12, 1)), sg.Rad('MB(L0)', 'loss', size=(12, 1))], ]
32
33 command_line_parms = [[sg.Text('Passes', size=(8, 1)), sg.Spin(values=[i for i in range(1, 1000)], initial_value=20, size=(6, 1)),
34 sg.Text('Steps', size=(8, 1), pad=((7, 3))), sg.Spin(values=[i for i in range(1, 1000)], initial_value=20, size=(6, 1))],
35 [sg.Text('ooa', size=(8, 1)), sg.Input(default_text='6', size=(8, 1)), sg.Text('nn', size=(8, 1)),
36 sg.Input(default_text='10', size=(10, 1))],
37 [sg.Text('q', size=(8, 1)), sg.Input(default_text='ff', size=(8, 1)), sg.Text('ngram', size=(8, 1)),
38 sg.Input(default_text='5', size=(10, 1))],
39 [sg.Text('l', size=(8, 1)), sg.Input(default_text='0.4', size=(8, 1)), sg.Text('Layers', size=(8, 1)),
40 sg.Drop(values=('BatchNorm', 'other'))], ]
41
42 layout = [[sg.Frame('Command Line Parameteres', command_line_parms, title_color='green', font='Any 12')],
43 [sg.Frame('Flags', flags, font='Any 12', title_color='blue')],
44 [sg.Frame('Loss Functions', loss_functions,
45 font='Any 12', title_color='red')],
46 [sg.Submit(), sg.Cancel()]]
47
48 sg.set_options(text_justification='left')
49
50 window = sg.Window('Machine Learning Front End',
51 layout, font=("Helvetica", 12))
52 button, values = window.read()
53 window.close()
54 print(button, values)
55
56
57def CustomMeter():

Callers 1

Calls 2

readMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected