You are here

Development of Risk Prediction Models for Severe Periodontitis in a Thai Population: Statistical and Machine-Learning Approaches

 

Data Availability:
The data sets generated during analyses for this study are available from the corresponding author on reasonable request.
To request data, please complete online data request form (click here).

 

Codes:
Codes generated for the whole analyses are bellow.



MELR
RNN
ME-SVM
ME-DT
Mixed-Effects Logistic Regression (MELR)

The MELR model was created using STATA version 16.0, and the codes were constructed as follows.

Set the seed value and train the model:

1). We set the seed to initialize the random number generator for reproducible output.

2). We train the model using the "melogit" function in STATA.

alt

Model evaluation:

We evaluate the model's performance using both the training and testing datasets.

alt

Recurrent Neural Networks (RNN)

The RNN model was created using Python version 3.8.2, and the codes were constructed as follows.

Set the seed value:

We set the seed at five different levels as shown below to initiate the random number generator for reproducible output.

alt

The required libraries:

We have imported the required libraries, such as sklearn and keras.

alt

Transforming 3-dimensional data:

We have created a Python function called load_data() to transform the 2D data into 3D data by incorporating the third dimension of time-steps.

alt

Sample_weight function:

We have created the Python function called sample_weight() to handle class imbalance for 3-dimensional data.

alt

RNN modeling:

We have created the Python function called rnn_model to define the RNN architecture, including the number of epochs, the number of layers, and the activation function.

alt

Model evaluation:

We evaluate the model's performance using both the training and testing datasets.

alt

Mixed-Effects Support Vector Machine (ME-SVM)

The ME-SVM model was created using R version 4.02, and the codes were constructed as follows.

Set the seed value and import the libraries:

1). We set the seed to initialize the random number generator for reproducible output.

2). We have imported the required libraries, such as lme4, e1071, and caret.

alt

Data preprocessing:

The training dataset was imported, and the preprocessing step was performed as follows.

alt

Model training:

The model was trained using the Mix_SVM function.

alt

Model evaluation:

We evaluate the model's performance using both the training and testing datasets.

alt

Mixed-Effects Decision Tree (ME-DT)

The ME-DT model was created using R version 4.02, and the codes were constructed as follows.

Set the seed value and import the libraries:

1). We set the seed to initialize the random number generator for reproducible output.

2). We have imported the required libraries, such as lme4, e1071, and caret.

alt

Data preprocessing:

The training dataset was imported, and the preprocessing step was performed as follows.

alt

Model training:

The model was trained using the Mix_DT function.

alt

Model evaluation:

We evaluate the model's performance using both the training and testing datasets.

alt

 
Department of Clinical Epidemiology and Biostatistics