Skip to content

Commit

Permalink
Merge branch 'develop' into Recursive-feature-elimination
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicius-a-almeida committed Aug 23, 2023
2 parents a7b395c + c8b33ec commit 349ab94
Show file tree
Hide file tree
Showing 7 changed files with 928 additions and 6 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ However, if the thyroid gland is underactive (hypothyroidism) or overactive (hyp

We used the above attributes to build a model that can classify patients with ESS with high accuracy. These are chosen because they are the most important attributes in the dataset. Moreover, theses attributes can be measured in a blood test.

## Part 1: Results
## Part 1: Results : IVCobiCET

We used 4 different machine learning approaches to build a model that can classify patients with ESS with high accuracy. The approaches are:

Expand All @@ -58,6 +58,30 @@ The results are shown in the table below:

[Access the detailed results](https://github.com/cilab-ufersa/euthyroid_sick_syndrome/blob/develop/euthyroid_sick_syndrome/notebooks/IVCoBiCET_results.ipynb)

## Part 2: Results : ICISNA 2023

We used 4 different machine learning approaches to build a model that can classify patients with ESS with high accuracy. The approaches are:

* Logistic Regression
* Random Forest
* LightGBM
* XGBoost
* Stack Ensemble based on Random Forest and XGBoost

The results are shown in the table below:

| Approach | Accuracy | Recall | Precision | F1-Score |
| ------ | ------ | ------ | ------ | ------ |
| Logistic Regression | 91.98% | 93.21% | 90.62% | 91.90%
| Random Forest | 98.34% | 98.21% | 98.38% | 98.30%
| LightGBM | 97.64% | 97.32% | 97.64% | 97.58%
| XGBoost | 98.60% | 98.77% | 98.57% | 98.57%
| Stack Ensemble | 98.78% | 98.75% | 98.75% | 98.75%

* [Access the detailed results](https://github.com/cilab-ufersa/euthyroid_sick_syndrome/blob/develop/euthyroid_sick_syndrome/notebooks/ICISNA23.ipynb)

* [Web system](https://github.com/cilab-ufersa/euthyroid_diagnostic_support_app)

## Scientific Developers
👤 [Vinicius Almeida](https://github.com/vinicius-a-almeida):
_vinicius45anacleto@gmail.com_
Expand Down
15 changes: 10 additions & 5 deletions euthyroid_sick_syndrome/models/neural.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,24 @@

dataset_res, ouput_label = balance_dataset_smote(dataset, output_label_dataset, random_state=42, k_neighbors=5)



print(dataset_res.shape)


# Dividindo os dados em treino e teste em 80% e 20% respectivamente
# X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=3, stratify=y)
input_train, input_test, output_train, output_test = slipt_and_standardize_dataset(dataset=dataset_res, output_label=ouput_label)

# Modelo de rede perceptron multicamadas com uma camada oculta de 64 neurônios
# e camada de saída com 3 neurônios (3 classes)
# e camada de saída com 1 neurônios (1 classes)

model = tf.keras.models.Sequential()
model.add(tf.keras.Input(shape=(input_train.shape[1],)))
model.add(tf.keras.layers.Dense(128, activation='sigmoid'))
model.add(tf.keras.layers.Dense(256, activation='sigmoid'))
model.add(tf.keras.layers.Dense(1, activation='sigmoid'))
model.add(tf.keras.layers.Dense(64, input_dim=8, activation='sigmoid'))
model.add(tf.keras.layers.Dense(1, activation='softmax'))
model.summary() #visualizando o modelo


# Compile model
# Otimizador Adam com taxa de aprendizado de 0.01
opt = tf.keras.optimizers.Adam(learning_rate=0.01)
Expand Down
127 changes: 127 additions & 0 deletions euthyroid_sick_syndrome/neural_network/history.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
loss,accuracy,val_loss,val_accuracy
0.6798571944236755,0.7971926331520081,0.6428171992301941,0.8452610969543457
0.5423033833503723,0.8477734923362732,0.41204074025154114,0.8471953868865967
0.3449075222015381,0.8705227375030518,0.28643810749053955,0.8916828036308289
0.25787353515625,0.9041626453399658,0.23595041036605835,0.9226305484771729
0.21566657721996307,0.9218296408653259,0.2206697314977646,0.924564778804779
0.19932204484939575,0.9293320178985596,0.21413350105285645,0.9235976934432983
0.192443385720253,0.9312681555747986,0.21124984323978424,0.9255319237709045
0.18590934574604034,0.9334462881088257,0.20713241398334503,0.9274661540985107
0.1811572164297104,0.9363504648208618,0.20238856971263885,0.9323017597198486
0.17754408717155457,0.936108410358429,0.20000457763671875,0.9323017597198486
0.17488481104373932,0.936834454536438,0.19635753333568573,0.9342359900474548
0.17046032845973969,0.9407066702842712,0.1995221972465515,0.9294003844261169
0.16793477535247803,0.9411907196044922,0.19310733675956726,0.9323017597198486
0.1643637716770172,0.9409486651420593,0.19006094336509705,0.9323017597198486
0.1609339416027069,0.9414327144622803,0.18836082518100739,0.9371373057365417
0.16003552079200745,0.9426428079605103,0.1858360320329666,0.9332688450813293
0.1555866301059723,0.9426428079605103,0.18434426188468933,0.9323017597198486
0.15373826026916504,0.9433688521385193,0.1808657944202423,0.9332688450813293
0.15216122567653656,0.9433688521385193,0.17971426248550415,0.9323017597198486
0.14911839365959167,0.9440948963165283,0.17977680265903473,0.9323017597198486
0.14781109988689423,0.9443368911743164,0.17524319887161255,0.9342359900474548
0.14516662061214447,0.9438528418540955,0.17348602414131165,0.9332688450813293
0.14278240501880646,0.9457889795303345,0.17222562432289124,0.9313346147537231
0.14127138257026672,0.9453049302101135,0.1696190983057022,0.9342359900474548
0.13878488540649414,0.9462729692459106,0.1683083176612854,0.9332688450813293
0.13660767674446106,0.9477250576019287,0.16746489703655243,0.9313346147537231
0.13501273095607758,0.9491771459579468,0.16597327589988708,0.9381044507026672
0.13441264629364014,0.9489351511001587,0.16266845166683197,0.9390715956687927
0.13193120062351227,0.9506292343139648,0.1622381955385208,0.9390715956687927
0.13203473389148712,0.952323317527771,0.16432011127471924,0.9313346147537231
0.12893164157867432,0.9525653719902039,0.16316519677639008,0.9332688450813293
0.12716512382030487,0.9528073668479919,0.1585025191307068,0.936170220375061
0.12630011141300201,0.9540174007415771,0.1595555692911148,0.9352030754089355
0.12627647817134857,0.952323317527771,0.1564953625202179,0.9371373057365417
0.124113067984581,0.9561955332756042,0.15736813843250275,0.9381044507026672
0.12188059836626053,0.9554694890975952,0.15453681349754333,0.9371373057365417
0.12075518816709518,0.954985499382019,0.1513647586107254,0.9429400563240051
0.12082811444997787,0.9561955332756042,0.15061889588832855,0.9419729113578796
0.11845523864030838,0.9559535384178162,0.1501522660255432,0.9448742866516113
0.1166456788778305,0.9571635723114014,0.14828267693519592,0.9429400563240051
0.11557716131210327,0.9574056267738342,0.14849717915058136,0.9448742866516113
0.11457802355289459,0.9559535384178162,0.1467643827199936,0.9506769776344299
0.11261869221925735,0.9593417048454285,0.14975008368492126,0.9439071416854858
0.11330891400575638,0.9590997099876404,0.14646431803703308,0.9477756023406982
0.11204160004854202,0.9586156606674194,0.14451931416988373,0.9477756023406982
0.11008818447589874,0.9595837593078613,0.14230777323246002,0.9545454382896423
0.10895585268735886,0.9615198373794556,0.14090906083583832,0.9477756023406982
0.10872434079647064,0.9620038866996765,0.14043781161308289,0.9497098922729492
0.10617943853139877,0.9636979699134827,0.1404138207435608,0.9535783529281616
0.10755158960819244,0.9629719257354736,0.13875605165958405,0.9497098922729492
0.10503718256950378,0.9610358476638794,0.13743926584720612,0.9555125832557678
0.10290540009737015,0.9627299308776855,0.14035241305828094,0.9545454382896423
0.10391433537006378,0.9610358476638794,0.1385820358991623,0.9564796686172485
0.1021842211484909,0.9641820192337036,0.13611219823360443,0.957446813583374
0.10036253184080124,0.9641820192337036,0.13426868617534637,0.9535783529281616
0.09956997632980347,0.9663600921630859,0.13437823951244354,0.9545454382896423
0.09866640716791153,0.9653920531272888,0.1354312300682068,0.9555125832557678
0.09845608472824097,0.9656340479850769,0.13243553042411804,0.9555125832557678
0.09755901992321014,0.9651500582695007,0.13410650193691254,0.9584138989448547
0.09811146557331085,0.9653920531272888,0.13387615978717804,0.9584138989448547
0.09697268903255463,0.9653920531272888,0.13290786743164062,0.9593810439109802
0.09549044817686081,0.968538224697113,0.13422708213329315,0.9584138989448547
0.09476636350154877,0.9666021466255188,0.1316431313753128,0.9564796686172485
0.09405633807182312,0.967812180519104,0.13374634087085724,0.957446813583374
0.09428678452968597,0.9699903130531311,0.13043901324272156,0.9584138989448547
0.09127403795719147,0.9712004065513611,0.13077279925346375,0.9584138989448547
0.09113089740276337,0.969748318195343,0.13179202377796173,0.9584138989448547
0.09194323420524597,0.969748318195343,0.1310705840587616,0.957446813583374
0.08965010941028595,0.9714424014091492,0.12957113981246948,0.9593810439109802
0.09148500114679337,0.9709583520889282,0.13117903470993042,0.9564796686172485
0.08822689950466156,0.9714424014091492,0.12710754573345184,0.9593810439109802
0.0878220871090889,0.9714424014091492,0.12891732156276703,0.9603481888771057
0.0870567336678505,0.9716843962669373,0.1295304149389267,0.9593810439109802
0.08701453357934952,0.9719264507293701,0.12828154861927032,0.9622824192047119
0.0873958095908165,0.970474362373352,0.1269940733909607,0.9593810439109802
0.08645502477884293,0.9724104404449463,0.12804661691188812,0.9593810439109802
0.08618881553411484,0.9714424014091492,0.12842325866222382,0.9593810439109802
0.08431482315063477,0.9728944897651672,0.12682151794433594,0.9603481888771057
0.0850628912448883,0.9719264507293701,0.12913285195827484,0.9603481888771057
0.083136186003685,0.9736205339431763,0.12661640346050262,0.9603481888771057
0.08332160115242004,0.9736205339431763,0.1260073482990265,0.9642166495323181
0.08372371643781662,0.9736205339431763,0.13082297146320343,0.9584138989448547
0.08262819796800613,0.9728944897651672,0.12915070354938507,0.957446813583374
0.0822460725903511,0.9736205339431763,0.13075806200504303,0.9593810439109802
0.08132597804069519,0.9745885729789734,0.12834253907203674,0.9593810439109802
0.07974603027105331,0.9745885729789734,0.12392270565032959,0.9622824192047119
0.08015725016593933,0.9755566120147705,0.1251683533191681,0.9622824192047119
0.07990637421607971,0.9750726222991943,0.12531788647174835,0.9613152742385864
0.07975411415100098,0.9728944897651672,0.12492924183607101,0.9632495045661926
0.0796065479516983,0.9757986664772034,0.12424737215042114,0.9632495045661926
0.07754728198051453,0.9750726222991943,0.12573596835136414,0.9613152742385864
0.07727667689323425,0.9755566120147705,0.12749283015727997,0.9632495045661926
0.07730316370725632,0.9757986664772034,0.12607687711715698,0.9632495045661926
0.07748959213495255,0.9745885729789734,0.12307368963956833,0.9661508798599243
0.07595880329608917,0.9770087003707886,0.12741532921791077,0.9632495045661926
0.07803218811750412,0.9757986664772034,0.12297775596380234,0.9661508798599243
0.07542900741100311,0.9760406613349915,0.12536031007766724,0.9642166495323181
0.07447981089353561,0.9757986664772034,0.1227584257721901,0.9651837348937988
0.07581818848848343,0.9738625288009644,0.12297780066728592,0.9622824192047119
0.07556283473968506,0.9755566120147705,0.12069648504257202,0.9680851101875305
0.07402356714010239,0.9782187938690186,0.12438845634460449,0.9642166495323181
0.07426271587610245,0.9774927496910095,0.13456058502197266,0.9632495045661926
0.07404930144548416,0.9770087003707886,0.12068185955286026,0.9661508798599243
0.07198510318994522,0.9782187938690186,0.12122418731451035,0.967117965221405
0.07271765172481537,0.9777347445487976,0.12477817386388779,0.9622824192047119
0.07228145748376846,0.9774927496910095,0.11968415230512619,0.967117965221405
0.07203030586242676,0.9774927496910095,0.12337228655815125,0.9632495045661926
0.0703437551856041,0.9799128770828247,0.1266629844903946,0.9642166495323181
0.07053306698799133,0.9782187938690186,0.1215522512793541,0.9642166495323181
0.07273515313863754,0.9784607887268066,0.12078258395195007,0.9661508798599243
0.06947934627532959,0.9791868329048157,0.12154169380664825,0.9661508798599243
0.07012028247117996,0.9791868329048157,0.12331745773553848,0.9632495045661926
0.06962821632623672,0.9777347445487976,0.12230398505926132,0.9651837348937988
0.06905314326286316,0.9784607887268066,0.1234203428030014,0.9622824192047119
0.06907352060079575,0.9796708822250366,0.12101034820079803,0.967117965221405
0.06764716655015945,0.9779767394065857,0.11931247264146805,0.967117965221405
0.0669790580868721,0.9803969264030457,0.12256187945604324,0.967117965221405
0.06888408213853836,0.9782187938690186,0.12120385468006134,0.9661508798599243
0.06858647614717484,0.9777347445487976,0.12067727744579315,0.9632495045661926
0.06699668616056442,0.9789448380470276,0.12153710424900055,0.9661508798599243
0.06707808375358582,0.9799128770828247,0.1248113140463829,0.9622824192047119
0.06634443998336792,0.9791868329048157,0.12348442524671555,0.9661508798599243
0.0665704607963562,0.9801548719406128,0.12083631753921509,0.9661508798599243
0.06599382311105728,0.9806389212608337,0.12420717626810074,0.9651837348937988
0.0650753304362297,0.9808809161186218,0.12110698968172073,0.9690521955490112
0.06685853004455566,0.9799128770828247,0.12216925621032715,0.9651837348937988
146 changes: 146 additions & 0 deletions euthyroid_sick_syndrome/neural_network/load_model.ipynb

Large diffs are not rendered by default.

Binary file added euthyroid_sick_syndrome/neural_network/model.h5
Binary file not shown.
Loading

0 comments on commit 349ab94

Please sign in to comment.