-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGSI.py
127 lines (88 loc) · 21.3 KB
/
GSI.py
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
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import numpy as np
from tkinter import*
import tkinter as tk
root=Tk()
root.geometry("400x300+10+10")
root.configure(background = "powderblue")
root.title("GSI")
lbl1=Label(root, text="Block volume", font=("arial", 15, "bold"), bg="powderblue")
lbl1.place(x=10,y=50)
lbl2=Label(root, text="Joint condition", font=("arial", 15, "bold"), bg="powderblue")
lbl2.place(x=10,y=100)
t1= Entry(root, bd=3,font=("arial", 12, "bold"))
t1.place(x=200, y=50)
t2= Entry(root, bd=3,font=("arial", 12, "bold"))
t2.place(x=200, y=100)
t3= Entry(root, bd=3,font=("arial", 12, "bold"))
t3.place(x=10, y=200)
t4= Entry(root, bd=3,font=("arial", 12, "bold"))
t4.place(x=200, y=200)
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import adam_v2
from keras.callbacks import EarlyStopping
import pandas as pd
import sklearn
from sklearn.preprocessing import StandardScaler
#from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score
#data
df21=[0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 100]
df11 = [[0.1, -2], [0.141586342, -0.999628744], [0.101118881, 0.459652469], [0.126563613, -0.457900011], [0.112897931, 0.034892797], [0.15311116, -1.41522066], [0.148159631, -1.236665526], [0.13668143, -0.822754629], [0.138664841, -0.894277628], [0.144300546, -1.097504582], [0.109457158, 0.158969151], [0.119669819, -0.209305593], [0.100800654, 0.471127945], [0.145253474, -1.131867731], [0.146155338, -1.16438948], [0.107760679, 0.2201452], [0.153017849, -1.41185579], [0.11773794, -0.139640867], [0.133878758, -0.72168857], [0.153810328, -1.440433077], [0.101534802, 0.444654118], [0.130748176, -0.608797889], [0.150874233, -1.334555717], [0.101060317, 0.461764339], [0.166185436, -1.886686985], [0.152289645, -1.385596329], [0.163020799, -1.772568251], [0.113138609, 0.026213789], [0.13681892, -0.827712583], [0.118865124, -0.180287821], [0.112841703, 0.036920407], [0.222465661, -1.332793051], [0.164179149, 0.396204557], [0.135428335, 1.249062076], [0.113899646, 1.887684109], [0.237143323, -1.768187808], [0.142324382, 1.044499329], [0.109768661, 2.0102247], [0.19339761, -0.470525103], [0.166279286, 0.333906595], [0.174619925, 0.086491809], [0.103264095, 2.203174633], [0.174843111, 0.079871278], [0.184518186, -0.207127933], [0.189918689, -0.367327207], [0.201050865, -0.697549479], [0.243516642, -1.957244485], [0.171715001, 0.172662805], [0.240350015, -1.863310384], [0.197351971, -0.587826343], [0.13755252, 1.186050722], [0.181205988, -0.108875654], [0.151061938, 0.785310481], [0.12001562, 1.706261279], [0.15060073, 0.79899166], [0.193668527, -0.478561509], [0.102158275, 2.235977428], [0.220843757, -1.284681266], [0.171258037, 0.18621806], [0.212280582, -1.030665224], [0.217307026, -1.179768491], [0.143856068, 3.188978969], [0.270968175, -0.213564711], [0.372251403, -1.322158256], [0.388015982, -1.494709146], [0.37104286, -1.308930175], [0.238484395, 0.360186205], [0.197071139, 1.598182504], [0.142922734, 3.216879795], [0.156395104, 2.814140512], [0.175536641, 2.241928784], [0.194814331, 1.6656469], [0.233168379, 0.519101719], [0.371031268, -1.308803291], [0.146579194, 3.107574599], [0.102533337, 4.424269135], [0.121017406, 3.871711537], [0.118551051, 3.945440061], [0.298428582, -0.514132047], [0.139846843, 3.308829612], [0.127434494, 3.679880893], [0.336236565, -0.927958564], [0.175387792, 2.246378412], [0.365052564, -1.243363514], [0.166456075, 2.513380683], [0.15956402, 2.719409846], [0.156207822, 2.819739089], [0.180776427, 2.085292077], [0.324032918, -0.79438379], [0.32700873, -0.826955484], [0.158783314, 2.74274804], [0.407895785, 0.589039946], [0.132865035, 5.901939516], [0.532496934, -0.7964381], [0.122051857, 6.230319074], [0.181506574, 4.424770906], [0.153663882, 5.270310583], [0.269348499, 2.129589336], [0.216436417, 3.364005409], [0.146174677, 5.49774621], [0.195073557, 4.012762547], [0.621124154, -1.781911112], [0.106526491, 6.701800534], [0.380597203, 0.892581176], [0.103500352, 6.793699693], [0.253121333, 2.310024132], [0.217737714, 3.324486998], [0.572574823, -1.242076342], [0.223910876, 3.137017583], [0.450144197, 0.119267016], [0.161649585, 5.027797095], [0.473057711, -0.135515314], [0.1721498, 4.708921726], [0.486098516, -0.28051999], [0.31191106, 1.656323286], [0.636078365, -1.948191523], [0.225256716, 3.096146492], [0.151769694, 5.327834152], [0.545423793, -0.940175783], [0.564917113, -1.156927929], [0.214671732, 3.417596145], [0.560774531, 1.343267982], [0.55501494, 1.409675928], [0.230828573, 5.530199978], [0.126882862, 8.803456979], [0.344111483, 3.841387561], [0.535180291, 1.638368934], [0.176567719, 7.23887769], [0.163717302, 7.643538139], [0.654571655, 0.261789474], [0.218592607, 5.915511332], [0.126940068, 8.801655554], [1.016571189, -1.505450783], [0.111493138, 9.288080365], [0.6042665, 0.841806655], [1.012445699, -1.486531567], [0.499254666, 2.052590504], [1.122205118, -1.989880816], [0.542407206, 1.555042789], [0.417560222, 2.994525423], [0.174912003, 7.291016308], [0.174985148, 7.288712956], [0.73613692, -0.219398237], [0.474026991, 2.343464972], [0.884560578, -0.900059071], [0.222453931, 5.793917972], [0.908940017, -1.011861523], [0.153589303, 7.962469456], [0.333150556, 3.967766784], [0.107825728, 9.403567323], [0.214370966, 6.048451052], [0.240726775, 7.494341037], [0.425124363, 5.222698557], [0.556747899, 3.731053373], [0.465046006, 4.77028002], [0.923213796, 1.306256289], [1.153821065, 0.266804805], [0.167671191, 9.755497174], [0.185228117, 9.212089681], [0.125932776, 11.04735014], [0.277299019, 6.897953361], [0.171597878, 9.633961601], [0.492054874, 4.464197628], [0.464829556, 4.772732975], [0.332603184, 6.271209892], [1.547237105, -1.506499598], [0.150118727, 10.29876654], [0.112337164, 11.46815029], [0.142488904, 10.53491853], [1.444238681, -1.042239017], [0.33925192, 6.195862012], [0.234737465, 7.679717234], [0.138261469, 10.66576261], [0.12045848, 11.21678603], [1.30533487, -0.416136586], [0.265978901, 7.026240445], [0.188606066, 9.107538213], [0.484904448, 4.545230996], [0.187531843, 9.140786672], [0.588795265, 3.367871372], [0.149232679, 10.32619077], [1.952804818, -1.199348617], [0.498685907, 6.021160628], [1.59936965, -0.288410618], [0.142021194, 12.36141179], [0.237700633, 9.31353625], [0.636541415, 4.41326604], [1.119811676, 1.936301505], [1.464363384, 0.337895464], [1.399413589, 0.639203345], [0.237870984, 9.308109713], [0.157631856, 11.864133], [0.329997509, 7.988678391], [0.473642281, 6.313260024], [0.807722477, 3.384111074], [1.624761231, -0.406204423], [1.625445578, -0.40937917], [0.589744485, 4.959087766], [1.515896295, 0.098829703], [0.185090321, 10.98944162], [0.784954191, 3.489735179], [0.2101752, 10.19036095], [0.193008103, 10.73722009], [1.771405549, -0.880682063], [1.415779447, 0.563280671], [0.21827848, 9.932230362], [0.221154012, 9.840630075], [0.153998522, 11.97987315], [0.147240675, 12.19514484], [0.332131661, 7.963786458], [0.666058007, 4.068995655], [1.949737217, 3.615628411], [0.211910472, 12.14697119], [1.243188519, 5.541860317], [0.406404081, 9.859517744], [4.449954666, 0.308105328], [0.238965759, 11.49795595], [0.513238737, 8.921157168], [0.155253475, 13.50608651], [0.518631531, 8.873790652], [4.221014948, 0.610968346], [0.67372584, 7.531260352], [0.587728313, 8.266893046], [0.232208884, 11.66004311], [0.649347043, 7.725677401], [0.906981321, 6.716389634], [0.240697105, 11.45642358], [1.07116607, 6.142815354], [4.325414109, 0.472859306], [0.472855448, 9.275855612], [0.67841998, 7.514861523], [0.136877296, 13.94690314], [3.432707652, 1.653815472], [0.215076095, 12.0710327], [0.293369788, 10.85233159], [0.565654248, 8.460776134], [1.807147913, 3.804258971], [0.531670594, 8.759264683], [0.958340345, 6.536968494], [0.632922804, 7.869936385], [4.52887443, 0.203702832], [0.215275564, 13.24064955], [1.387436303, 7.247815836], [10.17306493, 0.253697658], [0.613719539, 9.806397474], [0.446533981, 11.05849316], [0.647478281, 9.553569562], [0.406971457, 11.35478709], [2.324346101, 5.612500945], [0.651698007, 9.521966946], [2.333098071, 5.602628788], [9.116079993, 0.698812703], [4.77858067, 2.84414243], [0.221128944, 13.12092297], [0.227218457, 12.99636644], [0.525105349, 10.47005195], [0.464732104, 10.92220273], [9.725833912, 0.442034548], [5.551244907, 2.200027783], [1.231482357, 7.712367888], [0.469863542, 10.88377207], [1.68484, 6.361916494], [2.177433257, 5.77821755], [1.143368165, 7.97484043], [8.754700424, 0.850996029], [0.796756462, 9.007319455], [0.476421084, 10.83466095], [0.802767888, 8.989412758], [0.216569157, 13.21419006], [0.619582, 9.762491987], [0.557896567, 10.22447008], [0.615535003, 11.32734658], [4.860374397, 4.549183187], [1.169025449, 9.503654739], [6.713893034, 3.546585628], [1.484404094, 8.599270796], [0.747365938, 10.71281109], [10.44277655, 2.034888332], [0.382688336, 13.00611708], [6.990227861, 3.434558902], [0.873865843, 10.3500583], [1.586244923, 8.307230698], [6.790561675, 3.515503998], [0.618844646, 11.30348482], [0.358368447, 13.18145784], [4.768278436, 4.649189955], [0.623230505, 11.27186379], [4.077591921, 5.399204671], [0.416531355, 12.76211676], [3.869528684, 5.625140006], [0.518593466, 12.02627259], [8.26885309, 2.91620152], [0.258206202, 13.90360442], [2.977821118, 6.593442966], [2.502860975, 7.109200967], [1.22549977, 9.341708235], [3.087884672, 6.473925234], [1.350149404, 8.984261307], [0.596391392, 11.46536757], [0.53744581, 11.89035156], [6.341144209, 3.697698793], [0.644030899, 12.35584145], [4.651468946, 6.124245102], [2.668582361, 8.238684243], [3.414197641, 7.443601889], [0.565631836, 12.91090242], [0.639726024, 12.38631973], [4.291443442, 6.508156124], [1.241052105, 10.56391232], [0.42019899, 13.9405588], [9.396729586, 3.848892983], [0.957850315, 11.36140198], [10.62620946, 3.359434399], [0.948310442, 11.38826604], [1.106714841, 10.94220293], [3.612446212, 7.232200723], [1.349245423, 10.25924245], [0.594747263, 12.70476683], [1.577371038, 9.616846016], [3.580510049, 7.266255656], [6.778004671, 4.891413009], [0.511891837, 13.29137859], [0.528071901, 13.17682464], [3.856137156, 6.972342355], [0.888894488, 11.55557998], [0.658143386, 12.25592584], [3.389699085, 7.469725777], [0.623394933, 12.50194293], [4.75146503, 5.698182802], [4.00503361, 6.81356752], [1.18953447, 10.70898478], [0.998767362, 12.62590454], [1.300712582, 11.79920416], [7.710315363, 6.086431353], [2.376381031, 10.00472865], [8.103396073, 5.934283031], [0.70146689, 13.43988799], [6.58293015, 6.522804252], [3.247605932, 9.10145674], [0.60650797, 13.96310044], [0.632192473, 13.78629652], [5.663909608, 6.878526195], [3.683946929, 8.64906544], [1.426318282, 11.45530642], [0.643008107, 13.71184515], [1.615187604, 10.93819825], [1.616533533, 10.93451321], [1.620627601, 10.923304], [4.910192496, 7.377713834], [2.013279615, 10.38118634], [1.375386022, 11.59475462], [3.846884412, 8.480134488], [6.306848282, 6.629666258], [4.065084205, 8.253908466], [1.101212278, 12.34541906], [4.317678348, 7.992022937], [3.13007294, 9.223313049], [4.822505774, 7.20420532], [0.710757176, 13.41445198], [9.038430135, 5.572362793], [0.703788347, 13.43353204], [2.551401338, 11.11669314], [8.812069539, 7.212654644], [3.777827929, 9.924333958], [8.088303168, 7.475355299], [5.185020753, 8.529140362], [7.672524314, 7.626267778], [2.131008589, 11.52540832], [9.239746428, 7.057423615], [5.578447006, 8.386341058], [1.489596359, 12.48463898], [1.196268794, 13.23773469], [4.388769725, 9.330362768], [3.973787979, 9.733817242], [3.873207957, 9.831603375], [1.318569259, 12.92373776], [2.12706472, 11.52924263], [2.551180909, 11.11690745], [1.093204169, 13.5023451], [2.532718843, 11.13485668], [10.52160491, 6.592155986], [1.915985134, 11.7344589], [9.643798331, 6.91076759], [5.27028983, 8.498190813], [8.771721642, 7.227299451], [8.203173727, 7.433661498], [1.489632083, 12.48454726], [1.237243599, 13.13253507], [2.722208316, 10.9506308], [1.503600926, 12.44868335], [2.656802914, 11.01421939], [7.6059848, 9.074786087], [1.510762029, 13.5404166], [4.595387252, 10.45661192], [4.710616673, 10.35194852], [9.523010369, 8.424721389], [4.178761103, 10.83503533], [4.064281276, 10.93901787], [3.309178514, 11.62488111], [4.541403032, 10.50564603], [1.976828556, 12.83506057], [4.941370822, 9.97835853], [1.58596913, 13.36002261], [4.950177434, 10.13435441], [1.959850223, 12.85048206], [4.513011545, 10.53143415], [3.286025234, 11.64591134], [2.244928152, 12.5915445], [2.090991207, 12.73136612], [8.448985222, 8.78892406], [4.651137456, 10.40597376], [1.472808251, 13.63145366], [2.377325699, 12.47128721], [3.904850881, 11.08382922], [3.582278841, 11.37682285], [7.827422664, 8.999696354], [2.381294669, 12.46768218], [1.920599122, 12.88613402], [4.291161078, 10.73294193], [1.9724814, 12.83900911], [6.336075833, 9.505413096], [2.49016276, 13.28933531], [5.752246887, 10.79442811], [4.676860299, 11.43019975], [3.037241907, 12.82420729], [4.512654064, 11.56980829], [3.20347894, 12.68287216], [8.664358596, 9.870096975], [10.05517274, 9.428639728], [4.304738504, 11.7465786], [4.15547277, 11.87348469], [6.99986094, 10.3984239], [3.471617519, 12.45490008], [8.424177336, 9.946332724], [5.953758866, 10.73046635], [2.534007343, 13.25205853], [4.513195919, 11.5693476], [6.400663372, 10.58861474], [2.065004457, 13.65080593], [9.531923763, 9.594723783], [4.117833584, 11.90548562], [5.707192745, 10.80872871], [7.50491276, 10.23811579], [3.603790986, 12.34252588], [2.313651668, 13.43940546], [3.162238345, 12.71793501], [10.28725876, 9.354973484], [10.50721387, 9.285157699], [8.139701188, 10.03662808], [3.928513305, 12.06644618], [4.22148092, 11.8173644], [6.361253218, 11.65543661], [9.662436918, 10.62682058], [3.78218532, 13.21602225], [3.218231171, 13.68670706], [4.729662264, 12.16382414], [8.291177292, 11.05409145], [4.592591113, 12.53964511], [4.945249855, 12.2453107], [9.433610218, 10.6981207], [4.69559868, 12.45367341], [4.786553098, 12.37776145], [8.706574205, 10.9246579], [8.971945269, 10.84197091], [7.185910654, 11.39848155], [4.74108824, 12.16026392], [9.171878447, 10.77967372], [4.259763059, 12.81742852], [3.841268074, 13.16671088], [7.767113607, 11.21738449], [7.180421798, 11.40019182], [7.273034841, 11.37133452], [9.240452907, 10.7583066], [8.331530939, 11.04151765], [9.794028627, 10.58581791], [6.11973066, 11.73069264], [4.69355487, 12.17507484], [5.591007761, 11.89543744], [3.956272606, 13.07072632], [3.947404809, 13.07812753], [3.142670838, 13.74977088], [9.049489566, 11.7675173], [4.141209335, 13.82592524], [6.178795393, 12.64488018], [8.976970296, 11.78968117], [4.819484712, 13.27065913], [4.768357543, 13.31251408], [4.116332208, 13.84629075], [4.60865244, 13.44325571], [8.96432488, 11.79354596], [4.469815036, 13.55691413], [4.172818462, 13.80004862], [8.656116509, 11.88774289], [6.064027608, 12.67995636], [4.76245648, 13.31734495], [4.113231692, 13.84882897], [6.62198589, 12.50942901], [7.015570961, 12.38913861], [4.659557191, 13.10920105], [4.009834277, 13.93347465], [4.270629385, 13.71997628], [6.088978408, 12.67233071], [5.850561128, 12.74519757], [6.9419687, 12.41163348], [4.818000397, 13.27187425], [8.464417314, 11.94633142], [7.061668491, 12.37504994], [5.882036478, 12.73557784], [6.533144034, 12.53658151], [4.033801179, 13.91385429], [5.700833054, 12.79095858], [6.230854058, 13.42748759], [5.343305834, 13.70626905], [10.16878575, 12.19057189], [10.72274023, 12.01657319], [4.709129346, 13.90546572], [10.03595892, 12.23229318], [10.23610576, 12.16942648], [8.937626827, 12.57728246], [7.027195923, 13.17735432], [4.586742152, 13.94390789], [6.815289393, 13.24391477], [7.824931061, 12.92678341], [6.921027648, 13.21070208], [7.461669354, 13.04088496], [5.78462723, 13.56764873], [4.900678263, 13.84529965], [9.650163522, 12.35347263], [5.204973155, 13.74971974], [5.887312567, 13.53539497], [5.932016874, 13.52135322], [7.748560552, 12.95077161], [7.485332584, 13.03345227], [5.351435642, 13.70371545], [7.134211451, 13.14374043], [10.77517371, 12.00010368], [9.86783117, 12.28510259], [8.626451433, 12.67502355], [6.640990979, 13.2986624], [4.559006974, 13.95261959], [10.29295863, 12.15156883], [8.698823109, 13.48426058], [8.841847953, 13.44057788], [8.537697995, 13.53347147], [8.555553858, 13.52801792], [8.981993581, 13.39777455], [10.07764808, 13.06313935], [8.446284795, 13.56139092], [7.674373898, 13.79714823], [8.034041889, 13.6872983], [7.887405568, 13.73208402], [9.430014867, 13.26093972], [8.687126786, 13.48783287], [7.477514191, 13.85727319], [10.04650943, 13.07264973], [8.285370204, 13.61053751], [9.045380474, 13.3784149], [9.919896189, 13.11131999], [10.51428777, 12.92978069], [7.056144104, 13.9859682], [8.077506992, 13.67402317], [7.682402405, 13.79469616], [9.784898537, 13.15255102], [7.783091809, 13.76394357], [10.2512266, 13.01012494], [9.055262592, 13.3753967], [8.797616329, 13.45408712], [9.819718949, 13.14191616], [9.734374407, 13.16798212], [8.236705221, 13.62540079], [7.512185727, 13.8466838], [12, 14]]
df1 = pd.DataFrame(df11)
df1 = df1.rename(columns={ 0: 'x', 1: 'y'})
df2=pd.DataFrame(df21)
df2 = df2.rename(columns={ 0: 'GSI'})
df2_s= df2.to_numpy()
df2_s = [df2_s[1].tolist(), df2_s[4].tolist(), df2_s[9].tolist(), df2_s[14].tolist(), df2_s[19].tolist(), df2_s[21].tolist()]
#feature scaling
scalerX = StandardScaler().fit(df1)
scalery = StandardScaler().fit(df2)
df1_t = scalerX.transform(df1)
df2_t = scalery.transform(df2)
df1_st = [df1_t[1].tolist(), df1_t[4].tolist(), df1_t[9].tolist(), df1_t[14].tolist(), df1_t[19].tolist(), df1_t[21].tolist()]
df2_st = [df2_t[1].tolist(), df2_t[4].tolist(), df2_t[9].tolist(), df2_t[14].tolist(), df2_t[19].tolist(), df2_t[21].tolist()]
# Split the data into input (x) training and testing data, and ouput (y) training and testing data,
# with training data being 80% of the data, and testing data being the remaining 20% of the data
X_train, X_test, y_train, y_test = train_test_split(df1_t, df2_t, test_size=0.4)
y_train1= scalery.inverse_transform(y_train)
y_test1= scalery.inverse_transform(y_test)
# Defines "deep" model and its structure
model = Sequential()
model.add(Dense(20, input_shape=(2,), activation='relu'))
model.add(Dense(40, activation='relu'))
model.add(Dense(1,))
model.compile(adam_v2.Adam(lr=0.005), 'mean_squared_error')
history = model.fit(X_train, y_train, epochs = 1000, validation_split = 0.2, verbose = 0)
#SVm model
from sklearn.svm import SVR
regressor = SVR(kernel = 'rbf', epsilon = 0.05, C=5)
regressor.fit(X_train, y_train)
def ANN():
num1 = 2*np.log10(float(t1.get()))
num2= float(t2.get())
l2=[[num2,num1]]
t=scalerX.transform(l2)
y_pred = model.predict(t)
y_pred = scalery.inverse_transform(y_pred)
y=[]
for i in y_pred:
for j in i:
y.append(j)
t3.insert(END, int(y[0]))
def SVM():
num1 = 2*np.log10(float(t1.get()))
num2=float(t2.get())
l2=[[num2,num1]]
t=scalerX.transform(l2)
y_pred = regressor.predict(t)
y_pred = scalery.inverse_transform(y_pred)
t4.insert(END, int(y_pred[0]))
b1= Button(root, width=10, text='GSI (ANN)', command = ANN, font=("arial", 10, "bold"), bg="LightSalmon")
b1.place(x=60,y=150)
b2= Button(root, width=10, text='GSI (SVM)', command = SVM, font=("arial", 10, "bold"), bg="LightSalmon")
b2.place(x=250,y=150)
root.mainloop()