Final Project: Independent Data Intensive Research

ETR537

Author

Stella Jung

Published

December 10, 2023

1. Prepare

1.1 purpose

One of the most important aspects of education is students’ learning outcomes. Curriculum designers, teachers, and other stakeholders always aim to reach the most maximized results. There is a broad recognition of personal traits, family properties, and learning preference effect on students’ performance (Yılmaz & Sekeroglu ,2019; Rastrollo-Guerrero et al., 2020; Namoun & Alshanqiti, 2020). Recently, obtaining digitalized data regarding these factors has become easier as educational technologies develop. Instead, the need for methods that can treat massive amounts of data is getting more attention. Machine learning techniques are used to analyze massive amounts of digitalized data in education. In this context, this final project will examine a dataset to reveal the impact of factors on students’ performance.

Research question that will be examined in this final project is:

Which factors are most predictive of students’ performance(end-term grade)?

1.2 Dataset

The dataset used in this project was retrieved from the open resource (Kaggle.com). The title of the dataset is “Students’ performance (https://www.kaggle.com/datasets/joebeachcapital/students-performance).” I chose this dataset because it has many variables that affect students’ learning outcomes, and it was collected recently and opened to the public.

The data collectors didn’t specify how they collected this data and in what context. I can only find the information from the related published article that is listed on the Kaggle website. Yılmaz, and Sekeroglu (2019) stated they collected data from 101 students of a Turkish program of 3 courses of 2 faculties at Near East University, while the dataset on Kaggle website contains 145 cases. I couldn’t find the reason for the difference, but I used the enitre dataset in this project since the dataset is completed and clean. Their survey consisted of 30 items that asked about personal questions (9 items), family questions (6 items), and educational questions (13 items)

# load the packages
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.2     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.2     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(caret)
Loading required package: lattice

Attaching package: 'caret'

The following object is masked from 'package:purrr':

    lift
library(ranger)
library(e1071)
library(tidylog)

Attaching package: 'tidylog'

The following objects are masked from 'package:dplyr':

    add_count, add_tally, anti_join, count, distinct, distinct_all,
    distinct_at, distinct_if, filter, filter_all, filter_at, filter_if,
    full_join, group_by, group_by_all, group_by_at, group_by_if,
    inner_join, left_join, mutate, mutate_all, mutate_at, mutate_if,
    relocate, rename, rename_all, rename_at, rename_if, rename_with,
    right_join, sample_frac, sample_n, select, select_all, select_at,
    select_if, semi_join, slice, slice_head, slice_max, slice_min,
    slice_sample, slice_tail, summarise, summarise_all, summarise_at,
    summarise_if, summarize, summarize_all, summarize_at, summarize_if,
    tally, top_frac, top_n, transmute, transmute_all, transmute_at,
    transmute_if, ungroup

The following objects are masked from 'package:tidyr':

    drop_na, fill, gather, pivot_longer, pivot_wider, replace_na,
    spread, uncount

The following object is masked from 'package:stats':

    filter
library(dataedu)
data <- read_csv("StudentsPerformance_with_headers.csv")
New names:
Rows: 145 Columns: 33
── Column specification
──────────────────────────────────────────────────────── Delimiter: "," chr
(1): STUDENT ID dbl (32): Student Age, Sex, Graduated high-school type,
Scholarship type, Ad...
ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
Specify the column types or set `show_col_types = FALSE` to quiet this message.
• `Reading frequency` -> `Reading frequency...19`
• `Reading frequency` -> `Reading frequency...20`
glimpse(data)
Rows: 145
Columns: 33
$ `STUDENT ID`                                                        <chr> "S…
$ `Student Age`                                                       <dbl> 2,…
$ Sex                                                                 <dbl> 2,…
$ `Graduated high-school type`                                        <dbl> 3,…
$ `Scholarship type`                                                  <dbl> 3,…
$ `Additional work`                                                   <dbl> 1,…
$ `Regular artistic or sports activity`                               <dbl> 2,…
$ `Do you have a partner`                                             <dbl> 2,…
$ `Total salary if available`                                         <dbl> 1,…
$ `Transportation to the university`                                  <dbl> 1,…
$ `Accommodation type in Cyprus`                                      <dbl> 1,…
$ `Mother’s education`                                                <dbl> 1,…
$ `Father’s education`                                                <dbl> 2,…
$ `Number of sisters/brothers`                                        <dbl> 3,…
$ `Parental status`                                                   <dbl> 1,…
$ `Mother’s occupation`                                               <dbl> 2,…
$ `Father’s occupation`                                               <dbl> 5,…
$ `Weekly study hours`                                                <dbl> 3,…
$ `Reading frequency...19`                                            <dbl> 2,…
$ `Reading frequency...20`                                            <dbl> 2,…
$ `Attendance to the seminars/conferences related to the department`  <dbl> 1,…
$ `Impact of your projects/activities on your success`                <dbl> 1,…
$ `Attendance to classes`                                             <dbl> 1,…
$ `Preparation to midterm exams 1`                                    <dbl> 1,…
$ `Preparation to midterm exams 2`                                    <dbl> 1,…
$ `Taking notes in classes`                                           <dbl> 3,…
$ `Listening in classes`                                              <dbl> 2,…
$ `Discussion improves my interest and success in the course`         <dbl> 1,…
$ `Flip-classroom`                                                    <dbl> 2,…
$ `Cumulative grade point average in the last semester (/4.00)`       <dbl> 1,…
$ `Expected Cumulative grade point average in the graduation (/4.00)` <dbl> 1,…
$ `COURSE ID`                                                         <dbl> 1,…
$ GRADE                                                               <dbl> 1,…

2. Wrangle

First of all, the dataset is already cleaned without any missing value and contains only numeric values. There was no need to prepare data for predictive analysis using machine learning techniques. However, I selected 17 variables to practice the select function and renamed variables using the mutate function. For regression, it would make more sense when increasing the value in factors positively related to the outcome, so I recoded some variables(attsecon, attclass,flipclass) that possibly have negative relationships with the outcome variable, end-term grade.

# mutate variables
data<- data %>%
  mutate(SID = `STUDENT ID`,
         stype = `Scholarship type`,
         Work = `Additional work`,
         Moed = `Mother’s education`,
         Faed = `Father’s education`,
         Mooc = `Mother’s occupation`,
         Faoc = `Father’s occupation`,
         sthr = `Weekly study hours`,
         attsecon = `Attendance to the seminars/conferences related to the department`,
         attclass = `Attendance to classes`,
         notetaking =  `Taking notes in classes`,
         flipclass = `Flip-classroom`,
         CGPAlast = `Cumulative grade point average in the last semester (/4.00)`,
         CID = `COURSE ID` ) 
mutate: new variable 'SID' (character) with 145 unique values and 0% NA
        new variable 'stype' (double) with 5 unique values and 0% NA
        new variable 'Work' (double) with 2 unique values and 0% NA
        new variable 'Moed' (double) with 6 unique values and 0% NA
        new variable 'Faed' (double) with 6 unique values and 0% NA
        new variable 'Mooc' (double) with 5 unique values and 0% NA
        new variable 'Faoc' (double) with 5 unique values and 0% NA
        new variable 'sthr' (double) with 5 unique values and 0% NA
        new variable 'attsecon' (double) with 2 unique values and 0% NA
        new variable 'attclass' (double) with 2 unique values and 0% NA
        new variable 'notetaking' (double) with 3 unique values and 0% NA
        new variable 'flipclass' (double) with 3 unique values and 0% NA
        new variable 'CGPAlast' (double) with 5 unique values and 0% NA
        new variable 'CID' (double) with 9 unique values and 0% NA
#Recoding values
data$attsecon<- recode(data$attsecon, '1'=2, '2'=1)
data$attclass<- recode(data$attclass, '1'=3, '2'=2, '3'=1)
data$flipclass<- recode(data$flipclass, '3'=1, '1'= 2, '2'=3)
# selecting only the interesting variables 
data <- 
  data %>%
  select(SID,
         Sex,
         stype,
         Work,
         Moed,
         Faed,
         Mooc,
         Faoc,
         sthr,
         attsecon,
         attclass,
         notetaking,
         flipclass,
         CGPAlast,
         CID,
         GRADE)
select: dropped 31 variables (STUDENT ID, Student Age, Graduated high-school type, Scholarship type, Additional work, …)

The dataset is already claened but I checked missing data and variability for practice purpose.

# calling the na.omit function to eliminate ANY rows that have ANY missing data
data <- na.omit(data)
# run the nearZeroVar function to determine  if there are variables with NO variability
nearZeroVar(data, saveMetrics = TRUE)
           freqRatio percentUnique zeroVar   nzv
SID         1.000000    100.000000   FALSE FALSE
Sex         1.500000      1.379310   FALSE FALSE
stype       1.809524      3.448276   FALSE FALSE
Work        1.959184      1.379310   FALSE FALSE
Moed        1.384615      4.137931   FALSE FALSE
Faed        1.277778      4.137931   FALSE FALSE
Mooc        5.722222      3.448276   FALSE FALSE
Faoc        1.055556      3.448276   FALSE FALSE
sthr        2.466667      3.448276   FALSE FALSE
attsecon    3.677419      1.379310   FALSE FALSE
attclass    3.142857      1.379310   FALSE FALSE
notetaking  1.500000      2.068966   FALSE FALSE
flipclass   1.422222      2.068966   FALSE FALSE
CGPAlast    1.052632      3.448276   FALSE FALSE
CID         3.142857      6.206897   FALSE FALSE
GRADE       1.458333      5.517241   FALSE FALSE
# converting the text (character) variables in the dataset into factors
data <- 
    data %>% 
    mutate_if(is.character, as.factor)
mutate_if: converted 'SID' from character to factor (0 new NA)

3. Analyze

3.1 Prepare the train and test datasets

The machine learning technique was used to answer the research questions. Machine learning involves presenting a statistical model with a subset of data during training, teaching the model to make accurate predictions.

# set a seed to ensure the reproducibility of the data partition.
set.seed(2023)

# create a new object called trainIndex that will take 50 percent of the data
trainIndex <- createDataPartition(data$GRADE,
                                  p = .5, 
                                  list = FALSE,
                                  times = 1)

Then, add new variable to separate sub-datasets and set train subset and test subset using filter. And then remove the new variable, temp_id.

# add a new variable to the dataset, temporarily, to select rows according to their row number
data <- 
  data %>% 
  mutate(temp_id = 1:145)
mutate: new variable 'temp_id' (integer) with 145 unique values and 0% NA
# filter the dataset to get only the rows indicated by "trainIndex" vector
data_train <- 
  data %>% 
  filter(temp_id %in% trainIndex)
filter: removed 71 rows (49%), 74 rows remaining
# filter to make a testing subset
data_test <- 
  data %>% 
  filter(!temp_id %in% trainIndex)
filter: removed 74 rows (51%), 71 rows remaining
# remove the temp_id from the dataset
data_test <- 
    data_test %>% 
    select(-temp_id)
select: dropped one variable (temp_id)
data_train <- 
    data_train %>% 
    select(-temp_id)
select: dropped one variable (temp_id)

3.2 Estimate the models using random forest modeling

All of the variables in the data frame except for the outcome, GRADE were used as predictors. For that, ‘GRADE ~.’ formulation was used. In addtion, the Random Forest modeling is used. Random Forest modeling extends decision tree modeling by simultaneously “growing” a collection of decision trees. Random forest is random in two ways, 1) each tree is restricted to “see” and split based on a limited subset of predictors, 2) a random subsample of the data is utilized for the growth of each individual tree, ensuring no single case is weighted too heavily in the final prediction.

# setting a seed for reproducibility
set.seed(2023)

# run the model
rf_fit <- train(GRADE ~ .,
                data = data_train,
                method = "ranger")

# summary of the model 
rf_fit
Random Forest 

74 samples
15 predictors

No pre-processing
Resampling: Bootstrapped (25 reps) 
Summary of sample sizes: 74, 74, 74, 74, 74, 74, ... 
Resampling results across tuning parameters:

  mtry  splitrule   RMSE      Rsquared   MAE     
    2   variance    2.212734  0.2630679  1.917325
    2   extratrees  2.220720  0.2376902  1.926219
   80   variance    1.461436  0.5916931  1.207956
   80   extratrees  1.659308  0.5116768  1.376112
  158   variance    1.384789  0.6219956  1.108802
  158   extratrees  1.568199  0.5445477  1.271180

Tuning parameter 'min.node.size' was held constant at a value of 5
RMSE was used to select the optimal model using the smallest value.
The final values used for the model were mtry = 158, splitrule = variance
 and min.node.size = 5.

From this step, train data set has 74 samples and provided the resampling results to select tuning parameter. The smallest Root Mean Square Error(RMSE) and the largest of the variance(Rsquared) indicate the best tuning parameter. It appears that model with the value of mtry equal to 158 can expect the result best. I checked the model one more time using different resampling technique to cross-validation to check the accuracy of the model.

##change the resampling technique to cross-validation
set.seed(2023)

train_control <-
  trainControl(method = "repeatedcv",
               number = 10,
               repeats = 10)

rf_fit1 <-
  train(GRADE ~ .,
        data = data_train,
        method = "ranger",
        trControl = train_control)

rf_fit1
Random Forest 

74 samples
15 predictors

No pre-processing
Resampling: Cross-Validated (10 fold, repeated 10 times) 
Summary of sample sizes: 67, 66, 68, 65, 66, 67, ... 
Resampling results across tuning parameters:

  mtry  splitrule   RMSE      Rsquared   MAE     
    2   variance    2.181029  0.3614700  1.913714
    2   extratrees  2.187645  0.3374679  1.921027
   80   variance    1.344958  0.6826343  1.120620
   80   extratrees  1.510168  0.6172894  1.267233
  158   variance    1.259087  0.7155164  1.015275
  158   extratrees  1.423674  0.6370982  1.165012

Tuning parameter 'min.node.size' was held constant at a value of 5
RMSE was used to select the optimal model using the smallest value.
The final values used for the model were mtry = 158, splitrule = variance
 and min.node.size = 5.

I could confirm the model with mtry = 158, the split rule was variance and the minimum node size = 5 is the best model.

However, I added another grid of values to test for mtry and min.node.size.

# Create a grid of different values of mtry, different splitrules, and different minimum node sizes to test
tune_grid <-
  expand.grid(
    mtry = c(2, 41, 80, 121, 158),
    splitrule = c("variance", "extratrees"),
    min.node.size = c(1, 5, 10, 15, 20)
  )

# Fit a new model, using the tuning grid 
rf_fit2 <-
  train(GRADE ~ .,
        data = data_train,
        method = "ranger",
        tuneGrid = tune_grid)

rf_fit2
Random Forest 

74 samples
15 predictors

No pre-processing
Resampling: Bootstrapped (25 reps) 
Summary of sample sizes: 74, 74, 74, 74, 74, 74, ... 
Resampling results across tuning parameters:

  mtry  splitrule   min.node.size  RMSE      Rsquared   MAE     
    2   variance     1             2.184881  0.2358347  1.906074
    2   variance     5             2.182094  0.2547725  1.903724
    2   variance    10             2.181708  0.2445329  1.902825
    2   variance    15             2.179412  0.2682734  1.900923
    2   variance    20             2.183543  0.2502318  1.906260
    2   extratrees   1             2.186748  0.2604638  1.909033
    2   extratrees   5             2.186842  0.2688824  1.908008
    2   extratrees  10             2.187998  0.2411494  1.909074
    2   extratrees  15             2.185699  0.2494277  1.908278
    2   extratrees  20             2.186449  0.2517325  1.908417
   41   variance     1             1.605696  0.5172779  1.345521
   41   variance     5             1.612394  0.5159605  1.352813
   41   variance    10             1.644879  0.5050024  1.386271
   41   variance    15             1.667642  0.4997801  1.410672
   41   variance    20             1.696576  0.4928887  1.439093
   41   extratrees   1             1.723772  0.4661334  1.447775
   41   extratrees   5             1.740102  0.4613319  1.463795
   41   extratrees  10             1.766174  0.4524263  1.491762
   41   extratrees  15             1.795734  0.4398383  1.519730
   41   extratrees  20             1.824367  0.4351264  1.546976
   80   variance     1             1.497224  0.5604817  1.218721
   80   variance     5             1.502610  0.5574198  1.224467
   80   variance    10             1.508108  0.5577315  1.236340
   80   variance    15             1.523860  0.5571380  1.260687
   80   variance    20             1.543066  0.5507371  1.280133
   80   extratrees   1             1.643545  0.5018280  1.354060
   80   extratrees   5             1.647651  0.4967916  1.362425
   80   extratrees  10             1.666920  0.4919064  1.386893
   80   extratrees  15             1.692923  0.4880750  1.415145
   80   extratrees  20             1.720106  0.4779404  1.446008
  121   variance     1             1.457589  0.5802898  1.168223
  121   variance     5             1.460081  0.5782789  1.172644
  121   variance    10             1.461754  0.5772320  1.174520
  121   variance    15             1.465365  0.5782277  1.185888
  121   variance    20             1.465503  0.5821165  1.197079
  121   extratrees   1             1.596858  0.5208921  1.297289
  121   extratrees   5             1.604205  0.5190542  1.310618
  121   extratrees  10             1.609153  0.5195102  1.320627
  121   extratrees  15             1.637943  0.5059270  1.356967
  121   extratrees  20             1.668986  0.4970086  1.393654
  158   variance     1             1.448299  0.5874383  1.148431
  158   variance     5             1.453852  0.5845649  1.152850
  158   variance    10             1.454042  0.5844036  1.155403
  158   variance    15             1.451605  0.5883805  1.157113
  158   variance    20             1.456318  0.5848497  1.174185
  158   extratrees   1             1.579143  0.5277657  1.272874
  158   extratrees   5             1.578276  0.5282493  1.278359
  158   extratrees  10             1.586292  0.5272617  1.288344
  158   extratrees  15             1.602472  0.5199752  1.311836
  158   extratrees  20             1.634614  0.5074264  1.355399

RMSE was used to select the optimal model using the smallest value.
The final values used for the model were mtry = 158, splitrule = variance
 and min.node.size = 1.

From the result, the model with the same values as identified before mtry = 158 and splirule=variance, but with min.node.size equal to 1 seems to fit best. Therefore, I selected the model as the final model named rf_fit2

#select the "finalModel" output from the rf_fit2 model
rf_fit2$finalModel
Ranger result

Call:
 ranger::ranger(dependent.variable.name = ".outcome", data = x,      mtry = min(param$mtry, ncol(x)), min.node.size = param$min.node.size,      splitrule = as.character(param$splitrule), write.forest = TRUE,      probability = classProbs, ...) 

Type:                             Regression 
Number of trees:                  500 
Sample size:                      74 
Number of independent variables:  158 
Mtry:                             158 
Target node size:                 1 
Variable importance mode:         none 
Splitrule:                        variance 
OOB prediction error (MSE):       1.603449 
R squared (OOB):                  0.6778552 

3.3 Examining predictive accuracy on the test data set

To examine predictive accuracy, I put testing data through the model, and assigned the predicted values to a column called ‘pred’. In addition, I will make a column called ‘obs’ that has the real end term grade (GRADE). Then, I compared predicted and observed values to see how the model works.

# setting a seed for reproducibility
set.seed(2023)

# Create a new object for the testing data including predicted values 
data_test_augmented <-
  data_test %>%
  mutate(pred = predict(rf_fit2, data_test),
         obs = GRADE)
mutate: new variable 'pred' (double) with 69 unique values and 0% NA
        new variable 'obs' (double) with 8 unique values and 0% NA
# Transform this new object into a data frame
defaultSummary(as.data.frame(data_test_augmented))
     RMSE  Rsquared       MAE 
1.6010290 0.4871063 1.2181972 

Comparing the values to the ones I got from the training. The training data got RMSE = 1.448299, Rsquare = 0.5874383, MAE = 1.148431. The new values from the testing data are RMSE = 1.6010290, Rsquare = 0.4871063, MAE = 1. 2181972. The model performance was worse for the testing data as compared to the training data, because this testing data is new to the model, and the result is very similar, it can be interpret the model works greatly.

3.4 Variable importance

Random forest model has a very helpful characteristic which shows the importance of variables. I re-ran the ‘rf-fit2’ model with additional argument, importance.

# setting a seed for reproducibility
set.seed(2023)

# Specify the same model as earlier with the addition of the variable importance metric
rf_fit2_imp <-
  train(
    GRADE ~ .,
    data = data_train,
    method = "ranger",
    tuneGrid = tune_grid,
    importance = "permutation"
  )

# Extract the variable importance from this new model
varImp(rf_fit2_imp)
ranger variable importance

  only 20 most important variables shown (out of 158)

               Overall
CID           100.0000
Sex            13.3947
CGPAlast        8.9939
stype           1.6974
Moed            0.4954
attclass        0.4307
notetaking      0.4060
SIDSTUDENT105   0.3866
SIDSTUDENT8     0.3866
SIDSTUDENT119   0.3866
SIDSTUDENT62    0.3866
SIDSTUDENT58    0.3866
SIDSTUDENT67    0.3866
SIDSTUDENT5     0.3866
SIDSTUDENT93    0.3866
SIDSTUDENT131   0.3866
SIDSTUDENT97    0.3866
SIDSTUDENT26    0.3866
SIDSTUDENT30    0.3866
SIDSTUDENT47    0.3866

Finally, I got the ranked the order list of the variables answering the research question: which factors are most predictive of students’ performance. From the result above, course ID (CID), sex, comlative GPA in the last semester (CGPAlast) are the top 3 predictors for the end term grade.

3.5 Visualization

Now, this result can be visualized using the ‘ggplot’ function. The first 7 effective predictors are visualized only.

#visualization
varImp(rf_fit2_imp) %>%
  pluck(1) %>%
  rownames_to_column("var") %>%
  top_n(7, Overall) %>%
  ggplot(aes(x = reorder(var, Overall), y = Overall)) +
  geom_col(fill = dataedu_colors("darkblue")) +
  coord_flip() +
  labs(x="Variable",y="Importance")
top_n: removed 151 rows (96%), 7 rows remaining

  theme_dataedu()
List of 97
 $ line                      :List of 6
  ..$ colour       : chr "black"
  ..$ linewidth    : num 0.545
  ..$ linetype     : num 1
  ..$ lineend      : chr "butt"
  ..$ arrow        : logi FALSE
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_line" "element"
 $ rect                      :List of 5
  ..$ fill         : chr "white"
  ..$ colour       : chr "black"
  ..$ linewidth    : num 0.545
  ..$ linetype     : num 1
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_rect" "element"
 $ text                      :List of 11
  ..$ family       : chr "Cabin"
  ..$ face         : chr "plain"
  ..$ colour       : chr "black"
  ..$ size         : num 12
  ..$ hjust        : num 0.5
  ..$ vjust        : num 0.5
  ..$ angle        : num 0
  ..$ lineheight   : num 0.9
  ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : logi FALSE
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ title                     : NULL
 $ aspect.ratio              : NULL
 $ axis.title                : NULL
 $ axis.title.x              :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : NULL
  ..$ vjust        : num 1
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 3points 0points 0points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ axis.title.x.top          :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : NULL
  ..$ vjust        : num 0
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 0points 0points 3points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ axis.title.x.bottom       : NULL
 $ axis.title.y              :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : NULL
  ..$ vjust        : num 1
  ..$ angle        : num 90
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 0points 3points 0points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ axis.title.y.left         : NULL
 $ axis.title.y.right        :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : NULL
  ..$ vjust        : num 0
  ..$ angle        : num -90
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 0points 0points 0points 3points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ axis.text                 :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : chr "grey30"
  ..$ size         : 'rel' num 0.8
  ..$ hjust        : NULL
  ..$ vjust        : NULL
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : NULL
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ axis.text.x               :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : NULL
  ..$ vjust        : num 1
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 2.4points 0points 0points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ axis.text.x.top           :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : NULL
  ..$ vjust        : num 0
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 0points 0points 2.4points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ axis.text.x.bottom        : NULL
 $ axis.text.y               :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : num 1
  ..$ vjust        : NULL
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 0points 2.4points 0points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ axis.text.y.left          : NULL
 $ axis.text.y.right         :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : num 0
  ..$ vjust        : NULL
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.4points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ axis.ticks                : list()
  ..- attr(*, "class")= chr [1:2] "element_blank" "element"
 $ axis.ticks.x              : NULL
 $ axis.ticks.x.top          : NULL
 $ axis.ticks.x.bottom       : NULL
 $ axis.ticks.y              : NULL
 $ axis.ticks.y.left         : NULL
 $ axis.ticks.y.right        : NULL
 $ axis.ticks.length         : 'simpleUnit' num 3points
  ..- attr(*, "unit")= int 8
 $ axis.ticks.length.x       : NULL
 $ axis.ticks.length.x.top   : NULL
 $ axis.ticks.length.x.bottom: NULL
 $ axis.ticks.length.y       : NULL
 $ axis.ticks.length.y.left  : NULL
 $ axis.ticks.length.y.right : NULL
 $ axis.line                 : list()
  ..- attr(*, "class")= chr [1:2] "element_blank" "element"
 $ axis.line.x               : NULL
 $ axis.line.x.top           : NULL
 $ axis.line.x.bottom        : NULL
 $ axis.line.y               : NULL
 $ axis.line.y.left          : NULL
 $ axis.line.y.right         : NULL
 $ legend.background         : list()
  ..- attr(*, "class")= chr [1:2] "element_blank" "element"
 $ legend.margin             : 'margin' num [1:4] 6points 6points 6points 6points
  ..- attr(*, "unit")= int 8
 $ legend.spacing            : 'simpleUnit' num 12points
  ..- attr(*, "unit")= int 8
 $ legend.spacing.x          : NULL
 $ legend.spacing.y          : NULL
 $ legend.key                : list()
  ..- attr(*, "class")= chr [1:2] "element_blank" "element"
 $ legend.key.size           : 'simpleUnit' num 1.2lines
  ..- attr(*, "unit")= int 3
 $ legend.key.height         : NULL
 $ legend.key.width          : NULL
 $ legend.text               :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : 'rel' num 0.8
  ..$ hjust        : NULL
  ..$ vjust        : NULL
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : NULL
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ legend.text.align         : NULL
 $ legend.title              :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : num 0
  ..$ vjust        : NULL
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : NULL
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ legend.title.align        : NULL
 $ legend.position           : chr "right"
 $ legend.direction          : NULL
 $ legend.justification      : chr "center"
 $ legend.box                : NULL
 $ legend.box.just           : NULL
 $ legend.box.margin         : 'margin' num [1:4] 0cm 0cm 0cm 0cm
  ..- attr(*, "unit")= int 1
 $ legend.box.background     : list()
  ..- attr(*, "class")= chr [1:2] "element_blank" "element"
 $ legend.box.spacing        : 'simpleUnit' num 12points
  ..- attr(*, "unit")= int 8
 $ panel.background          : list()
  ..- attr(*, "class")= chr [1:2] "element_blank" "element"
 $ panel.border              : list()
  ..- attr(*, "class")= chr [1:2] "element_blank" "element"
 $ panel.spacing             : 'simpleUnit' num 6points
  ..- attr(*, "unit")= int 8
 $ panel.spacing.x           : NULL
 $ panel.spacing.y           : NULL
 $ panel.grid                :List of 6
  ..$ colour       : chr "grey92"
  ..$ linewidth    : NULL
  ..$ linetype     : NULL
  ..$ lineend      : NULL
  ..$ arrow        : logi FALSE
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_line" "element"
 $ panel.grid.major          : NULL
 $ panel.grid.minor          :List of 6
  ..$ colour       : NULL
  ..$ linewidth    : 'rel' num 0.5
  ..$ linetype     : NULL
  ..$ lineend      : NULL
  ..$ arrow        : logi FALSE
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_line" "element"
 $ panel.grid.major.x        : NULL
 $ panel.grid.major.y        : NULL
 $ panel.grid.minor.x        : NULL
 $ panel.grid.minor.y        : NULL
 $ panel.ontop               : logi FALSE
 $ plot.background           : list()
  ..- attr(*, "class")= chr [1:2] "element_blank" "element"
 $ plot.title                :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : 'rel' num 1.2
  ..$ hjust        : num 0
  ..$ vjust        : num 1
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 0points 0points 6points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ plot.title.position       : chr "panel"
 $ plot.subtitle             :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : num 0
  ..$ vjust        : num 1
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 0points 0points 6points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ plot.caption              :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : 'rel' num 0.8
  ..$ hjust        : num 1
  ..$ vjust        : num 1
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 6points 0points 0points 0points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ plot.caption.position     : chr "panel"
 $ plot.tag                  :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : 'rel' num 1.2
  ..$ hjust        : num 0.5
  ..$ vjust        : num 0.5
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : NULL
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ plot.tag.position         : chr "topleft"
 $ plot.margin               : 'margin' num [1:4] 6points 6points 6points 6points
  ..- attr(*, "unit")= int 8
 $ strip.background          : list()
  ..- attr(*, "class")= chr [1:2] "element_blank" "element"
 $ strip.background.x        : NULL
 $ strip.background.y        : NULL
 $ strip.clip                : chr "inherit"
 $ strip.placement           : chr "inside"
 $ strip.text                :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : chr "grey10"
  ..$ size         : 'rel' num 0.8
  ..$ hjust        : NULL
  ..$ vjust        : NULL
  ..$ angle        : NULL
  ..$ lineheight   : NULL
  ..$ margin       : 'margin' num [1:4] 4.8points 4.8points 4.8points 4.8points
  .. ..- attr(*, "unit")= int 8
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ strip.text.x              : NULL
 $ strip.text.x.bottom       : NULL
 $ strip.text.x.top          : NULL
 $ strip.text.y              :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : NULL
  ..$ vjust        : NULL
  ..$ angle        : num -90
  ..$ lineheight   : NULL
  ..$ margin       : NULL
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ strip.text.y.left         :List of 11
  ..$ family       : NULL
  ..$ face         : NULL
  ..$ colour       : NULL
  ..$ size         : NULL
  ..$ hjust        : NULL
  ..$ vjust        : NULL
  ..$ angle        : num 90
  ..$ lineheight   : NULL
  ..$ margin       : NULL
  ..$ debug        : NULL
  ..$ inherit.blank: logi TRUE
  ..- attr(*, "class")= chr [1:2] "element_text" "element"
 $ strip.text.y.right        : NULL
 $ strip.switch.pad.grid     : 'simpleUnit' num 3points
  ..- attr(*, "unit")= int 8
 $ strip.switch.pad.wrap     : 'simpleUnit' num 3points
  ..- attr(*, "unit")= int 8
 - attr(*, "class")= chr [1:2] "theme" "gg"
 - attr(*, "complete")= logi TRUE
 - attr(*, "validate")= logi TRUE

4. Communication

4.1 Key finding and insights

From the Machine Learning and Random Forest techniques, there are 7 factors that affect to the end term grade from the given dataset. Course ID was the most predictive variable because each course has a very different average of final grade. Sex, CGPA in the last semester and scholarship type were the next most important predictors. The course developers and professors can use this type of analysis to predict students who would struggle in the course or drop-out.

4.2 Suggestion of potential actions and limitation

This project has some limitation because the information about the background how to collect the data was limited. It was hard to interpret the results without deep understand of the dataset and the context. However, it was still meaningful for future real studies.

It would be interesting if I separate the variable into groups, such as personal questions, family questions, and study habit questions and see which group impact most on students’ performance.

Another aspect I can consider in the future with similar project is comparison with regression to see the effectiveness of machine learning.

Reference

Estrellado, R. A., Freer, E. A., Motsipak, J., Rosenberg, J. M., & Velásquez, I. C. (2020). Data science in education using R, chapter 14. London, England: Routledge. Nb. All authors contributed equally.

Namoun, A., & Alshanqiti, A. (2020). Predicting student performance using data mining and learning analytics techniques: A systematic literature review. Applied Sciences, 11(1), 237.

Rastrollo-Guerrero, J. L., Gómez-Pulido, J. A., & Durán-Domínguez, A. (2020). Analyzing and predicting students' performance by means of machine learning: A review. Applied sciences, 10(3), 1042.

Yılmaz, N., & Sekeroglu, B. (2019, August). Student performance classification using artificial intelligence techniques. In International Conference on Theory and Application of Soft Computing, Computing with Words and Perceptions (pp. 596-603). Cham: Springer International Publishing.