Last updated: 2022-11-29

Checks: 7 0

Knit directory: myTidyTuesday/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20210907) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version c07b02a. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/figure/
    Ignored:    data/.Rhistory
    Ignored:    data/2022_11_01.png
    Ignored:    data/2022_11_18.png
    Ignored:    data/CNHI_Excel_Chart.xlsx
    Ignored:    data/Chicago.rds
    Ignored:    data/CommunityTreemap.jpeg
    Ignored:    data/Community_Roles.jpeg
    Ignored:    data/ELL.zip
    Ignored:    data/FM_service_contour_current.zip
    Ignored:    data/SeriesReport-20220414171148_6c3b18.xlsx
    Ignored:    data/Weekly_Chicago_IL_Regular_Reformulated_Retail_Gasoline_Prices.csv
    Ignored:    data/YammerDigitalDataScienceMembership.xlsx
    Ignored:    data/YammerMemberPage.rds
    Ignored:    data/YammerMembers.rds
    Ignored:    data/application_id.feather
    Ignored:    data/df.rds
    Ignored:    data/fit_cohesion.rds
    Ignored:    data/fit_grammar.rds
    Ignored:    data/fit_phraseology.rds
    Ignored:    data/fit_syntax.rds
    Ignored:    data/fit_vocabulary.rds
    Ignored:    data/grainstocks.rds
    Ignored:    data/hike_data.rds
    Ignored:    data/lm_res.rds
    Ignored:    data/raw_contour.feather
    Ignored:    data/raw_weather.RData
    Ignored:    data/sample_submission.csv
    Ignored:    data/submission.csv
    Ignored:    data/test.csv
    Ignored:    data/train.csv
    Ignored:    data/us_states.rds
    Ignored:    data/us_states_hexgrid.geojson
    Ignored:    data/weatherstats_toronto_daily.csv

Untracked files:
    Untracked:  analysis/2022_09_01_kaggle_tabular_playground.qmd
    Untracked:  code/YammerReach.R
    Untracked:  code/autokeras.R
    Untracked:  code/chicago.R
    Untracked:  code/glmnet_test.R
    Untracked:  code/googleCompute.R
    Untracked:  code/work list batch targets.R
    Untracked:  environment.yml
    Untracked:  report.html

Unstaged changes:
    Modified:   analysis/2021_01_19_tidy_tuesday.Rmd
    Modified:   analysis/2021_03_24_tidy_tuesday.Rmd
    Deleted:    analysis/2021_04_20.Rmd
    Deleted:    analysis/2022_02_11_tabular_playground.Rmd
    Deleted:    analysis/2022_04_18.qmd
    Modified:   analysis/Survival.Rmd
    Modified:   analysis/_site.yml
    Modified:   code/_common.R

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/EnglishLanguageLearning.Rmd) and HTML (docs/EnglishLanguageLearning.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd c07b02a opus1993 2022-11-29 wflow_publish("analysis/EnglishLanguageLearning.Rmd")
Rmd 42d2421 opus1993 2022-11-29 add likert and resamples on all metrics
html b5a9c2b opus1993 2022-10-15 Build site.
html fad0136 opus1993 2022-10-15 Build site.
Rmd 73c07de opus1993 2022-10-15 Kaggle English Language Learning
html 66b10e0 opus1993 2022-10-15 Build site.
Rmd bb8b757 opus1993 2022-10-15 initial commit of Kaggle English Language Learning

The Kaggle Challenge presented here works with a dataset that comprises argumentative essays (the ELLIPSE corpus) written by 8th-12th grade English Language Learners (ELLs). The essays have been scored on six measures: cohesion, syntax, vocabulary, phraseology, grammar, and conventions.

Each measure represents a component of writing proficiency, ranging from 1.0 to 5.0 in increments of 0.5. Our task is to predict the score of each measure by essay.

This is the rubric that was used to grade the essays. Two people did the work independently, and then the scores were compared for alignment.

Preprocessing

Natural Language Processing techniques offer a wide variety of tools to approach this problem. The Kaggle host is requiring that the model run as a standalone, without internet assistance. They also ask for a parsimonous, explainable model.

We will start with exploring the predictive potential of the text count features, like numbers of words, distinct words, and spaces.

Unsupervised topic grouping categories may be useful for measures like conventions or grammar. In this case, we will start with Latent Dirichlet allocation (LDA).

Individual words may have predictive power, but they could be so sparse as to be difficult to separate from the background noise. Consider words like ain’t and phrases taken from other languages.

Bringing in a sentiment dictionary may add predictive power to some measures, along with helping to count miss-spellings. Word embeddings like Glove or Huggingface could also better characterize meaning.

Modeling

Many developers are tempted to jump into (CNN / LSTM) deep learning, but the number of essays is really pretty small for a deep learning run on their own. Another approach could leverage the pre-trained embeddings in one of the BERTs. The current Kaggle leaderboard is full of them. Even so, the standings will shift in a huge way after the full test set calculations appear because of overfitting and imbalance.

The GloVe pre-trained word vectors provide word embeddings created on existing document corpus, and are provided as a pre-processor using varying numbers of tokens. See Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014. GloVe: Global Vectors for Word Representation. for details.

I spent a few evenings with the torch/brulee approach on tidymodels, but discovered that modeling time consumed would be significant and the results were not better than random forests on engineered features with case weights based on inverse proportions of the metric values.

I ultimately settled on the xgboost approach here. No doubt it can still overfit on specific words and text attributes, like the number of unique words.

One last point. I believe that the Essay Scoring is done by humans in a way where the metrics are judged together, and not entirely independently. In other words, low grammar and low cohesion are related.

suppressPackageStartupMessages({
library(tidyverse)
  
library(tidymodels)
library(text2vec) # for topic modeling

library(tidytext)
library(textrecipes)

})

tidymodels::tidymodels_prefer()

theme_set(theme_minimal())

Let’s read the data from Kaggle’s csv’s into dataframes.

train_essays_raw <- read_csv(here::here("data","train.csv"),
                         show_col_types = FALSE) 

submit_essays_raw <- read_csv(here::here("data","test.csv"),
                          show_col_types = FALSE) 

outcomes = names(train_essays_raw)[3:8]

dim(train_essays_raw)
[1] 3911    8

The essay metrics score distributions resemble ordinal Likert scales. One way to illustrate the counts at each level is this bar chart:

stage1 <- train_essays_raw |>
  select(cohesion:conventions) |>
  pivot_longer(cols = everything(),
               names_to = "metric",
               values_to = "ans") |>
  group_by(ans, metric) |>
  summarize(n = n(),
            .groups = "drop") |>
  group_by(metric) |>
  mutate(per = n / sum(n)) |>
  mutate(
    text = paste0(formatC(
      100 * per, format = "f", digits = 0
    ), "%"),
    cs = cumsum(per),
    offset = sum(per[1:(floor(n() / 2))]) + (n() %% 2) * 0.5 * (per[ceiling(n() /
                                                                              2)]),
    xmax = -offset + cs,
    xmin = xmax - per
  ) |>
  ungroup()

gap <- 0.2

stage2 <- stage1 %>%
  left_join(
    stage1 %>%
      group_by(metric) %>%
      summarize(max.xmax = max(xmax)) %>%
      mutate(r = row_number(max.xmax)),
    by = "metric"
  ) %>%
  arrange(desc(r)) %>%
  mutate(ymin = r - (1 - gap) / 2,
         ymax = r + (1 - gap) / 2)

ggplot(stage2) +
  geom_vline(xintercept = 0) +
  geom_rect(aes(
    xmin = xmin,
    xmax = xmax,
    ymin = ymin,
    ymax = ymax,
    fill = factor(ans)
  )) +
  geom_text(aes(
    x = (xmin + xmax) / 2,
    y = (ymin + ymax) / 2,
    label = text
  ),
  size = 3,
  check_overlap = TRUE) +
  scale_x_continuous(
    "",
    labels = percent,
    breaks = seq(-0.6, 0.65, len = 6),
    limits = c(-0.6, 0.65)
  ) +   scale_y_continuous(
    "",
    breaks = 1:n_distinct(stage2$metric),
    labels = rev(stage2 %>% distinct(metric) %>% .$metric)
  ) +
  scale_fill_brewer("Score", palette = "BrBG") +
  labs(title = "Training set Essay Ratings")

Essays with more words, or more sentences, do not necessarily score better.

te_long <- train_essays_raw |>
  pivot_longer(cols = cohesion:conventions,
               names_to = "metric",
               values_to = "value") |>
  mutate(metric = as.factor(metric),
         value = as.factor(value))

te_long |> 
  group_by(n_words = ggplot2::cut_interval(
    tokenizers::count_words(full_text), 
    length = 200),
    metric, value) |> 
  summarise(`Number of essays` = n(),
            .groups = "drop") |> 
  ggplot(aes(n_words, `Number of essays`, fill = as.factor(value))) +
  geom_col() +
  scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
  facet_wrap(vars(metric)) +
  scale_fill_brewer("Score", palette = "BrBG") +
  labs(x = "Number of words per essay",
       y = "Number of essays",
       fill = "Score")

te_long |> 
  group_by(n_words = ggplot2::cut_interval(
    tokenizers::count_sentences(full_text), length = 20),
    metric, value) |> 
  summarise(`Number of essays` = n(),
            .groups = "drop") |> 
  ggplot(aes(n_words, `Number of essays`, fill = as.factor(value))) +
  geom_col() +
  scale_x_discrete(guide = guide_axis(n.dodge = 2)) +
  facet_wrap(vars(metric)) +
  scale_fill_brewer("Score", palette = "BrBG") +
  labs(x = "Number of sentences per essay",
       y = "Number of essays",
       fill = "Score")

What words from the dialogue have the highest log odds of coming from each level of each outcome? Do the individual words have predictive power?

plot_log_odds <- function(outcome = "cohesion"){

train_essays_raw |>
  tidytext::unnest_tokens(word, full_text) |> 
  count(level = factor(.data[[outcome]]), word, sort = TRUE) |>   
  tidylo::bind_log_odds(level, word, n) |> 
  filter(n > 20) |> 
  group_by(level) |> 
  slice_max(log_odds_weighted, n = 10) |> 
  mutate(word = reorder_within(word, log_odds_weighted, level)) %>%
  ggplot(aes(log_odds_weighted, word, fill = level)) +
  geom_col(show.legend = FALSE) +
  facet_wrap(vars(level), scales = "free") +
  scale_fill_brewer("Score", palette = "BrBG") +
  scale_y_reordered() +
  labs(y = NULL, title = glue::glue("{outcome} log odds words"))  
    
}

map(outcomes, plot_log_odds)
[[1]]


[[2]]


[[3]]


[[4]]


[[5]]


[[6]]

To some extent, the answer may be yes.

Let’s also take a look at outcome pairwise correlations.

train_essays_raw |> 
  corrr::correlate(
    quiet = TRUE
  ) %>%
  corrr::rearrange() %>%
  corrr::shave() %>%
  corrr::rplot(print_cor = TRUE,
               colors = brewer_pal(palette = "BrBG")(5)) +
  scale_x_discrete(guide = guide_axis(n.dodge = 3))

Avoiding overfitting to the training data is critical to achieving a strong score. We are going to use resampling to have some indication that our model generalizes to new essays. Care must be exercised to be sure that members of the hold out folds are not also found in the training folds.

Latent Dirichlet allocation (LDA) is an unsupervised generative statistical model that explains a set of observations through unobserved groups, and the content of each group may explain why some parts of the data are similar.

I’d like to explore the use of inverse probability weights because there are so few essays with scores at the highest and lowest levels. When survey respondents have different probabilities of selection, (inverse) probability weights help reduce bias in the results.

I am making us of metaprogramming techniques to pass text vector column names into the formula and case weights functions to re-use them for each metric.

tokens = text2vec::word_tokenizer(tolower(train_essays_raw$full_text))

it = text2vec::itoken(tokens, ids = train_essays_raw$text_id, progressbar = FALSE)

v = text2vec::create_vocabulary(it)

dtm = text2vec::create_dtm(it, text2vec::vocab_vectorizer(v), type = "RsparseMatrix")

lda_model <- text2vec::LDA$new(n_topics = 30)

case_weight_builder <- function(data, outcome) {
  data %>%
    inner_join(data %>%
                 count(.data[[outcome]],
                       name = "case_wts"),
               by = glue::glue("{ outcome }")) %>%
    mutate(case_wts = importance_weights(max(case_wts) / case_wts))
}

recipe_builder <- function(outcome = "cohesion") {
  rec <- recipe(
    formula(glue::glue("{ outcome } ~ .")),
    data = train_essays_raw |>
      select({
        {
          outcome
        }
      }, full_text) |>
      case_weight_builder(outcome)
  ) |>
    step_textfeature(full_text,
                     keep_original_cols = TRUE) |>
    step_rename_at(starts_with("textfeature_"),
                   fn = ~ gsub("textfeature_full_text_", "", .)) %>%
    step_tokenize(full_text) %>%
    step_lda(full_text,
             lda_models = lda_model,
             keep_original_cols = TRUE) %>%
    step_word_embeddings(
      full_text,
      aggregation = "sum",
      embeddings = textdata::embedding_glove27b(dimensions = 200)
    ) |>
    step_zv(all_numeric_predictors()) |>
    step_normalize(all_numeric_predictors())
  
  return(rec)
  
}


multiclass_recipe_builder <- function(outcome = "cohesion") {
  rec <- recipe(formula(glue::glue("{ outcome } ~ .")),
                data = classification_train_df) |>
    step_textfeature(full_text,
                     keep_original_cols = TRUE) |>
    step_rename_at(starts_with("textfeature_"),
                   fn = ~ gsub("textfeature_full_text_", "", .)) %>%
    step_tokenize(full_text) %>%
    step_lda(full_text,
             lda_models = lda_model,
             keep_original_cols = TRUE) %>%
    step_word_embeddings(
      full_text,
      aggregation = "sum",
      embeddings = textdata::embedding_glove27b(dimensions = 200)
    ) |>
    step_zv(all_numeric_predictors()) |>
    step_normalize(all_numeric_predictors())
  
  return(rec)
  
}

plot_preds <- function(dat, outcome){

dat |> 
  ggplot(aes(x = {{outcome}}, y = .pred)) +
  geom_point(alpha = 0.15) +
  geom_abline(color = "red") +
  coord_obs_pred() 

}

As mentioned above, the model specification is xgboost for regression to predict a continuous outcome that resembles ordinal classes.

xgb_spec <-
  boost_tree(
    mtry = 50,  # 75L
    trees = 1000L,
    tree_depth = 9, # 6L
    learn_rate = 0.01,  # originally 0.1
    min_n = 39L,  # 20L
    loss_reduction = 0
  ) |> 
  set_engine('xgboost') |> 
  set_mode('regression')

svm_spec <- svm_linear() |> 
  set_engine("LiblineaR") |> 
  set_mode("classification")  

To speed the computations let’s enable a parallel backend.

all_cores <- parallelly::availableCores(omit = 1)
all_cores
system 
    11 
#  
future::plan("multisession", workers = all_cores) # on Windows

Modeling

We fit for cohesion first using an xgboost regression, using case weights to adjust for the frequency of occurrence of each value of cohesion.

outcome <- outcomes[1]

regression_train_df <- train_essays_raw  |> 
                select(!!outcome, full_text) |> 
                case_weight_builder(outcome)

regression_wf <- workflow(recipe_builder(outcome = outcome), xgb_spec) |> 
       add_case_weights(case_wts)

folds <- vfold_cv(regression_train_df, strata = {{outcome}})

set.seed(42)  
rs <- fit_resamples(
  regression_wf,
  folds,
  control = control_resamples(save_pred = TRUE))
as(<dgTMatrix>, "dgCMatrix") is deprecated since Matrix 1.5-0; do as(., "CsparseMatrix") instead
collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
rsqstandard0.2878297100.014905231Preprocessor1_Model1
rmsestandard0.5597743100.005475016Preprocessor1_Model1
collect_predictions(rs) |> 
  plot_preds(.data[[outcome]]) +
  labs(y = "Predicted",
       title = paste0(outcome, " predictions against essays in held out folds"),
       subtitle = "The highest and lowest essays are not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = .data[[outcome]] - .pred) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text)
ABCDEFGHIJ0123456789
full_text
<chr>
One topic that is frequently debated is if people should make their own decisions or seek guidance about life's important matters. People think that they should make their own decisions. They feel that it makes them learn from their mistakes and become mentally strong. I believe that people should seek guidance from experts because they know more about life's important matters, some people don't know how to make the right decisions , and they may help them with valuable lessons.\n\nExperts may know more about life's important matters than most people. They might've learned from experience or studied others, a class of sociology. They know if something is wrong with the person, if they had a bad day, and if they had sleep.\n\nSome individuals don't really know how to make the correct choices, they often try to make the worst choices work but that will never happen. They're afraid on what the good choices bring, if it brings good or if it brings worse.\n\nAs you have read, it is strongly recommended that people should seek advice from experts, because we will not let others make bad decisions unless they are good ones.
Yes i am agrey life's is important and people who value self-reliance define it as the need for each individual to Follow his or her own ideas, the have experinse aboute life is good way to get a bettar life, and everyday there try To be a besst person for won life thare chaling his/her self that people working hart,stady hart they wnat a good life In the futchar.\n\nSome people's take essy own life like relaxe there not try anyway there needit, they are not wary about own life They are not save meony thay are not wary if somting expansef just the want buy it.\n\nSo many people's follow a faumos perons life thare raed thare books or some of them make vidoes and people Wacting the know somting more aboute life, i like that people they be a good perosn, try to get a good life in the futchar.\n\nEevar life is impart to me or for others people any wnat a good life respacat anyone heple anyone for anyway the can helpe people, .\n\nsome people wnat a bat person, that persons life is nothiong, like thery kile person, or they are sell somting, Alot of yonge kids not going to the school they are ideas school not important that kids going to the worge way there wnat moeny just moeny, that people not wary for tommaro what happen on life one day they go to the jale for wohel life. they know we are going so wrong at this part they can't noting in the world so many ting living animal, person anythig try a good person .\n\nSmart people follow a faumos person life they want batter life for whole life,and that people red the books and They know somting more aboute life, some of tame resching aboute life before thare start somting taking with that Perons his expersns for that job or anything alos, they are dowing a hart work to make a more many and save many For the futchar, with hart workig the grow up his or her stady in the futchar geting what they wnat do be, and wnat Take ideas for life what thare tining what happen if a i am lost what happen if i am lost all my mony, thare thiking Everthig which is they want to lost his or her life, and they are chaling his or her self for the batter life.\n\nEvery life is important to me , everyone wnat do somtiong or helpe some one or be a good thing for other people in the world some of people jobs is Dctor and helpe sick people or if some one very sick helpe them to gave back his or her life anyone can helpe some needs helpe and gave backe his or her life, we are coming on this word for one times do somting in the futchar prowd of we are self rescpakt anyone and no one wants one day do it somting get your self sad, some of cuntury is war alot of people dia and in the war, but the others cunturys is not war, and meybey for one day four or morethin four kids coming a life, life for some one is Nice but others is not is very short very short.
Many people are kind and do parts in helping others , what they don't know is , the act of kindness either received from or given to someone has a big impact no matter how small or big . Reasons an act of kindness can really benefit someone are , the person might have a better day just because of your kindness , the person might learn from your act of kindness and lastly , a good act of kindness can come back to you from the person who you helped .\n\nThe first reason of how kindness can impact a person is , the person whom you helped might have had a bad day or , you never know what someone is going through , they could have a hard life and are hiding it . The person who received the act of kindness might have bad a bad day or life , your kindness could have made that person feel so much better and worthy. Some people don't often receive kindness , you might have put a big smile on their face or , made their day much better . You can be seen as a person with good characters and manners , people can always depend on you if you are a kind person and do a lot to help make someone feel better with words or actions everyday , most people would appreciate you if you did almost anything to help them or make them smile because again , you never know what someone is going through . For example , I partnered up with a girl in our math class , she was crying for some reason and nobody wanted to be her partner , when I told her if she can be my partner , she said yes and sounded really happy when I said . I , of course told her what was wrong , she told me she was going through a lot at home and nobody wanted to be her friend in school , I was devastated to hear that . I told her she can be my friend and for the rest of the day she smiled and laughed .\n\nThe second reason any act of kindness , big or small , can impact a person is , the person receiving the kindness can learn from you and make themselves a better character too , you can influence a person with how you act , if you act kind and generous and , make good choices , someone is gonna learn from your words and actions . Same with if your a person who is just rude and makes bad decisions , someone else , will learn from your actions . Many people tend to learn from people in their environment , especially young people , so if a young person sees you offering a kind act of helping to either them or someone else , they can learn from your actions and see you as a big role model , people should always make good decisions for many reasons one being that young people can benefit from your choices and will always look up to you for being the person to guide them through life , many people make bad decisions around children but if you do an act of kindness , to them or someone else , young kids will automatically learn from you . For example , one day me and my little sister were in the park , playing with our friends , we saw an old lady all of a sudden drop her apples , I immediately went to the side walk and helped the lady , I picked up the apples and put them in a safe and clean bag . The old lady thanked me and told me , "you're well mannered , thank you for your help , I appreciate it , may god bless you" , I smiled and said "your very welcome" . The next day as I was going to the bus stop , to pick my little sister up from school , my little sister ran to me and said "I sat next to this new girl in our school who was being bullied . I even shared my lunch with her because, she did not have much food at home to bring to school " . I was delighted to hear her story , I told her why she did that , she responded "when I saw you helping the old lady yesterday , I realized how nice you were and how happy the lady was , I decided to do something similar " .\n\nThe third reason of how an act of kindness can benefit someone in many ways is , the good act of kindness can come back to you . For example , one day , a girl in our class came late to school , we were in our social studies class , she came and sat down and asked people if she could copy the notes , all of my classmates shouted "NO" .\n\nI went up to her and gave her my notes . She was happy and said thank you , when she finished copying my notes , I went to my seat . About a week later , we were having a contest in our school , whoever won would receive a prize . I sadly did not have any knowledge of the topic for the contest . The next day , I partnered up with the girl who copied my notes , I told her about how I wanted to win the contest . She looked happy and told me she knew all about the topic , she said she could help me and I replied with , "I would appreciate it so much " . I went to her house after school and taught me all about the animal , we needed to have certain knowledge of the animal to do the contest in our school . The next day , I did the project and the next day ,I winned .I thanked the girl .\n\nIn conclusion , any act of kindness can benefit a person , you might make them smile , make them learn , or , the act will come back to you.
The job I want to pursue is to play in a professional soccer team. The reason why I want to play in a professional soccer team is because I love and its fun to play the sport. This is something im good at in my life. This is a sport that most people want to play at. This is a letter to send to any manager in a professional soccer team.\n\nOne of the reasons why I want to join a professional soccer team is because I love the sport. This sport can release your stress. If you have so much stress on you this sport can let you refresh your mind and will take all of your stress away. You can also take your anger at somene if you are mad at the person or just you mad at something. You can slide tackle or shoot the ball as hard as you can at someone or the goal.\n\nAnother reason why I want to be in a professional soccer team is because it's fun to play. You can play with your friends in the sport or you make new friends. This sport is really enjoyable to play. Whenever their is a nice day outside you can play the sport with your family or friends.\n\nThis is the job I want to have when im older. These are the reasons why I want to play in a professional soccer team. In my opnion, this sport is one of the best sports in the world. Hopefully this will happen one day and I will be really happy.
The Primer Minister Winston Churrchill once said that "success consists of going from failure to failure without loss of enthusiasm." And the question is about angree or desag.\n\nMy opinion is desagree because the Primer Minister wiston not is try to motivate to onther person to do again. First,reason when something person loss manytime something and feel what if continue does again can obtain something good in the future. Because never said end. Second, reason the failure plays inthe life a paper strong in the life of every person in the world. But when any person not try more time that one is clear that is going to failure and never feel what is obtain something good in the futured. The decition every person have nothing can said what try againt. The decition is of your selft. My position is what if I whole my life said not and not continue consist in something never can obtain something.\n\nWhen have the oportunity of obtain something and gain something never say I failure least when have a enthusiasm of obtain. Never person have the right to says you never can't do. forever cave you personas negatives and thoght negative in the life. But every pesona have the right to attain something. For example: I have goals in my life what is gradution and have my diploma and can continue in the college. For can gain this gold and my dream i have enthusiasn and an person positive. Also if I have failure in my gold I have of up and againt.\n\nForm not failure has try more of one times. The reasons are clear if an have enthusiasm for something I loss the possible to go back to againt. I also think what the Prime Minister Winstor Churchill loss something for what the that try todo is what the person not continue there are and losss your enthusiasm for something what hill obtain. There are many success about failure but the failure arrive when the problem don't have solution. Becasuse also have the right to fight for obtain the solocion to the failure.\n\nWhen us arrive to the failure have the right of to do again but other form. Sometime the life us play's different suitation what think that not obtain solution but many pesons said what there are form all have solution lest when an dead. These is other example when one person dead and before to dead have failure many time in yours objetives an don't know say there are fight for obtain the solution.\n\nThe life arrow as the world an never have the solution in the hand to all problems butnot signific what noy have solution. Never there are said not can't. The final of failure forever have solution. Is as when an company is goint to bankarrot. They try to share solution form the failure. For there nevere said that no can't share solution to the every failure.\n\nMy conclusion is that never lost the energy for figth for the solution. Forever cave sometihing what have hopeful in your self. No lost yor hope eve search the solution to the failure.
regression_fit <- parsnip::fit(regression_wf, 
                     regression_train_df)

Identifying examples with especially poor performance can help us follow up and investigate why these specific predictions are poor. Conceptually, its easy for a baseline know-nothing model to assign all essays to the median score of 3. The predictive power is in the ability to model the essays that are not 3 into buckets higher and lower than 3.

Because the ratings are a form of ordinal value, or even a likert scale, we will ensemble a second classification model that includes the output of the regression.

classification_train_df <- train_essays_raw  |> 
                select({{outcome}}, full_text) |> 
                bind_cols(
                  predict(
                    regression_fit,
                    regression_train_df
                  )
                ) |> 
               rename(regression_pred = .pred) |> 
               mutate({{outcome}} := factor(.data[[outcome]]))

classification_wf <- workflow(multiclass_recipe_builder(outcome = outcome), svm_spec) 

folds <- vfold_cv(classification_train_df, strata = !!outcome)

set.seed(42)  
rs <- fit_resamples(
  classification_wf,
  folds,
  metrics = metric_set(kap, accuracy),
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
kapmulticlass0.2935824100.01376898Preprocessor1_Model1
accuracymulticlass0.4420977100.01089773Preprocessor1_Model1
collect_predictions(rs) |> 
  ggplot(aes(x = .data[[outcome]], y = abs(as.numeric(.data[[outcome]]) - as.numeric(.pred_class))/2)) +
  geom_violin() +
  scale_y_continuous(breaks = seq(-5,5,0.5)) +
  labs(y = "Residuals",
       title = "{{outcome}} Residual errors for essays in held out folds",
       subtitle = "The highest and lowest essays are still not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = as.numeric(.data[[outcome]]) - as.numeric(.pred_class)) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text, {{outcome}})
ABCDEFGHIJ0123456789
full_text
<chr>
Hi my name is Generic_Name and I am going to talk about energy and resources. The reason why we are talking about energy and resourses is because ,some busineses have adopted a four day work week. They want to because they want to conserve energy and resourses.\n\nEach work week is going to be for 10 hours but in my opinon that is not going to work. I think it is not going to work because, people are barely working 8 hour shift and working 10 hour shifts. It is going to be more painful for people, and they are going to get really tired. In my opinion if they are going to make people work for 10 hours for 4 days, they have to increase the minumim wage and pay a little bit more money.\n\nTheir is alot of reason why I do not agree with this new change. The only positive reason I see is getting 3 days off. Another positive reason I see for this change is, if you get payed every 2 weeks, and you worked\n\n4 days and, make 40 hours 1 week and 40 hours another week, it is going to be a good paycheck. Now it depends how much you get payed but im pretty sure if you are going to do 10 hours shifts, they are atleast going to pay $12.00 an hour or they are going to pay you $11.00 dollars in hour. Those would be good reasons to work in a job like that. It depends to if the people have time to work 10 hour shifts for 4 days.\n\nTheir are some school that want to have those same rules that some jobs have of 10 hours. I do not think that would work for students, because 10 hours of being in school is really stressing. I know how it feel like to be in school for 8 hours, is it is not fun and it is really stress full. I think that the classes in highschool would be more longer the students would not concentrate .The reason they would not concentrate is because, you would be doing a lot of asighnments and, you would lose intrest in what they are teaching and, you would lose focus. In my opinion I would not like that but I am pretty sure the school would like it because, they would be completing more work and they would be finishing lessons really quick and the students would study more.\n\nThere would be another advantage to that because the students would be in school for 10 hours for 4 days a week. They would have 3 days off every week that in my opinon it would propably be friday saturday and sunday. It would sound kind of good since you get 3 days off every week, but at the same time no students want to be in school for 10 hours for 4 days a week ,that sounds stressing and hard .You would propably have more classes, a lot of home work ,and more test, and quizes. It would propably be hard for teachers to do 10 hour shift to because ,they would have to do more planings of lessons because they would propably have to teach lot of classes during the day since the school day is 10 hours.\n\nIn my opinion this prompt that I wrote today was really intresting. The topic was really intresting it made me think a lot of what I was going to type in this prompt. The topic was really intresting because it was about what I thought about jobs only working 4 days a week and 10 hour shifts. The other part of the topic was what if school was 4 days and 10 hours. This prompt made me put myself in that position and I did not like it if this would ever happen in real life I would be against it .
I believe that self-esteem comes from achievement because the more a student work hard, the more achievements he/she get so when they receive more awards and/or achievements, it makes them to proud of their selves and build true self-esteem.\n\nThere are so much students who works hard, complete their work on time and also have a part time job after school, but they don't know how to build their true self-esteem so what they need to work is that they must be self confident because they can't build their self-esteem unless they're self confident.\n\nAlso, there are much more students who go to school and don't have a job or anything after school or during weekend and they're self confident, but don't know how to build their self-esteem.\n\nSo, students should try their best to receive achievements because it encourages and/or makes them to build their self-esteem.\n\nSelf-esteem is something that students can build it by theirsleves if they work hard, be punctual at school and have a checklist or a plan for what they should do first as a calender.\n\nStudents aren't working hard nowadays I have no idea that it's because technology makes them lazy or they don't want to plus they're not trying to achieve something at school.\n\nI'm sick and tired of seeing these kind of students because if they just open their school backpack and at least study for two hours at home, they will receive a lot of achievements at school so that's how they can achieve their goals.\n\nSo, when it comes to build their true self-esteem, they need to work on achievements and become self confident first and then best version of their selves.\n\nTeachers also have a role in this issue because I think students spend more time with their teacher compare to their parents in a week.\n\nI don't mean teachers discuss with them to build either their self-esteem or self confidence unless the student is smart and curious to ask his/her teachers and peers about becoming like a person who has self confidence and already built his/her self-esteem.\n\nBut, at least they show students the right way to get achievements or achieve their goals so that would be enough, and students will start thinking about how to get achievements and then they'll probably start working on their self confidence and self-esteem.\n\nIn addition, when I came to the united states it was 2017, I didn't know any English and I didn't have any friends at school so everybody knows how hard it is to go to school and can not speak with anyone or don't have friends plus I was a shy guy.\n\nWhen somebody was trying to talk to me, my face was becoming red and start blushing so it's all because I didn't have self confidence.\n\nSo, I am still trying my very best to learn the language and make some friends at school so I can play or do my work with them together.\n\nThat being said, now I can speak, write and read very well and I became so much more confidence, best version of myself, have a lot of friends, and so happy to attend school.\n\nOverall, being self confident and working hard for achievements are like a key for building students self-esteem which comes from achievements.\n\nStudents should focus at school or wherever else they study so they get achievements which helps them to build their self-esteem.\n\nStudents also should be encouraged by their parents to build their self-esteem as well as by their selves unless they're self confident in life.
The school plans to change to a new, healthier school lunch mean, which would eliminate some of the students' favorite cafeteria foods. School should change to a new, healthier school lunch mean for students to eat healthier food and be healthy.\n\nThe school plans to change to a new, healthier school lunch mean, which would eliminate some of the students' favorite cafeteria foods.\n\nMost students eat unhealthy food almost all of the time, and some students think it's fine and it doesn't really affects their health. Some students eat unhealthy foods while playing video game, and while they are playing video game, they grab snacks that are laying on their table or the dresser such as: chips, candies, and energy drinks energy drinks, which contains chemical and are unhealthy for them. Some students don't want to get up and go eat with their family or eat healthy food, because they do not want to miss the the game that they are playing with their friends or playing online. School should change currant lunch menu to a new lunch menu,healthier school lunch mean for students to eat healthy food and be healthier.\n\nStudents when go to lunch they just grab anything that they like and they don't think if it's healthy or not for them. Some students eat unhealthy foods during lunch because they don't think about it, or they see somebody else eating something and it makes them to try it, and wanna look cool in of their friends so they eat things that are unhealthy are them.\n\nSome students may not like the plane to change the school cafeteria lunch menu to healthier foods, because most students are now so use to eat same school lunch every day; but eventually, students will get used to new healthier school lunch menu and they will feel alot better than thye use to, be healthy, and won't eat unhealthy food at school or at school. Lots of students don't really like eating healthy food,or drink healthy drinks like water, and juice, because it may not taste as good as unhealthy food. Unhealthy food and drinks contains chemicals that are not good for anyone's health, therefor the school cafeteria should change to a new, healthier school lunch menu.\n\nThe school plans to change to a new, healthier school lunch mean, which would eliminate some of the students' favorite cafeteria foods. School should change to a new, healthier school lunch mean for students to eat healthier food and be healthy.\n\nThe school should change a new, healthier school lunch mean, which would eliminate some of the students' favorite cafeteria foods, and drinks for students and the teachers to eat healthy food, al least at school if not eating healthy foods at home.
Should students take online classes? Students can learn more by taking online classes? students have benefits for attend classes from home?.\n\nOn this paper I will argue about how students have benefits attend classes from home, and how improves skills for he future.\n\nI think that students would have benefits for attend classes from home, because is a new opportunity for study more, and for improve more the skills more online classes for the future.\n\nTeenagers that are attend classes from home I think will be more healthy, because that means that students will be more able to sleep , and will be have more time to rest the brain, and more time to do all the things at home, because a lot of students they do not sleep during the night the reason, because they work others that always talks with a friends and others that they use technology, and waking up at the early morning make the students brain tired, and makes the students do nothing at school for the rest of the day.\n\nStudents will be more organizing there time meaning that students will be able to have more time to have job, or do others activities during the day, or after taking classes online, because when they attend to school they do not manege very good the time they always doesn't care about time or do something important.\n\nStudents will be putting more attention to classes, because when teenagers attend to school most of the things that distract the students are the friends and the technology means that teenagers when are around friends distract the mind out of the class, and that causes that students don't pass the class, or the test, otherwise when are taking classes from home there is no body around that can distract and loss the attention of the students and will be more easy to do homework, projects, and study for test.\n\nSome people say that the idea of students attend classes online from home will have more benefits is a bad idea, because they say,"Teenagers are lazy, and they will sleep more late at night".\n\nStudents taken classes online will be more smart, because there will more practice skills for the future where will be benefits of know how classes are doing online, and they where taking.\n\nOn the future students will be able to attend classes from home, and will have benefits for skills, and this will make the teachers more easy to turn any work or practice any class that they missed, and that way students can have more ideas how will things will change and compare between attend to school and take classed online.
I agree with Churchill' statement about the important role that failure plays in the pursuit of succes, because the way to become to the success is not gonna be easy. All the people that try to have a good success they gonna have failure on the way and sometime they fall apart, but they never have to loss their enthusianm, because the succes consists in fall apart and wake up again, and keep going looking for a good success that gonna be graet for their life and their family gonna be haughty of them.\n\nI agree because, the life gonna put many impediment to have a good success we have to keep going do not have to loss aur enthusiasm, for example. My family came of a poor family, but I have an ancle that he never loss his enthusiasm of has a good success, so he worked too hard for it. One failure that he has on his way to the succes was the poorness, but he keep going wrestlering for get uot of the poorness and help his father and mother, one day he found a job and begin to meke money and his first thing that he made was to buy a bed for him, then he to begin to save money to come to this country, now he has a lot money in his bank account because he put his own company of landscaping, but he never loss his enthusiasm about his success.\n\nI agree with this statement, because there is a lot example of how the people have many failure and they keep going never loss their enthusiasm of their success, one of this example is of one soccer player his name is Cristiano Ronaldo. He is a famous soccer player, but to have a great success he had many failure one of thase failure was that his father died when hi was a kid it was hard for him even has to see a psychologist and he to overcome that, he keep going looking for his success, but he failure again because the people and couche's that saw him, don't believe him they say like he doesn't has future, but he keep work in his success and show to all the people that don't believe him that they was wrong. Because he has a future and he gonna has a great success, now he is the best soccer player in the world for many people, but he always worked so hard to get out of the failure and he to obtain a good success.\n\nI agree with Mister Churchill, because the way for a great success is gonna be long and we gonna have many filure to obtain this, for example. I am trying to graduate from high school, but one of failure was that it is not been easy for me, because this is a new language for me and it is dificult to talk, but I keeping going trying to get my diploma , another failure is that I have to work for pay may rent and buy my own stuff, shoes, clothes, and food, it make more dificult to have my success, but I know that success consists on fall apart and wake up, but I never loss my enthusiasm of to be graduate from high school. One day I gonna say that my success wasn't easy but I obtain a good success.\n\nIn Conclution I agree with "churchill's statement about success consists of going from failure to failure without loss of enthusiasm". I agree with him because on the way to a great success we gonna have many failure but we don'thave to loss our enthusiasm, because in the world there is a lot people that they never loss their enthusiasm, even when they have a failure they always weke up and keek going, now they have a good success, so if we want a great success in our life we have to keep going wrestlering with all the failure that we gonna have. One day we gonna say I made it and we gonna have a great success.
collect_predictions(rs) |> 
  rmse(truth = as.numeric(.data[[outcome]])/2, estimate = as.numeric(.pred_class)/2)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
.estimate
<dbl>
rmsestandard0.4769019

Results here aren’t great, but they are more are less competitive with the leaderboard figures.

The final fitting ensembles both the regression and classification fits, and makes a prediction on the submission essays.

classification_fit <- parsnip::fit(classification_wf,
                                   classification_train_df)

extract_fit_engine(regression_fit) |> 
  vip::vip(num_features = 20)

submission <- predict(
  classification_fit,
  
  submit_essays_raw |>
    bind_cols(predict(regression_fit, submit_essays_raw)) |>
    rename(regression_pred = .pred)
) |>
  transmute({{outcome}} := .pred_class)
Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?

Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?
submission
ABCDEFGHIJ0123456789
cohesion
<fct>
3
3
3

We fit for syntax first using an xgboost regression, using case weights to adjust for the frequency of occurrence of each value of syntax.

outcome <- outcomes[2]

regression_train_df <- train_essays_raw  |> 
                select(!!outcome, full_text) |> 
                case_weight_builder(outcome)

regression_wf <- workflow(recipe_builder(outcome = outcome), xgb_spec) |> 
       add_case_weights(case_wts)

folds <- vfold_cv(regression_train_df, strata = {{outcome}})

set.seed(42)  
rs <- fit_resamples(
  regression_wf,
  folds,
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
rsqstandard0.2894974100.009720077Preprocessor1_Model1
rmsestandard0.5437325100.004326903Preprocessor1_Model1
collect_predictions(rs) |> 
  plot_preds(.data[[outcome]]) +
  labs(y = "Predicted",
       title = paste0(outcome, " predictions against essays in held out folds"),
       subtitle = "The highest and lowest essays are not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = .data[[outcome]] - .pred) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text)
ABCDEFGHIJ0123456789
full_text
<chr>
By the time students enter high school, I believe that they should have an idea of what type of career they would like to pursue after they graduate. For some students, committing to a specific career at young age sometimes is a good idea as long as you have a backup idea for a different career in case you decide that you do not want to pursue in that career anymore, thats why committing to a career at a young age is only sometimes a good idea because you'll never come up with another career if you keep changing your mind. The courses that you study in high school should be thought about as well because maybe you need a specific degree from a course in order to pursue in that career.\n\nI believe that, if a student is going to commit to a career that they should be very passionate about this career, they should be at least a junior in high school so that they've had time to get a feel of the other careers and decide which one they enjoy and suits them the best, and they should keep in mind the requirements that are needed, the benefits, and the types of jobs that it offers to them. Students who commit to a career at a young age are usually athletes, or they plan on working in their family business.\n\nPursuing your career needs a lot of hard work in school especially in this generation because you're going to need to go to a good college so you need a good GPA because you're going to want to go to the college that has a good academic program for the career that you plan on pursuing. Therefore, you need to go to college, and work hard so you can get a good job because most jobs, don't hire anyone without a college degree.\n\nFinally, thats what I think about choosing the right career for yourself, and committing to a career at a young age. although some may still believe differently and disagree with my view on this issue.
Have you ever thought of a place in the world you would like to visit? Some people would go to France to see the popular Eiffel Tower; while others would go to Hawaii just to relax. For me however, I would like to visit Generic_City because the people there are well mannered and kind. And also because there are amazing waterfalls and parks.\n\nTo begin with, the people there are well mannered and kind because they treat each other like brothers and sisters instead of mortal enemies. And something I would like to do once I arrive, is to greet these grateful and thankful people because they are gentle to one another. Furthermore, most of the people in Dubai make a honest living and there is rarely any crimes caused by residents.\n\nAdditionally, there are amazing waterfalls and parks because the designs and structures are well made and created. For instance, when visiting the waterfalls at night, it is very colorful which makes it beautiful to watch. Also, something I would like to do when I arrive, is to go on a boat ride because it is very peaceful and it make you feel calm as the ride goes along.\n\nIn conclusion, a place in the world I would like to visit is Generic_City because the people there are well disciplined and nice. And Also because there are outstanding waterfalls and parks.
Dear principal,\n\nI have heard of the school cafeteria's plan to change to a new healthier school lunch. And as a junior in this school,I take the position that this new dynamic idea to change the school's lunch menu is a bad idea. So I have decided to share my thoughts for the development of this school and with our health. I believe that keeping our school's lunch menu is a good idea. I know that my opponents would argue with me regardlessly,because they would probably assume that our students have been eating the same food for too long and would definetely want to have a different versions of food,and get to explore their school lunch like other schools usually do. But when they detect my reasons,they would know for sure that the school's lunch is way better than they think it is.\n\nMy initial reason for not agreeing to this change is that it would eradicate some student's favorite cafeteria foods, especially me,There are a lots of food currently in the cafeteria that are so good, clean and healthy.\n\nthey are also enough food for everyone to eat, so changing the menu wouldn't be necessary, it would be a waste of time and money. the school has got a bunch of stuff to focuse on. American's have this quote that " if you have lemons make lemonades" meaning we should make the best out of what we have by embracing it not changing it.\n\nIn additon, the current school's lunch menu is technically healthy, I have this extraordinary thoughts in my mind because I haven't seen any student that has protested against the school's lunch, this means that the current school lunch is unique on it's own way. Also the school lunch is potentially some of the amazing healthy American foods.\n\nAgain,Most American foods are junky and cause students to gain weight chronically and gradually. But our current food consists of fruits,vegetables and also green salad which prevents the body from gaining too much weight and sustain the normal body weight. I have been eating our school's green salad for a while and l have seen some fantastic changes in my body and it is very impressive. So principal, dont you think that changing our school's cafeteria's lunch menu is a bad idea?\n\nFor instance, our school cafeteria's lunch has got protein,Vitamin D and my weight is intact, as far as our health is concerned, so take all of these reasons into consideration and figure out your final answer,I hope that you make the right choice for the school and l know that the school's improvement is your priority.\n\nThank you respectively,\n\nGeneric_Name 11th grade( junior)
As a student myself, I think students would benefit from attending classes from home, because attending classes can help students manage their own time and learn how to self control, and can follow their own pace of learning.\n\nAs day by day passes, I believe that lots of students are sick of repeating the same dull sketchual, and wish they could stay at home for school, on the other hand, they will not have to wake up so early everyday when they worked on their homework till so late. When students attend classes from home, they will be able to manage their own sketchual, learn how to control their time efficiently, be more self-reliance, and prepare for the future.\n\nIn conclusion, it is a benefit for students to attend classes from home, because they can learn how to make their own plan, and learn how to manage time, which I believe that it will help the students a lot in their jobs, future life goals or even their entire life.
The Author Waldo Emerson wrote "To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment". I agree with Waldo Emerson's quote because if theres someone thats trying to make you something that your not, being yourself will be a very duanting task. When I was in the 8th grade someone who I thought was one of my friends wanted me to change who I was because they though that I was'nt cool enough to hangout with anymore, at first i thought that I was the problem, but I learned that true friends won't try to change who you are, no mather what. Being yourself is one of the hardest things you can try to do, possible because your to shy, you don't think your good enough, your scared of what others will think of you.\n\nI always hated thinking about myself because i never though that I was good enough for anyone or good enough to do anything, so I kept everything bottled up inside, at one point or another I even thought about killing myself but was to scared to do antthing to try anything. So I decided acted like everything was ok untill I tricked my self into belaveing that I was happy, but that did'nt last. Now i'm in the 11th grade I came across a certen individuality(my current girlfriend) who, when I around, can't stop feeling real happyness. Everyday I think about how lucky I am to have met her. The Author Ralph Waldo Emerson wrote "To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment, as an individual I agree with his quote because in this world not everone wants to see you sucssed in your efferts.
regression_fit <- parsnip::fit(regression_wf, 
                     regression_train_df)

Identifying examples with especially poor performance can help us follow up and investigate why these specific predictions are poor. Conceptually, its easy for a baseline know-nothing model to assign all essays to the median score of 3. The predictive power is in the ability to model the essays that are not 3 into buckets higher and lower than 3.

Because the ratings are a form of ordinal value, or even a likert scale, we will ensemble a second classification model that includes the output of the regression.

classification_train_df <- train_essays_raw  |> 
                select({{outcome}}, full_text) |> 
                bind_cols(
                  predict(
                    regression_fit,
                    regression_train_df
                  )
                ) |> 
               rename(regression_pred = .pred) |> 
               mutate({{outcome}} := factor(.data[[outcome]]))

classification_wf <- workflow(multiclass_recipe_builder(outcome = outcome), svm_spec) 

folds <- vfold_cv(classification_train_df, strata = !!outcome)

set.seed(42)  
rs <- fit_resamples(
  classification_wf,
  folds,
  metrics = metric_set(kap, accuracy),
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
kapmulticlass0.2976454100.011747218Preprocessor1_Model1
accuracymulticlass0.4561759100.009417703Preprocessor1_Model1
collect_predictions(rs) |> 
  ggplot(aes(x = .data[[outcome]], y = abs(as.numeric(.data[[outcome]]) - as.numeric(.pred_class))/2)) +
  geom_violin() +
  scale_y_continuous(breaks = seq(-5,5,0.5)) +
  labs(y = "Residuals",
       title = "{{outcome}} Residual errors for essays in held out folds",
       subtitle = "The highest and lowest essays are still not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = as.numeric(.data[[outcome]]) - as.numeric(.pred_class)) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text, {{outcome}})
ABCDEFGHIJ0123456789
full_text
<chr>
Dr. Manager, I would like to work in "Envy Nail' your nail salon , l been there before and is the salon where l always want to work l feel very comfortable when i'm there and l think when someone needs to work is importan to do what the person always wanted to do or what the person like because in that way the worker is going to do a really good job. Also i'm very sociable and friendly and l think is something that is very important because the custumers need to feel confortable, in that way the costumer are going to like the job of the worker and likely is going to back later again to get done the nails in your salon.\n\nl have one year getting my nails done in your salon and l like the tecniques that the workers use and the time and care that they put for make the nails , l think your salon is perfect for the people that get nails and want have different colors on their nails, because your salon have a lot choises of colors in gel and acrilic powde. l would be happy to lorn all of the tecniques and styles that your workers do on the customers like, french nail , sculpture nail , or gel nail. I have two years that l practice the basic steps for make a nail for example, how put the acrilic powder properly in the fake or real nail and how put the gel on the sculpture nail. In this moment i'm lorning how to make figures with acrilic powder por example, roses , flowers or any other figures that costumer want and also l been pratice how to do pedicure and how do a properly a massage.\n\nMy idea is lorn more of what l know and work on what l always wanted to be, l would be happy if you allow me to visit you nail salon and give to me employment,\n\ni'm going to work very hard and put effort on the nails that i'm going to make.
Tomas Jefferson say is wonderful how much may be done if always diong. And is one of the reason I deagree with Jomas because if the person always doing something learning stuff they never before do. Is wonderful how much the person can be do and learning new stuff if always work hard. One of the many reason of the human is a intelligent,stroong,smart and do new stuff no matter if they are easy or difficult. If they work hard can be do everithing.\n\nFor example the human not born with the capacity to walk or speak all human learng how do new stuff not matter how dificult ther are because more do more learng. One of the big point of always do somehing is prepare for life,is not easy but diong something to make sure the person is in the right way is the most important things the person need to know. Teaching personality and work hard is the big stuff, however one point of life the thing come hard but teaching how go and do resolve the problem. Not matter how be is the problem you need to go and do something then make how strong the person are. The person need to struggle with problems but learning and work hard is the main reason why the person is strong. On one point has the access to take something and work on that, but doing something is how learning new need stuff. Example the person who invent the technology they work hard and always do somethig to make they dream to come real and thas why diong somethihg and do the best potential is how make all the stuff of life. The person who study and prepare to make thay dreams are those work and not matter hoe big is the way they make one aesy way to continue they dream.\n\nDoing somethigs always is the reason why the society do big work define new thing new technology new life becuase always are doing somethis. The person not born with all the intelligent not they learn how walk,speak and one point of life they go to school they not know everything. Not they do something the work hard, however a lot person are very smart but they continue to learn always doing something because they want to a better because they want to suppor the world and they family a better place. Likely the most professional always do something to make sure they life are excel of the most difficult piont of they life becuase always work hard and make new things, because not matter how low they education the person take always can be a better person because always try to define the best decition and the best example to the society. A different way to make the personality strong is find new ways to the problem. Life is like a game more things more work more aesy is to make the things.\n\nIf the person always are diong something new and the not choose to stay an d the same place all the time. And the person choose to continue doing new stuff and new work they not need to be the most smart person on the world. They need to work and show they can be do,however they walt to be not matter if they how be a stong personality and not matter is they't go the best school or the best college. Only matter how they be and the profession and the work. If the person or the society do somethig they can be the future. For example one day the person get up and choose to do something and make sure they days are very beautiful do new projects they can be came be make they life more aesy to continue. Life and work are like a gardener more flowes the person add more beautiful they came to be is like work more thing you learng more easy life come. one point they persono can't be continue but all the things thy learn more aesy came to be going up.\n\nThat why more things do make goals they persons can find, not matter were the person came or were the born always doing something more intellegent the person can to be. However a lot person are very smart but they continue to learn always doing something because they want to a better or find new technology or make a different on this world. One of the big point of always do somehing is prepare for life. All the persons are not the same one they has more technology to they dream,but others person not and this is not one obstacle to make they dream. Because all the time are be doing something and not wait to came things came not they go find and work hard to make all be came to be positibe they not have obstacles they have the strong to be come a better person. And show everyone not matter how difficult are the problem they came be successfuly person. Like Thomas Jefferson say always diong somethings much be done and is true because the person came to this life and learng everything, a lot person move to other place, need to learng need lenguage, need tradititiones and need people is hard but with the time can be learnig everything and continue the life again with need stuff thas is what is important to always diong on and be done what they need to be done and make sure do the best and hork hard and show a good and strong personality. And accomplish more if always they're something on specific point of life can to be so difficult but working hard and with discipline all can be come more aesy and undertake a new dream and new stuff of life can be come the best tool to widely and known as the most expert guidance to life. Base of all the information always doing somethig more thigs can be done and the persons can be accomplish and determine what strong thye personality they are.
One year ago. I though that business was the career that I wanted to study, but it was really hard to me. I could not do anything good in that class. I was fail that class and I was really stressful I did not knew what to do. I realized that business it was not for me, but I though that was to late to change my decision. I talk with my counselor and she said that I could change the career. So, I\n\ndecided to chose another career and now I know what career it is the right one for me. I do not know if I going to change it again, because I can be a undecided person. As well, I realized that happens every time that it was normal. I talk with my classmate, and they say that same thing happen with them. Although some say that is a good idea for students to commit to a career at a young age because students can select courses in their high schools to help them improve in their right career, actually it is a bad idea for students to commit to a career at a young age because students might select a wrong career that is not right for them and students can be undecided in what they want to study.\n\nSome say that is a good idea for students to commit to a career at a young age because students can select courses in their high schools to help them improve in their right career. The only problem is that they do not know that is a problem for students. Everyday I heard students, classmate or even my friends that said '' This class is really hard for me, but I can not change it because this class help me improve my career".\n\nThat words make me think that they are unhappy and stressful.\n\nThe best way to help students is that they can change a new career. Maybe that career that they are starting are not for them or students can be undecided in what they want to study, and they just pick one.\n\nThere is a lot of reasons why is a bad idea that students commit to a career at a young age, but I just have two of them.\n\nIn addition, it is a bad idea for students to commit to a career at a young age because students might select a wrong career that is not right for them. The dream of all kids it is to be like their parents. They want to study the career that their parents studied, even go to the same university they parents go. Sometimes is different their parents put pressures on them to studied a career that they dont want. So, students chose the career that their parents studied or they parents wants them to study . Then they realized that the career they pick is not right for them. This is a problem because now students are unhappy and stressful. Sometimes they wants to quit school because they think school is hard for them. When is just because they pick the wrong career. If someone do a statistic about how students feel about their career that they chose. I think the probability of that students said that they think the career they pick is not for them will be above of one hundred percent.\n\nAlso, it is a bad idea for students to commit to a career at a young age because students can be undecided in what they want to study. There are a lot of career that students can pick, it is difficult just pick one. Students can find skills that help them in another career. Even though their skills are good in the career they pick before. They decide to pick another career. Sometime the decision that students takes are not the right one, but they continue experiment new careers. That is basically life is about, decision. When students takes a wrong decision in their careers. they are learning. Maybe students decides to learn two careers or more than two they take different course or classes to achieves their goals. I think students can be undecided in what they want to study and that is the best thing that help them in their career, is good that students can experiment different courses.\n\nIn conclusion, it is a bad idea for students to commit to a career at a young age because students might select a wrong career that is not right for them and students can be undecided in what they want to study. Sometimes students can be very impulsive and can chose whatever career they want, but they not realize what career is the right one. Also, students sometimes could not decide what career they want to study. The best way to help students is to let them know what they want to learn. I think students will be more decide in whatever they want to study.
When learning at school with other students who cause distractions it is always hard to focus would you be able to focus? Even though going to school makes you socialize with friends and they feed you it sometimes is hard for a student to show up to school or even learn.\n\nFor me I would rather work on my assignments and others things my teacher would like me to do at home reason why is that some students would not be able to focus especially when a student is causing lots of noise making it hard for you to focus on your assignment. Another reason is that some students could live far from the school making it hard to get to school everyday. Finally students could have more time to work and study making it easy for students to revise in a quite place at home.\n\nStudents could limit distractions in many ways at home one way is that they can put on headphones to relax and work hard and listen to some music. Some teachers hate when students have their phone out or when they are listening to music so begin at home may cause the student to focus more by listening to music because every student has a different way of studying and one student might be more focus if he or she loves listening to music when working or studying. This also makes the student more relived that he or she can listen to music. Students who are always trying to bust a joke or make a noise causes problems for a student who is trying to work to get her grade up this makes it very hard for a student to focus on what their are supposed to do. Students can benefit from listening to music because for me when I listen to music while I am working I feel great and energetic making it easy for me to knockout my work at a fast rate.\n\nSome students could live far away from the school and may not have a reliable ride to take them to school everyday. Some students can't catch the bus because the bus is too far away from their house this makes going to school very difficult because without a reliable ride to school everyday you may be coming to school very late making it hard for you to study or work on assignments because you are worried about how you will get home because you do not have a reliable ride to school to home. This makes a student stress a lot thats why working at home you would not be worried about who would be taking to and back from school. It also makes the student more productive because they would not have to find a ride all the time they could study and get their work done faster than other people. Also coming to school late makes it very hard to understand what was taught in the classroom making a student very stressed over it because a student grade might go down because he or she failed the test cause they came late to school so that student might not have understood what was taught.\n\nFinally students could have more time to study and work on their assignments sometimes teachers may go through the assignment very quickly making it hard for a student to understand the what he or she or supposed to do. Also teachers may not give as much time for students to finish assignment working at home makes it easier because you have as much time as needed for you to complete your assignment and also for a student to revise over their work before turning it in to the teacher students may not be able to turn in assignments on time depending on the assignment this makes a student very stressful because they do not want to turn in the assignment late and get a late grade for it. Sometimes students worry about things like this especially when a student grade is flunking and they need to get it up to graduate or move on to the next grade level.\n\nAlthough going to school could very exciting for a student or very happy to see friends your happiest place is home and if you could a student could work from home that would change the way a student studies and complete assignment because they have time on their hands and also the are relaxed they would not have to sit in a class for over 55 minutes. Working at home could be very beneficial because It could be very difficult for another student to learn at school because they might be that one student who is making it hard for a student trying to focus or a student might be stressed because they might not have a ride to and back from school and worried that they might not enough time to finish their assignment and get it turned in on time. Working at home may not stress a student because they would have enough time to complete an assignment. This is why working on assignments at home would benefit a student.
How you can have a good relation ship with your dog?\n\nYou need to have a good relationship with your dog because, when you get a new dog and your dog need to take him/her out and you do not know that you soppust to do that the dog will do not like you at all, like here's I am gonna give you some exampls for what you should do for your dog to not hate you, the dog need to feed him/her a food every day, cold water in the summer to not be hot, a normal water in the winter need him/her to go out to walk or poop out side,the dog need to have you be with them all the time, he/she need to feel that you like them, give them food, water, play with them every day, take them outside when you hang out with you family, friends, etc..... .\n\nThe dog only thinking about you and the food and how he/she can save you from anything dangerous like, when someone come and stell something from your house and you sleeping, the dog will pits him/her in them legs, and the dog try to wake you up with his/her "wror" the the dog make, sometimes the dog need to have a comfy space so he/she come and set behind your legs and sleep, but when your dog wake up he/she get bored so they trying to wake you up by liking your face or your toes, a lot of people love dogs so they buy it for a lot of money because some dogs are no really avalable in some places so it's hard to find theis dogs, and they still cost a lot of money, dogs can alive like 11 years to 15-20 maybe if your dog not that long with you you not gonna be sad at him/her if they but if they at least 2-3 yeas with you you really gonna miss them and if you died your dog will cry on you because I tried that before when my grandma died my dog was not even eating or drinking water or palying she was just seting and crying, and I was having two dogs they was brother and sister, so they was playing together everyday but one day the her brother was died i was really sad and crying and she was not even eating or drinking like when my grandma die, she was really sad for a long time and then I give it to my uncle house he was have a dog and a cat, she started to play with them and having fun so she happy right now bwcause she forget her brother and found a dog and a cat to play with them.\n\nThe dogs like to live in a big house and a big backyard to play in, and they need to live in an organize place. You need to a vet to check your dog every month at least, maybe they have alergece for something or they need to take a shock for something in them body. The vet for your dog gonna tell you what you suppost to feed him/her and what you not soppust to give him/her. And what time you should go to the doctor to see or check at your dog. Dogs like to live with a family not one person because they like to set with them and if they have a childern they really like to play with a baby or children because the childern have a lot of power to run, play, to anything and the dogs have a lot of power, enrgy to run, to play, and etc.... . The dog need to take a shower at least 2-3 times at week, when the dog get out from the bathroom and she/he wet you should put planket on them to not get cold and sick, and you need to brush them hair and dry it with a hot air to not get cold, the important thing that you need to clean his/her eyes everyday in the morning because they will have something in them eyes because they sleeping like humans when they wake up they wash them face because it's not cleand and brush them teath. The dogs do not like to get wet a lot so do not get him/her out when it's raining outside. but you an put him/her in your car and go shoping with them. Sometimes people leave them dogs in the car because they not alawed to go in resturant so they leave them in the car, dogs feels that they lonly and they waiting for you to come back really bad.
collect_predictions(rs) |> 
  rmse(truth = as.numeric(.data[[outcome]])/2, estimate = as.numeric(.pred_class)/2)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
.estimate
<dbl>
rmsestandard0.4681767

Results here aren’t great, but they are more are less competitive with the leaderboard figures.

The final fitting ensembles both the regression and classification fits, and makes a prediction on the submission essays.

classification_fit <- parsnip::fit(classification_wf,
                                   classification_train_df)

extract_fit_engine(regression_fit) |> 
  vip::vip(num_features = 20)

submission <- predict(
  classification_fit,
  
  submit_essays_raw |>
    bind_cols(predict(regression_fit, submit_essays_raw)) |>
    rename(regression_pred = .pred)
) |>
  transmute({{outcome}} := .pred_class) |>
  bind_cols(submission)
Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?

Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?
submission
ABCDEFGHIJ0123456789
syntax
<fct>
cohesion
<fct>
33
33
33

We fit for vocabulary first using an xgboost regression, using case weights to adjust for the frequency of occurrence of each value of vocabulary.

outcome <- outcomes[3]

regression_train_df <- train_essays_raw  |> 
                select(!!outcome, full_text) |> 
                case_weight_builder(outcome)

regression_wf <- workflow(recipe_builder(outcome = outcome), xgb_spec) |> 
       add_case_weights(case_wts)

folds <- vfold_cv(regression_train_df, strata = {{outcome}})

set.seed(42)  
rs <- fit_resamples(
  regression_wf,
  folds,
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
rsqstandard0.3074304100.015900269Preprocessor1_Model1
rmsestandard0.4855129100.003970722Preprocessor1_Model1
collect_predictions(rs) |> 
  plot_preds(.data[[outcome]]) +
  labs(y = "Predicted",
       title = paste0(outcome, " predictions against essays in held out folds"),
       subtitle = "The highest and lowest essays are not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = .data[[outcome]] - .pred) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text)
ABCDEFGHIJ0123456789
full_text
<chr>
Click! click! click! This is the sound of my fingers typing against the keyboard. Today I will visit the local workplace because I will make computers more durable, advance technology, and better technology.\n\nHave you ever used a computer that is too slow? Today I will visit the local workplace to make these changes. First to start I will better technology by having less cookies, quick access to sites, have Internet everywhere, and make the computers portable and movable. Then I will make technology more advanced. To achieve this goal I will make computers have faster browsing, longer battery life, privacy, and have software protective systems.\n\nLastly to improve computers I will make durable laptops by using stronger materials, stronger computers, and reliable an efficient. I would like to visit this local workplace and company because I will like to make a profession in science and technology as well better the future for all people.\n\nIn conclusion I will improve the technology by making more durable computers, advance technology, and better technology. So, next time you think of exploring a profession make a trip to the nearest workplace and take a brief look about the job.
The statement is "the first impression is almost impossible to change" which is a different feeling for everybody, but for me, I disagree. In fact, the first impression is really important and sometimes true, but I think the first impression does not define a person, an object or a situation. Having a first impression is a human reflex, like having an opinion or a judgment. We are doing it unconsciously.\n\nThe first impression is most of the time not real, you need to search deeper to make an opinion and when you really have an opinion, then, the first impression is not important anymore. For example, when you meet someone, your first impression might be that you think she is supercilious and even a little bit mean. Therefore when you really get to know her deeper then you will find that she just had a bad day and that she is nice and sociable. Sometimes it's the contrary, a person seems really nice but in reality she is not, so your first impression was wrong. It is not good to stay on a first impression because most of the time it's wrong.\n\nMoreover, the physic, behaviors or attitude can change an impression. If the person do not smile and seems to be rude but in reality is the nicest person, then it will be awkward for you because you thought she was bad. Sometimes a person can have a bad reputation because of the first impression he shows and it is not his fault, some persons just don't smile every time. Sometimes you can be disappointed because you didn't get to know the person because of your first impression.\n\nThe first impressions is not only for people but also for a situation or an object. For example if you are in a library and you want to buy a book, the first thing you are going to do is looking at the cover of the book. If it's pretty you will more easily choose this one instead of a book with a black cover and only the title, because it is your first impression. But your first impression is wrong because you didn't take time to read the resume and you will find soon that the pretty book is actually boring instead of the black book which is really interesting. An object can look nice but have a bad quality. The first impression is the color and the shape of the object, like the physic and the attitude of a person.\n\nIn conclusion I would say that the first impression is sometimes right but most of the time it's not. In my opinion, you must not keep in mind your first impression of a person, it's most of the time wrong. You have to get to know the person to build your own opinion. It is normal to have a first impression, like judging, but you must not take the habit to stick with your first impression.
Student and teachers are have opposing views on working together for various reasons. However, according to new Stanford research, when people are treated as partners working together their motivation, student are able to communicate with each other, therefore creating a better final product. Working in team also prepares students for future careers and job. Whoever they will be required to learn to cope with other people and personalities, it is valued by employers. Even though students are not agree with each other all the time, working together is ore beneficial than working alone.\n\nEvery body ha heard someone in their life say " two minds are better than one" before right, this quote has never range more, and all of the idea it promotes reflect crystal clear off of group work. Working in a group can be drastically reduce the amount of work you need to do as well as make thing of more efferent, whether it be a group project paperer presentation. Because it cuts down on how much work one person has to do. It allows for group to achieve more as alone. Things are also finished much quicker because of the way many people can split up different jobs in a group an people with different skill sets can do what they are best at and do not have to worry about what they are bad at, this broader range of skill can also be used to help other people members develop their own by learning from their team members. The diversity found within a group of people is one of most powerful resources a person can have when it comes to finishing a task.\n\nit lends a group of people to have many more ideas to come up with and bounce off of because many people are working\n\n"The best way to have good idea is to have a lot of the a quote from Linus Pauting dealing with dilemma new idea's. When dealing with abdicating an idea from thin air, it be best to have multiple people instant of one because it brings multiple ideas all have fair and different point rather than multiple ideas no opposition or diversity.\n\nAnother benefit of having multiple people working in one group is that this can cause an evolutionary like phenomenon with multiple, stronger idea that complete and mulute, creating one in tribute and exceptional idea. This also comes with the help of a group, as a group can decide which idea would be main idea and smoothe out the edyes.\n\nAnother problem that can come up is well problem. Having a group of people can become extremely helpful for solving a problem that may come up in situations where a problem can arise, having a group of people can allow for quick and easy way to get out of a situation. Now working in a group does not have its advantage but some things are best done alone\n\nThough working in a group can seem to be good working alone can be better depending on the situation. Being in group full of adult and unfocused group members is infuriating and may seem like torture. Although, some people prefer working alone because they can focus better and make decision faster, in the end, it is a better to working in a group.\n\nif one does not do work the only they fail. Also being in a group fell safe. While being alone means you are much more impotent so working in group\n\nThough working alone can be better for one reason such as anxiety. paranoia worry about other preference, or simply because they would prefer to work alone. Working in a team is advantage over some others who are unaccustomed to doing so , it helps develop people skill decision making skills and general expertise for putting up with others.\n\nworking in a group is also good for getting other people's opinion on group member work, as long as they do their part, oftentimes students will learn and experience more in a group of their peers than working alone which is definitely better for their future an possibly what lies ahead. Developing these skill will most likely help in the coming times of college, careers their future family and even retirement.\n\nOverall, working together is beneficial because it creates less work and allow work to be completed faster. Working together promotes constructive criticism from other member of the group , which produces a better final product, working together create different points of view with different points of view new ideas are generated. New idea create diversity is the way to success.
Yes i am agrey life's is important and people who value self-reliance define it as the need for each individual to Follow his or her own ideas, the have experinse aboute life is good way to get a bettar life, and everyday there try To be a besst person for won life thare chaling his/her self that people working hart,stady hart they wnat a good life In the futchar.\n\nSome people's take essy own life like relaxe there not try anyway there needit, they are not wary about own life They are not save meony thay are not wary if somting expansef just the want buy it.\n\nSo many people's follow a faumos perons life thare raed thare books or some of them make vidoes and people Wacting the know somting more aboute life, i like that people they be a good perosn, try to get a good life in the futchar.\n\nEevar life is impart to me or for others people any wnat a good life respacat anyone heple anyone for anyway the can helpe people, .\n\nsome people wnat a bat person, that persons life is nothiong, like thery kile person, or they are sell somting, Alot of yonge kids not going to the school they are ideas school not important that kids going to the worge way there wnat moeny just moeny, that people not wary for tommaro what happen on life one day they go to the jale for wohel life. they know we are going so wrong at this part they can't noting in the world so many ting living animal, person anythig try a good person .\n\nSmart people follow a faumos person life they want batter life for whole life,and that people red the books and They know somting more aboute life, some of tame resching aboute life before thare start somting taking with that Perons his expersns for that job or anything alos, they are dowing a hart work to make a more many and save many For the futchar, with hart workig the grow up his or her stady in the futchar geting what they wnat do be, and wnat Take ideas for life what thare tining what happen if a i am lost what happen if i am lost all my mony, thare thiking Everthig which is they want to lost his or her life, and they are chaling his or her self for the batter life.\n\nEvery life is important to me , everyone wnat do somtiong or helpe some one or be a good thing for other people in the world some of people jobs is Dctor and helpe sick people or if some one very sick helpe them to gave back his or her life anyone can helpe some needs helpe and gave backe his or her life, we are coming on this word for one times do somting in the futchar prowd of we are self rescpakt anyone and no one wants one day do it somting get your self sad, some of cuntury is war alot of people dia and in the war, but the others cunturys is not war, and meybey for one day four or morethin four kids coming a life, life for some one is Nice but others is not is very short very short.
some student offer distance learning as an option for student to attend classes from homr by wat of online pr video conferencing. i think student would benefit form being able to attend classesfrom home. you are authorized take the electronic version of this you will taking this promptsome student offer distance learning as an option for student to attend classes from homr by wat of online pr video conferencing. some student offer distance learning as an option for student to attend classes from homr by wat of online pr video conferencing. some student offer distance learning as an option.\n\nonline pr video conferencing. the right view the prompt and teh checklist for writers vvsome student offer distance learning as an option for student to attend classes from homr by wat of online pr video conferencing. some student offer distance learning as an option for student to attend classes from homr by wat of online pr video conferencing. some student offer distance learning as an option for student to attend classes from homr by wat of online pr video conferencing. some student offer distance learning as an option for student to attend classes from homr by wat of online pr video conferencing. some student offer distance learning as an option for student to attend classes from homr by wat of online pr video conferencing. some student offer distance learning as an option for student to attend classes from homr by wat of online pr video conferencing. some student offer distance learning as an option for student.
regression_fit <- parsnip::fit(regression_wf, 
                     regression_train_df)

Identifying examples with especially poor performance can help us follow up and investigate why these specific predictions are poor. Conceptually, its easy for a baseline know-nothing model to assign all essays to the median score of 3. The predictive power is in the ability to model the essays that are not 3 into buckets higher and lower than 3.

Because the ratings are a form of ordinal value, or even a likert scale, we will ensemble a second classification model that includes the output of the regression.

classification_train_df <- train_essays_raw  |> 
                select({{outcome}}, full_text) |> 
                bind_cols(
                  predict(
                    regression_fit,
                    regression_train_df
                  )
                ) |> 
               rename(regression_pred = .pred) |> 
               mutate({{outcome}} := factor(.data[[outcome]]))

classification_wf <- workflow(multiclass_recipe_builder(outcome = outcome), svm_spec) 

folds <- vfold_cv(classification_train_df, strata = !!outcome)

set.seed(42)  
rs <- fit_resamples(
  classification_wf,
  folds,
  metrics = metric_set(kap, accuracy),
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
kapmulticlass0.3045477100.008996748Preprocessor1_Model1
accuracymulticlass0.4986155100.005745977Preprocessor1_Model1
collect_predictions(rs) |> 
  ggplot(aes(x = .data[[outcome]], y = abs(as.numeric(.data[[outcome]]) - as.numeric(.pred_class))/2)) +
  geom_violin() +
  scale_y_continuous(breaks = seq(-5,5,0.5)) +
  labs(y = "Residuals",
       title = "{{outcome}} Residual errors for essays in held out folds",
       subtitle = "The highest and lowest essays are still not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = as.numeric(.data[[outcome]]) - as.numeric(.pred_class)) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text, {{outcome}})
ABCDEFGHIJ0123456789
full_text
<chr>
Playing an instrument is fun because it can a hobby for the people who are just starting. For example, A piano is used for many types of music. Such as Smooth jazz, Rock, Orchestra, Rap and much more. Pianos requires a great amount of practice and knowing all the keys to create a good music at a play with the audience amused. Professional piano players gets most people's attention by knowing the right keys for the music that the piano players are playing. In addition, There are many tutorials of how to play the piano and learning the right key on social media to begin or improve your piano skills, due to technology. As a result, Pianos has been used frequently in the 1960's for music and people still listen to it everyday in the radio in their automobile. But sometimes Smooth jazz with a piano in the background is played at a cafe and restaurants to relief the stress that people are having in their personal lives. But there are way more instruments than just the piano.\n\nA saxophone is fun to use and its kind of similar to a piano according to the similarity of what music type the instrument is used on, except for rock, rap, and maybe orchestra. The saxophone is famously known by smooth jazz, jazz, and night jazz and night jazz are commonly used in New York cafes at night and other states. Next, the saxophone is similar to a trumpet, trombone, and tuba by blowing on the top part of the saxophone and at the same time using your both of your hands to make a rhythm. However, an electric piano has more than 20 buttons of instruments to choose from. It has guitar, trumpet, flute, clarinet, and even a saxophone for a different sound for the keys just for the people who want to change their style. In addition, Saxophones can be taught in music class in middle school, high school, or just a music school in general. It takes a couple of years to practice for beginners or couple of months to practice a new music for experts. But if you master a saxophone, thats where the fun part starts. You can create relaxing jazz instrumentals for people to listen to for meditation and stress relieving. And you can also be well known for doing those kinds of stuff. But, there is a last instrument that is really famous and also really fun to use.\n\nThere are different types of guitars to choose from dealing with music. The acoustic guitar is one of the most calm sounding guitars in the world because it is used to make sad music and also relaxing. This guitar is fun to use by learning how to know which strings you should use first in order to make a good song or music with a acoustic guitar in the background. Next, the distorted guitar is mostly well known by rock and heavy metal. These guitars need to be plugged on an amplifier for it to work and they are loud. But thats what heavy metal fans like such as Intensity. The clean guitar is mostly used for country music and soft rock. This is another type of guitar that people really like the rhythm and can listen to it nonstop. These three types of guitars are very different and attracts people's taste of music because some people are different.
I`m agree whit the individuality. I like when the people take whatever they wants for yours life is so cool. I have too much friend and they do the think another peoples do. I mean i like do what i`m said and what i like i don`t now.\n\nMy family is so negative when they said sometime and i don`t like because i want said sometime but they no want lisent. so i`m individuality because i want lisent to me and do the think i want.\n\nI know to much people dependt of other and that`s no good.\n\nThe history class said too much about that because in the past the people are not indiviuality.\n\nI think the people want more attention that why depent of other people.\n\nThe life now is to diferent of after because now the people yos depent the what said other person about who i`m look or what he said about me an all theese think.\n\nI like who i am cause i`m a nice and all good thinks so i do whathever i wnat because i ike who is the people and i dont care what they said about me.\n\nYo ya nose que escribir solo sigo por que pues no se me gusta y si supiera un poco mas de ingles no pararia de escribir.\n\nso les voy a contar sobre mi vida ya que no tengo ni la menor idea de lo que tengo que escribir ni nada.\n\ncomienzo llegue de Puerto Rico hace 2 anos y desde que llegue aqui mi vida cambio del todo.\n\ncomenze a valorar cada cosa que obtengo por que ahora se el valor y el sarificio de la vida para cualquier cosa.\n\nsolo se que apesar de todo sigo queriendo superarme y mejorar muchas cosas de mi.\n\nno se me hace tan facil pues el idioma y las costumbres no son para nada igules.\n\nPero aqui sigo y seguire por que creo en mi y se que cada dia que me propongo algo lo cumplo.\n\nNo es nada facil cuando llegas y conoces personas de otros lugares algunas muy buenas y otras no tanto.\n\nMe agrada demasiado aprender cosas nuevas y nuevos lugares solo hay una cosa que me enoja y es que apesar de no ser una persona indocumentada y pues nosotros los puertorriquenos somo parte de estados unidos y solo por el hecho de que nuestro primer idioma sea en espanol muchas personas nos tratan como indocumentados.\n\nllevo 2 anos los cuales no an sido nada facil ya que la escuela a sido uno de mis mayores obstaculos pues es bastante complicado entrar a un salon y sentir que estas completamente solo.\n\npues por el hecho de no poder preguntar o comunicarte con alguien no nada solo te quedas hay viendo como todos pueden y tu no.\n\nUnos meses despues de que llegue de Puerto Rico comenze a salirme de la escuela y hacer las cosas mal ya que no tenia apollo de nadie alli ni en mi casa.\n\nHoy en dia siento que no debo estar aqui por que solo siento que no es mi lugar la unica razon por la que aqui estoy es por mi mama por que quiero que se supere y poder darle todo lo que merece.\n\nya que cuando la necesitamos hay estuvo apesar de como era la vida en puerto rico siempre trato de darnos lo mejor.
Throughout the course of our history,education has always been placed amongst the most important necessities,as it not only helps us learn and better ourselves,but because it also opens new doors and possibilities for us. In the past,schools couldn't offer differing alternatives,because technology wasn't as present as it is today. Schools can now offer education to students,all while being at different locations. By students taking classes at home,they'll be able to benefit because they won't feel as socially distressed as they would in person,the level of education could be better and possibly help them graduate earlier,and they wont't have to endure social issues, such as bullying. Many people tend to believe that because they go to school,they won't have a hard time adjusting and fitting in with the masses,but to contrary beliefs,there's a lot of people who do struggle with social anxiety and overall,tend to have a hard time fitting in. Firstly,an example of this, is my cousin Generic_Name. He does have friends,but he feels extremely overwhelmed by being around so many different people,mostly because he's always struggled with social anxiety. Generic_Name decided that he would still like to pursue and attain his education,so he started looking for different alternatives that could help him do so. After much research and gathering of information,he concluded that distance learning was the best choice for him,as he wouldn't have to endure overwhelming amounts of people,or feel pressured by the constant necessity of having to wake up early during the mornings. Another example would be my friend Generic_Name,who never really had problems of fitting in and making friends,but overall disliked the whole ordeal of the school system itself. She then decided to pursue her education through another medium,that medium being,distance learning. Secondly,what a majority of people don't tend to realize,is the fact that you could achieve a better education,and even graduate at an earlier rate. This is another benefit of distance learning. Many people tend to believe that attending school,actually decreases their chances of being able to graduate early and of becoming more independent from their families at a younger age. Many individuals throughout the course of the world,utilize distance learning because they would like to achieve their educations at a faster pace,than those who are enrolled in schools. A prime example of this,is my friend Generic_Name. He was an excellent student while at school,but he wanted to find a way of being able to take advanced courses,that not only prepared him for college and provided him with advanced credits,but also helped him graduate at an earlier age. Generic_Name is now a professional,with a degree in marine biology. He achieved these accomplishments,all at the young age of 25. Another example would be my other friend,Generic_Name. She had always excelled at school,but she wanted an alternative that provided her with a better education and a chance of being able to enroll into college at a younger age. After much thought and consideration,and much conversation with her family and peers,she ultimately decided that distance learning was the best choice. As of now,Generic_Name has graduated at the young age of 17,and is estimated to graduate out of college at the young age of 19. Finally, an issue,that as of now,still affects many schools around the world,is bullying. Bullying has been an issue that has always caused concern amongst the masses,and sadly,it's an issue that is still ongoing till this day. Among the many issues that affect public schools throughout the whole world,bullying is still one of the most commonly and frequently mentioned. Despite the benefits of not feeling pressured,being able to pursue a better education and graduating at an early age,distance learning is also an alternative that many people, who've unfortunately been victims of bullying,provides them an opportunity of being able to continue with their studies,and a feeling that they are no longer exposed to issues,such as bullying. An example of this,is my friend Generic_Name. During his first couple of years in high school,he was brutally mocked for always standing out amongst his peers,and he not only felt massively insecure, but he also developed many social problems and insecurities. He had tried many alterning ways of possibly pursuing an education without having to worry about being mocked,until he finally discovered distance learning. He discovered,that he could still attend his classes and carry on with his regular school activities,all while being at the comfort of his very own home. Luckily for Generic_Name,his bullies actually turned out to be massively underachieving,so much so,that they ended up being expelled from school. He then decided to return to school,and luckily for him,he started to fit in. If it wasn't for distance learning,Generic_Name wouldn't have graduated his freshman year,or his sophomore year. People shouldn't really be afraid of trying alternatives that differ from the norm,they should always read and educate themselves on the pros and cons of distance learning. As technology continues to expand beyond realms we could've ever have possibly imagined,the future of education could one day narrow down to distance learning.
Everyone chooses their own character no matter if you are small or big. A persons character is based on their personality. Its easy for people to choose a character for themselves either a good or a bad character. Having a good character shows that you are a good person, but if you decide to have a bad character people no longer will trust you and you will be worthless to others, so this is why we choose our own character.\n\nWe choose our own character because our character is based on how we interact with other people. Some people dont have a good character and that's why people neither wants to trust them or talk to them. Even in the movie no one likes the the bad character because they are mean, bad, and no good to others but to harm them and put them in danger. A coworker of mine was very rude to customers. He was always mad therefor no other employees wanted to talk to him. One day a customer complained to the manager about how he was being rude to her, so the manager decided to fire him from his job.\n\nWe choose our character based on how we dress. people can present themselves as neat person by the way how they dress in public or anywhere else. If a person has a job interview and he wants to look good then he has to wear a dress that fits his character and makes him that he wants the job. A few years ago my uncle was invited to a wedding party but he wasn't sure what to wear, however some some of his friend told him to wear something casual but that didn't fit his character because he was a boss of a company, therefor many of his coworker would see him there so he decided to wear a suit because it was best for his character.\n\nWe choose our own character by the way how we talk to other people. For example if my brother speaks to others in a good manner people will always respect him. Being nice and respecting others will represent a good character of you. It is very easy for someone to change their character, whatever you choose to be that will be your character. Having a good character is very important in our everyday life, furthermore having a good personality will also effect a persons character so in order to have a better character you need to have a good personality.\n\nSome people say that we can't choose our character because it's beyond our control, however choosing your character is not hard you just need to have a good personality and have to be nice to others. Most people that we don't know how to choose our character traits, therefor choosing a good character do not need any special skills. All a person has to do to have a nice character they have to dress properly they need to have good manners and don't be rude to others and this is all it takes to have a good character. Other people may say its hard for us to choose our character traits because we are not able to, however for some people it's hard but the things that a person does in their everyday life those things chooses their character it determines if they have a good character or not.
Students graduated in three year of the High School!\n\nI think is good idea because all student that want a best future try to do a good thing that it is a benefit for the school. when a student is smart make the time important for take other course for to have for credit is for that some student don't need to take the four grade in the high school, A student also that have excellent grade in all the classes, and only have a difficult classes, this student that had the opportunity for graduated early that other students.\n\nExample:\n\nA student of Generic_School is in 9 grade, but this student have a difficult classes, but this students is focus just in the classes, and have a excellent grade also this student take a deport after school all the days. The student he's prepared every time for the quiz, and for test.\n\nFinish the school the student is the best student of the year in the school because He passed all the classes and the SOL. During the summer He go to the summer school for to pass other class that he going to have in 10 grade, finish the summer school He pass the class with excellent grade, so this student had a so much credit of the normal.\n\nHe stars the 10 grade, so He had other advanced classes, because in summer school he pass the classes that He was going to have in 10 grade. This student continue that, He pass all the classes, and SOL that He need for graduated. Now this students is in 11 grade, but the student had a big credit and He go to the school for 4 classes so this student have the opportunity for graduated in 11 grade because is a excellent student.\n\nHe finally is graduated the school in 11 grade, so He finish the school, but He said that want to go the collage because want to prepare more for to go to the university, because He want to be a excellent lawyer.\n\nThe excellent student finish the collage, and the university, so now He is a big lawyer with a great statutes. The parents of this excellent students, and good person, so they feeling fortunate for have a big son.\n\nAll we have the opportunity for to be a best person in the life, all depended how we wants to be in the life. Many student wants to have a excellent grade but don't put of they part for be a good students.\n\nNow in day the most students just want to come to school for 3 or 4 classes but don't want study for had a good grade,many students go to school but don't go the classes, and other students is stay outside of school for smoky, because the most students used cigarette or other thing.\n\nWe don't know appreciated the best opportunity of the life.\n\nReasons for graduated in three year\n\nAll students who graduated early have a big opportunity in the collage, and the university, and the work or whatever place.\n\nwhy?\n\nbecause the old person thinking that this type of person are responsible in all the thing.\n\nAre a people responsible!\n\nWhy?\n\nbecause when have a big responsibility never said 'NO' and have care for all thing.\n\nExample:\n\nI'm Generic_Name, I work in Bank Of America, today my boss need to leave early because He had a compromised with other important person, and He give me the responsibility for received the money of today.\n\nBe carefully!\n\nWhy?\n\nbecause they try to make with carefully the work or whatever thing.\n\nExample:\n\nMy name is Generic_Name, and I work a company of cake, and my supervisor said me congratulation because you are very carefully with the work all the time.\n\nMy Idea!\n\nI think all the people we have the best opportunity in the life to be a best person in the live,but the major opportunity is that when we have somebody is protected, and supported our decisions.\n\nWhen we start the education needed to keep the marge for be the person who we want to be. The thing are best when we support all bad thing.\n\nThe best idea is continue with the school and be a good students, because all student that it is educated, they type students have a more opportunity that other who they don't want to be a best person in the future.\n\nWhy the younger people just thinking in pass the life in party or in the street?\n\nWhy now in day we see a kids abandoned in the street?\n\nBecause many mother don't have a good education for to have a compromise of the had a kids, this type of mother just thinking in that the drugs,alcohol,or party is the major thing.\n\nMany mother having a bad decisions!\n\nSo is for that what we need to prepare for to make more easy our life.\n\nHave a diploma of the High School is very important because we work less, and we have a good job,when we have a good job we have a lot money, and when this happened we are prepare for take a funny moment in our life, But just for that is not the base for make whatever thing, first we need think what we need to do!\n\nWe know that this life is so hurt, and is more hurt when we take a bad decision like not finish the school or don't put care to our thing for to be prospered.\n\nSome time is good help take course when the people don't finish the school.\n\nExample:\n\ntake a course for by the license, and put a beauty salon.\n\ntake a course for by idea how to have a company of electricity.\n\ntake a course for be some body also a little important in the life.\n\ntake a course for be a teacher of music.\n\nWe have so much course for prepare more when we don't finish the school.\n\nSome time when a students go to the school, and they not finish is responsibility of the parent guardian because the parent need to see for the son or daughter keep going the school, I think when the students don't finish the school part of this is fault of the parents.\n\nHow we can finished the school, and how can I do graduated?\n\nThe things for to finished the school is:\n\nGo to the school every day.\n\nMake the homework.\n\nPrepared for the quiz or test.\n\nPass all the SOL.\n\nPass all the classes.\n\nWhen you make all the work in the classes or in the school, and you pass all the thing, you can graduated. If you not want to go to the collage, the diploma of the High School is very important for have a good job in your life.
collect_predictions(rs) |> 
  rmse(truth = as.numeric(.data[[outcome]])/2, estimate = as.numeric(.pred_class)/2)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
.estimate
<dbl>
rmsestandard0.4323294

Results here aren’t great, but they are more are less competitive with the leaderboard figures.

The final fitting ensembles both the regression and classification fits, and makes a prediction on the submission essays.

classification_fit <- parsnip::fit(classification_wf,
                                   classification_train_df)

extract_fit_engine(regression_fit) |> 
  vip::vip(num_features = 20)

submission <- predict(
  classification_fit,
  
  submit_essays_raw |>
    bind_cols(predict(regression_fit, submit_essays_raw)) |>
    rename(regression_pred = .pred)
) |>
  transmute({{outcome}} := .pred_class) |>
  bind_cols(submission)
Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?

Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?
submission
ABCDEFGHIJ0123456789
vocabulary
<fct>
syntax
<fct>
cohesion
<fct>
3.533
333
3.533

We fit for phraseology first using an xgboost regression, using case weights to adjust for the frequency of occurrence of each value of phraseology.

outcome <- outcomes[4]

regression_train_df <- train_essays_raw  |> 
                select(!!outcome, full_text) |> 
                case_weight_builder(outcome)

regression_wf <- workflow(recipe_builder(outcome = outcome), xgb_spec) |> 
       add_case_weights(case_wts)

folds <- vfold_cv(regression_train_df, strata = {{outcome}})

set.seed(42)  
rs <- fit_resamples(
  regression_wf,
  folds,
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
rsqstandard0.2698167100.012313416Preprocessor1_Model1
rmsestandard0.5608936100.004537835Preprocessor1_Model1
collect_predictions(rs) |> 
  plot_preds(.data[[outcome]]) +
  labs(y = "Predicted",
       title = paste0(outcome, " predictions against essays in held out folds"),
       subtitle = "The highest and lowest essays are not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = .data[[outcome]] - .pred) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text)
ABCDEFGHIJ0123456789
full_text
<chr>
By the time students enter high school, I believe that they should have an idea of what type of career they would like to pursue after they graduate. For some students, committing to a specific career at young age sometimes is a good idea as long as you have a backup idea for a different career in case you decide that you do not want to pursue in that career anymore, thats why committing to a career at a young age is only sometimes a good idea because you'll never come up with another career if you keep changing your mind. The courses that you study in high school should be thought about as well because maybe you need a specific degree from a course in order to pursue in that career.\n\nI believe that, if a student is going to commit to a career that they should be very passionate about this career, they should be at least a junior in high school so that they've had time to get a feel of the other careers and decide which one they enjoy and suits them the best, and they should keep in mind the requirements that are needed, the benefits, and the types of jobs that it offers to them. Students who commit to a career at a young age are usually athletes, or they plan on working in their family business.\n\nPursuing your career needs a lot of hard work in school especially in this generation because you're going to need to go to a good college so you need a good GPA because you're going to want to go to the college that has a good academic program for the career that you plan on pursuing. Therefore, you need to go to college, and work hard so you can get a good job because most jobs, don't hire anyone without a college degree.\n\nFinally, thats what I think about choosing the right career for yourself, and committing to a career at a young age. although some may still believe differently and disagree with my view on this issue.
Summer is a hot and nice season and most students need time to enjoy the break and here is why, so first off most students go on vacation out of state or country to visit family members and they stay longer than three to four weeks. When visitng family you need time to be with them and enjoy time with them, because you wont get to see them often when you leave. Even if the student stays for two weeks and the student returns they will not have enough time to do their summer assignments or to gather materials for school. One month is not enough time and not fair when us students go 10 months straight to school, two months and couple days is a good amount of time to relax.\n\nAlso when it is summer there are plenty of activities to do like go to national parks, amusement parks, water parks, play outdoor sports, have gatherings with family members, and relax at home. I mention these type of activities because they are not available in other seasons like fall, winter, and spring. There should not be a week break in fall, because first there are no special holidays or reason why we should have week off, also if no school for a whole week and Columbus Day people will start to get the habit not to come to school. Although a longer break would be nice for the winter, all we need to have is two weeks for Christmas and New Years.\n\nWe need to have more time to learn and be prepared for future exams, especially if some students do not have good grades and are falling behind on their work. Some may argue that two months and a couple days is too much, but parents would not like it if their child was starting to stay home and not go to school. We need to have all the time in the world to be educated and be caught up on all missing assignments. Finally it might seem that most students will forget information during the summer, it will not matter because the student will not be learning the same information as last year.
If you could visit one place in the world where would it be? One place that I would like to visit is Pakistan. Here are some reasons why I would like to visit this place. First, it is known for it's parks. Secondly, the food is amazing. Lastly, Pakistan is one of the nicest culture. As you can see, Pakistan is an excellent place to visit.\n\nPakistan is known for some of it's best amusement parks. One place I would go to is Aladdin park. It's an amusement park with a lot of thrilling rides. I could go on the chair lifts. They are so awesome. Another place I would go to is Sea view. It's a beach. There I could go on horse and camel rides. The rides are exhilarating. About three or four people can ride the camel at the same time. They take you all the way to the water than back to where you started. Another place I would go to is Safari Park. It is an amusement park /zoo. There is a section for animals. You can go on a safari ride to see them. One of the best part about the ride is that you get to go to the elephants cage. There you can pet the elephant, you can even feed it, and you can go inside the cage if you want to go close to it. As you can see, Pakistan has variety of places to go so you won't get bored.\n\nFood. It's the most important thing..right? When I wake in the morning after an awesome night. I will be hungry. So I start my day first by going to the local breakfast shop. There I will order eggs with some round hot parathas, and than some hot piping chai. Then when it's lunch time I will go to a fast food restaurant. There I will order a chicken burger with yummy fires and soda. When night comes around it will be time for dinner. For dinner I will go to a local restaurant. There I will order steaming hot Chicken Korma with buttery naan and Mango lassi. For desert I will have hot gulabgamun. They are like little doughnut balls covered with sugar syrup, and are very soft. As you can see, Pakistani cuisine is very delicious.\n\nThe people are very nice in\n\nPakistan. Wherever you go you would see people helping out each other. They are very welcoming and kind. They treat each other like they all are equal. They laugh, talk, and they just have fun. They don't disrespect each other, they take care of each other, and are very grateful. They are very protective towards each other. They're like a community and support one another. As you can see, Pakistani culture/people are the best.\n\nIn conclusion, I would say that Pakistan is awesome. So get your plane ticket right now and come to Pakistan. It is one of the best country you could visit.
I agree with Emerson's statement because people should be themselves no matter what. You want to always show the real you. That is the beuty of life,connecting with different types of people with different types of personalitys. People in this world now a days are cruel and mean that have no heart. People bully others because of theres clothes,shoes, and how they look. You can get bullied for anything now a days, its very sad. That's why people who get bullied hate themselves and want to become something they are not.\n\nI remember one point in my life, i was deppressed. I kept getting bullied because of how big my head was or how skinny i was. I know it sounds funny, i laugh all the time when i talk about it dont worry. I stopped wanting to come to school because of that. I never wanted to leave my house or talk to anyone. It was very sad. But one day one of my close friends asked me why i wasn't coming to school, and i told him everything. He told me straight up to ignore all the negative stuff that people call me and live your life to the fullest. Since that day, we have been bros for life. He always had my back and i always had his. A few weeks passed and i told my mother. We talked for a few hours about how i should ignore all the negative stuff because life is so short that you can't let anything stop you. That really changed me and how i see life.\n\nTrying to be yourself in this world is very difficult now a days. Just by telling someone that there shoes are ugly can really change the whole person. They start buying stuff that they don't really like. Also doing stuff they don't want to do. Suddenly they start doing bad stuff. Just to fit in with other people that have all the nice clothes and shoes etc. People really can't be themselves because of judgment.\n\nThere should be more help in this world so people that are going through this can get help. People should be motivated to be themselves and also love themselves. Some people can really say somethig mean and the victim could commite suicide, just because of someones judgment. People should start treating other people with respect. Parents should start teaching there kids early on how to show respect. People shouldn't care about someone elses opinion. People should live there lifes to the fullest.\n\nPeople should feel very accomplished to be themselves in this world. People really make you feel like trash when they say something negative about you. There is always going to be negative stuff coming at you, that's normal. That is what makes you stronger and turns you into a great human being. That is what should motivate you to do great things in life. That is what should make yourslef and everybody close to you proud. To be yourslef in this world should be the greatest accomplishment.
Schools were made for people who wants to learn and be a successful person in life even though , there are some people who don't have the opportunity to be in school. Right now in some countries be on school until you are 18 is a law but it other countries government those not care about children future. Here in the United States they have the option for students to attend classes from home by online or video conferencing. They have that option specially on universities because some universities are out of the city and a percentage of students with a bad economy may not be viable to get transportation everyday. So In my opinion that is a great idea to have that option on universities. They should have the same option in high school but not to all the students because that may cause students to fail the classes. High school 's should give that option to students with excellent notes and for students who live out of town. Attend classes from home by online or videos has benefits, oneis you become more responsible,\n\nsecond it helps you to earned money, and gives you more opportunities to success.\n\nIn one hand,Attend classes from home it may be a big responsibility because you are doing it by your own no one is going to help you or push you to learn. For example when you attend to class in a school or colleague there is always a teacher ,who is there to help you,supports you ,and make sure you don't fail your semester, they also make sure that you are learning and getting better everyday. Instead when you have to attend classes by yourself you must be confident and responsible to make sure that you are going to take classes everyday and don't waste the opportunity,because no one is going to be telling you more than 3threet times to do you work .There are some students that don't know what be a responsible person means, does students may not be viable to get good greats by taking classes from home. This kind of students need help from someone to push them and teach them to be a responsible person. Be a responsible person is important because it helps you to success in life gives more opportunities and you don't depend from nobody you learn how to do things by your own.\n\nIn the other hand one more benefit to attend classes by home in online it helps you to earn money specially if you live in large distance from school. A few houses are located miles away from the city that means schools are located miles a way from home. In that case attend classes from school it would be very helpful and a big opportunity. Because take transportation everyday Monday to Friday it may be expense because you may pay at mornings to get to school and pay back in the afternoon to go back home. One more benefit is that it help you to success,you may be a viable to find a job. For example you can do your online classes in the mornings and find a part-time in the afternoon. Many students do this they go to school on mornings and work for a couples of hours at night. But if you could attend classes from home it would be so much easier to work and study at the same time you would made your own schedule withou a problem. Also make sure to give enough of time to do your online classes and get good greats.\n\nIn conclusion\n\nI do believe this potion to attend classes from home in online or videos is a great opportunity. Specially for students who live out of the city and for everyone who was to success in life no matter what. School and universities should let students know about this option. I am agree and I believe that I may not be the only one who support this idea. Therefore this opportunity should give to students who really needs it and no to those who would waste it .This kind of option should be in all over the world to help people with bad economy and help those who want to success and have a passion to learn. Students who have the opportunity to attend school everyday without a problem should know that there is people that live far from the city that they would love to be seated in a classroom and attend school everyday.
regression_fit <- parsnip::fit(regression_wf, 
                     regression_train_df)

Identifying examples with especially poor performance can help us follow up and investigate why these specific predictions are poor. Conceptually, its easy for a baseline know-nothing model to assign all essays to the median score of 3. The predictive power is in the ability to model the essays that are not 3 into buckets higher and lower than 3.

Because the ratings are a form of ordinal value, or even a likert scale, we will ensemble a second classification model that includes the output of the regression.

classification_train_df <- train_essays_raw  |> 
                select({{outcome}}, full_text) |> 
                bind_cols(
                  predict(
                    regression_fit,
                    regression_train_df
                  )
                ) |> 
               rename(regression_pred = .pred) |> 
               mutate({{outcome}} := factor(.data[[outcome]]))

classification_wf <- workflow(multiclass_recipe_builder(outcome = outcome), svm_spec) 

folds <- vfold_cv(classification_train_df, strata = !!outcome)

set.seed(42)  
rs <- fit_resamples(
  classification_wf,
  folds,
  metrics = metric_set(kap, accuracy),
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
kapmulticlass0.3205615100.01364307Preprocessor1_Model1
accuracymulticlass0.4658447100.01140595Preprocessor1_Model1
collect_predictions(rs) |> 
  ggplot(aes(x = .data[[outcome]], y = abs(as.numeric(.data[[outcome]]) - as.numeric(.pred_class))/2)) +
  geom_violin() +
  scale_y_continuous(breaks = seq(-5,5,0.5)) +
  labs(y = "Residuals",
       title = "{{outcome}} Residual errors for essays in held out folds",
       subtitle = "The highest and lowest essays are still not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = as.numeric(.data[[outcome]]) - as.numeric(.pred_class)) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text, {{outcome}})
ABCDEFGHIJ0123456789
full_text
<chr>
In my point of view, I feel what is more beneficical is working alone. You might think working in a group is more beneficial, but let me tell you why is it not a good idea. It lets you concerate more on your work and won't let you get distracted and get off topic with the rest of the group. On top of that it gives you the chance to slightly get your work done in a matter of time. On the other hand, in case you don't understand a topic,it benefits you learning alone so next time you understand it in the future time. In this way of working alone, has many benefits and could help you in many ways in the long run.\n\nHave you ever been part of a group at somepoint in your life, and your group gets off topic and ends up not finishing the work that was assigned? It really isn't such a productive group like that I could say. Say perhaps you were trying to get your work done, but you entire group wants to do unproductive things and gtet off topic. Have you ever thought who gets the blame after? Your group gets the blame and you as well. Even if you were being on topic and getting your assignment done, but your also part of the group, what could you do. Let me give you an example. There was once where my math teacher said we could work in a group. Me and my group were getting our work done, until one of my group members gets off topic. There goes my whole group off topic. What was the result after, my group didn't finish the assignment. Next thing you know who got the blame that day. My whole group and including me as well. I explained to my math teacher in a nice, clamy matter to her, that I was trying to get my work done, she didn't lose an energy listening to me.\n\nWhat if you teacher for example set a timing to finish the project, and you couldn't finish in time because of the silliness in your group? I'm positive you would want to finish in time and get a good grade. I'm more than certain that you don't want to finish late with your group and get a zero as your grade from your teacher. I've have so many examples, but let me tell you one that stood up to me and left my eyes bright open. My biology teacher had told the whole entire class there was a project due at the end of the class. So she told us to get in groups, of four people in the group. Long short story, my group got way off topic and didn't finish in time. At the end,we all got zero's and for a week I had a zero bringing my grade down. I brought my grade up, until it was test day. I've been through so many experiences, I enjoy working alone. On the other hand, I also experienced understanding a topic on my own, which feels great let me tell you.\n\nHave you ever experienced in life going or thinking of a topic and not understanding? That has happened to me once. Where your at a point,where you don't understand a topic, but learning on your own kicks in. Everytime you go back and reazlied what you did wrong, it all kicks in, in the future. Which in my point of view is a good benefit. Learning on your own is denfitnely not a bad thing. There was once where I was having quite the trouble at a topic, in my class of english, but the outcome wasn't so bad. As I could say. In that certain assignment I got a high B. I learned after where I needed more information on that topic in my english class. On the next assignement I had I got a high A.\n\nWorking alone has many benefits and could benefit you in the long run. Many poeople think its beneficial working in a group, but I say no. Want to do better, get a good result after, get a nice dencent grade after. Working alone is the solution. Don't let anyone trick you into saying it's bad, because it is most ctertainly not a bad choice/idea. If you come across a point to work in a group, thats great, i'm not saying never work in a group. Although at some points when the stitution is series to get an assignment done, thats were working alone comnes in handy.
I agree that we should have positive attitude in life to be success in life. Showing positive attitude to human beings and animals by not harming others and the nature. Staying and spending time with positive attitude people is also a key to a successful life. It`s also important to show positive attitude it will help us to become better and successful in life. Show positive attitude you will get the same positive attitude back.\n\nIf we show positive attitude to human beings and animals, by treating people with good maners and helping them out with any kind of work in life that is for a good cause we will get the same positive attitude back from that human who we were helping out. Same goes for the animals treat them well they will be safe in returun that animal might protect you from harm. Having a positive attitude people will not judge you for being wrong or innocent because of the positive attitude you have.\n\nIs positive attitude important? Yes, because if you want to be successful in life you need to have and show positive attitude with that you also have to show respect and responsibility. For example going for a job interview showing positive attitude might get you a job. Many people love positive people because of their way they talk to other people, how they act, and the important things that the perosn might have done. Staying with positive people and hanging out with positive people is also a important, because that`s one place you learn positive attitude and it`s a key to be succuessful in life.\n\nPositive attitude is a key to a good life, positive attitude people don`t show attitude over small things or fuss about somthing that is not important. They let things go by easy and don`t care about the samll things that won`t affect them. Even if we have positive attitude we should not treat ourself by saying we a king or a role model, instead we should help others into having a successful life by helping them out with positive attitude and showing what is good for them.\n\nFinally, but not last I agree to be success in life you need to have positive attitude. Positive attitude is the key to success in life. Showing the way you care for others and animals, making positive thoughts and thinking. Positive attitude people stay in their circle which is a good thing helps them be focus in life and have success in life. Show positive attitude to others you will get the same attitude back. So spread positive attitude and making this world a better place to be successful in life.
I`m agree whit the individuality. I like when the people take whatever they wants for yours life is so cool. I have too much friend and they do the think another peoples do. I mean i like do what i`m said and what i like i don`t now.\n\nMy family is so negative when they said sometime and i don`t like because i want said sometime but they no want lisent. so i`m individuality because i want lisent to me and do the think i want.\n\nI know to much people dependt of other and that`s no good.\n\nThe history class said too much about that because in the past the people are not indiviuality.\n\nI think the people want more attention that why depent of other people.\n\nThe life now is to diferent of after because now the people yos depent the what said other person about who i`m look or what he said about me an all theese think.\n\nI like who i am cause i`m a nice and all good thinks so i do whathever i wnat because i ike who is the people and i dont care what they said about me.\n\nYo ya nose que escribir solo sigo por que pues no se me gusta y si supiera un poco mas de ingles no pararia de escribir.\n\nso les voy a contar sobre mi vida ya que no tengo ni la menor idea de lo que tengo que escribir ni nada.\n\ncomienzo llegue de Puerto Rico hace 2 anos y desde que llegue aqui mi vida cambio del todo.\n\ncomenze a valorar cada cosa que obtengo por que ahora se el valor y el sarificio de la vida para cualquier cosa.\n\nsolo se que apesar de todo sigo queriendo superarme y mejorar muchas cosas de mi.\n\nno se me hace tan facil pues el idioma y las costumbres no son para nada igules.\n\nPero aqui sigo y seguire por que creo en mi y se que cada dia que me propongo algo lo cumplo.\n\nNo es nada facil cuando llegas y conoces personas de otros lugares algunas muy buenas y otras no tanto.\n\nMe agrada demasiado aprender cosas nuevas y nuevos lugares solo hay una cosa que me enoja y es que apesar de no ser una persona indocumentada y pues nosotros los puertorriquenos somo parte de estados unidos y solo por el hecho de que nuestro primer idioma sea en espanol muchas personas nos tratan como indocumentados.\n\nllevo 2 anos los cuales no an sido nada facil ya que la escuela a sido uno de mis mayores obstaculos pues es bastante complicado entrar a un salon y sentir que estas completamente solo.\n\npues por el hecho de no poder preguntar o comunicarte con alguien no nada solo te quedas hay viendo como todos pueden y tu no.\n\nUnos meses despues de que llegue de Puerto Rico comenze a salirme de la escuela y hacer las cosas mal ya que no tenia apollo de nadie alli ni en mi casa.\n\nHoy en dia siento que no debo estar aqui por que solo siento que no es mi lugar la unica razon por la que aqui estoy es por mi mama por que quiero que se supere y poder darle todo lo que merece.\n\nya que cuando la necesitamos hay estuvo apesar de como era la vida en puerto rico siempre trato de darnos lo mejor.
Students work better alone rather than in groups. Students can have more support and ideas from others in groups; however, students works better alone than in groups. Working alone is beneficial for students because students can finish on time, focus more, and challenge them self.\n\nWorking alone is beneficial for students because students can finish on time. Students can work on their assignment at home and they can be more independently. Students while they are working independently, can managed their time by completing their assignment. Students can work as slow and fast, as they want. Students can finish on time.\n\nWorking alone is beneficial for students because students can focus more. Sometimes when students are working in groups they get distracted by other team member and that cause a negative impact in the students learning. Students while they are working alone can put more effort on it and being more creative. Students without distractions can gain more knowledge. Students focus more.\n\nWorking alone is beneficial for students because students challenge them self. Students when they are working alone, learn have to be responsible for their work and collaborate in challenging them self by doing it independently. Also, students can learn new vocabulary. Students can ask the teacher if they need support. Students challenged them self.\n\nIn conclusion, students learn many things by working alone. Students can learn have to be more independently. Students learning developed by focusing more in class and avoiding any distraction, so students can have better grades. Final, students learning depends on how much effort they put on their learning.
A city council is having arguments to adopt curfew for teenagers,10 P.M on weekdays and midnight curfew on weekends. Some people thinks this to be a good idea,but others especially like young people does not think so. There are conflicting opinions over this topic. According to me this is a good idea to set a limit for teenagers who stay away from home late night. In my opinion,this adoption can lead to improvement in sleeping habits of teenagers,prevents unhealthy food habits and allow teens to spend more time with their families.\n\nCurfews to stop teenagers going out of home late night make them improve their sleep time. As they are home they sleep on better time than they are out till midnight. For young people sleep time should be 7-8 hours atleast,because of their growing body structure. Young people are more energetic if they sleep well. Staying out late disturbs bed time for teens,which makes them lazy,tired and inactive in activities going on around us. Unadequate sleep can also lead to risk in driving a vehicle. As you could not sleep well you may feel dizziness while driving a vehicle,which is really dangerous. A lot of teens die in road crashes because of unattentiveness while driving,this unattentiveness comes from unadequate sleep. Also the crashes are caused due to drink and drive habits after staying out late night. To protect teens from death in that early age curfews should be adopted. As when me myself could not sleep well,I am unable to concentrate on my work in my class. This alot of times effects my grades. Also when I stay awake till late night separates me from what is going on in real world because when people around me are awake,I am not focused and asleep.\n\nThis adoption also somehow effects teens eating habits. Staying out means eating unhealthy and junk food,which is not at all good for young people's health. Along with adequate sleep we also should be healthy to stay fresh and active. It is really necessary for young people to eat healthy food because they have their full life to live and if they will stay unhealthy,they will get diseases in really early age. Not only food when teens go out with friends they drink alcohol or beer, which is not good for them at that early age. Unhealthy food weakens teens immune system which leads to diseases in quite early ages. Not only diseases unhealthy food collects a lot of fat in their body that effects teens socially,mentally and physically. If teens stay in the house they eat food provided to them by their parents, also which is healthy and not too oily. Whenever I eat unhealthy food it makes me sick and if you are in place where no one knows you,people there likes tyo stay away from me which makes me feel uncomfortable. I have seen a guy in my family who have grown fat after eating a lot of junk food,he suffers a lot of problems like he need someones help to get up if he sits down,a lot of people teases him for his fatty body and also he cannot even walk fast because he gets tired fast. So to stay away from these bad comments and unfit body teens should eat healthy food and home made food.\n\nApart from food and sleep curfew for teenagers make them stay home with their families. This makes them to interact with their families instead of going out with friends. Most of times generation gap is being shown in between families that is just because of less attraction in between people in the families. Having dinner together at night makes you discuss various aspects going on around us. Like when our family get together we talk about of new things we tried,just as me and my sister made new friends as we shifted here this year. Also we talk about how to be aware from diseases going on in recent days. We also discuss about problem we are suffering from. This makes us share our happiness and problems we are going through in our life and also we are able to intract wih the family members.\n\nThere are various more ideas that shows that this adoption takes teens lives towards positive aspects. Proper sleep,healthy food and interaction with their families can be obtained if this curfews are adopted. To make future generation healthy and concentrated about development and growth of our country these laws are need to be applied. If teens will be healthy they will come up as fresh and present minded citizens towards the country. If they will sleep well,they will work hard to make their dreams come true. Also if they will interact with their families they will make each and every one satisfied in world. Teens should take this in a positive way instead of taking it as a restriction on their freedom. This is not a reastriction but a key to live healthy,fresh and active way of life. Give teens life by restricting their habits instead of giving them dealth with improper lifestyle.
collect_predictions(rs) |> 
  rmse(truth = as.numeric(.data[[outcome]])/2, estimate = as.numeric(.pred_class)/2)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
.estimate
<dbl>
rmsestandard0.4610223

Results here aren’t great, but they are more are less competitive with the leaderboard figures.

The final fitting ensembles both the regression and classification fits, and makes a prediction on the submission essays.

classification_fit <- parsnip::fit(classification_wf,
                                   classification_train_df)

extract_fit_engine(regression_fit) |> 
  vip::vip(num_features = 20)

submission <- predict(
  classification_fit,
  
  submit_essays_raw |>
    bind_cols(predict(regression_fit, submit_essays_raw)) |>
    rename(regression_pred = .pred)
) |>
  transmute({{outcome}} := .pred_class) |>
  bind_cols(submission)
Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?

Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?
submission
ABCDEFGHIJ0123456789
phraseology
<fct>
vocabulary
<fct>
syntax
<fct>
cohesion
<fct>
23.533
3333
3.53.533

We fit for grammar first using an xgboost regression, using case weights to adjust for the frequency of occurrence of each value of grammar.

outcome <- outcomes[5]

regression_train_df <- train_essays_raw  |> 
                select(!!outcome, full_text) |> 
                case_weight_builder(outcome)

regression_wf <- workflow(recipe_builder(outcome = outcome), xgb_spec) |> 
       add_case_weights(case_wts)

folds <- vfold_cv(regression_train_df, strata = {{outcome}})

set.seed(42)  
rs <- fit_resamples(
  regression_wf,
  folds,
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
rsqstandard0.2387485100.009663079Preprocessor1_Model1
rmsestandard0.6116953100.003343309Preprocessor1_Model1
collect_predictions(rs) |> 
  plot_preds(.data[[outcome]]) +
  labs(y = "Predicted",
       title = paste0(outcome, " predictions against essays in held out folds"),
       subtitle = "The highest and lowest essays are not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = .data[[outcome]] - .pred) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text)
ABCDEFGHIJ0123456789
full_text
<chr>
To who it may concern,\n\nHello my name is STUDENT_NAME and I think doing community service is a good idea, but I think others will disagree with it. So I think we should do an assembly on how important it is to keep our planet and city clean and educated. We should have guess speakers, reward assemblies and more disappline assemblies for the students that won't do the community service. So the students can help with the community instead of destroying it with graffiti, rival gangs, and destroying public property.\n\nSincerely,\n\nSTUDENT_NAME
My dad once said" that one day I'll save a life just by calling 911". The reason he said that is that the technology today is better than the one he grew up with. Technology today can do more things than the technology a few years ago. Technology today does have a positive effect on people because it can help people communicate with people around the world, and people can call 911 for an emergency.\n\nIt helps people communicate with people around the world. For example my Uncle can't leave the country to go visit his mom but if he does he can't return to the states. So the technology now allows him to Skype or Facetime his mom when he wants. In fact 70%\n\nof the people around the world can communicate. All the people can now connect with anyone with just a simple button.\n\nPeople can call 911 for an emergency. For example my dad had witness a car crash when he was driving to work. When he saw the car flipped over he quickly got his phone and called 911. The cops came in like 3 minutes. When the cops arrived they quickly got the guy out of his car where he was flipped. So thankfully my dad was there to call 911 for him and saved his life. In fact 55% of people that call 911 save a life. So if you ever witness an accident call 911 because you might save a life.\n\nTechnology does have a positive effect on people. It can help people talk to people all over the world. People can also call 911 for emergency. Other people believe that technology is the root of evil, however technology helps everybody no matter what. So technology is the best thing humans ever created because it can help anybody do anything.
Dear TEACHER_NAME\n\nI think that we don't need community service hours because, some students do well in school and they don't get to go to all the 8th grade fun activities that they have by the end of the school year. Like a lot of students do very well in school but they cant go to the fun activities or graduate from 8th grade because they don't have community service hours. If students have bad grades and they have a green sheet that you are failing 8th grade and they have to get 5 and up grades and they are showing progress then i think that its fair to let the students graduate from middle school even do they didn't do service hours. That's why i say that its fair too let the students graduate from middle school even do they didn't do service hours. i know that theirs a lot of students that haven't done the service hours and they are really worried that their parents may get mad at them for not graduating 8th grade. So that's why i' m saying that that's why we don't really need service hours.
Dear principal,\n\nI have heard of the school cafeteria's plan to change to a new healthier school lunch. And as a junior in this school,I take the position that this new dynamic idea to change the school's lunch menu is a bad idea. So I have decided to share my thoughts for the development of this school and with our health. I believe that keeping our school's lunch menu is a good idea. I know that my opponents would argue with me regardlessly,because they would probably assume that our students have been eating the same food for too long and would definetely want to have a different versions of food,and get to explore their school lunch like other schools usually do. But when they detect my reasons,they would know for sure that the school's lunch is way better than they think it is.\n\nMy initial reason for not agreeing to this change is that it would eradicate some student's favorite cafeteria foods, especially me,There are a lots of food currently in the cafeteria that are so good, clean and healthy.\n\nthey are also enough food for everyone to eat, so changing the menu wouldn't be necessary, it would be a waste of time and money. the school has got a bunch of stuff to focuse on. American's have this quote that " if you have lemons make lemonades" meaning we should make the best out of what we have by embracing it not changing it.\n\nIn additon, the current school's lunch menu is technically healthy, I have this extraordinary thoughts in my mind because I haven't seen any student that has protested against the school's lunch, this means that the current school lunch is unique on it's own way. Also the school lunch is potentially some of the amazing healthy American foods.\n\nAgain,Most American foods are junky and cause students to gain weight chronically and gradually. But our current food consists of fruits,vegetables and also green salad which prevents the body from gaining too much weight and sustain the normal body weight. I have been eating our school's green salad for a while and l have seen some fantastic changes in my body and it is very impressive. So principal, dont you think that changing our school's cafeteria's lunch menu is a bad idea?\n\nFor instance, our school cafeteria's lunch has got protein,Vitamin D and my weight is intact, as far as our health is concerned, so take all of these reasons into consideration and figure out your final answer,I hope that you make the right choice for the school and l know that the school's improvement is your priority.\n\nThank you respectively,\n\nGeneric_Name 11th grade( junior)
By the time students enter high school, I believe that they should have an idea of what type of career they would like to pursue after they graduate. For some students, committing to a specific career at young age sometimes is a good idea as long as you have a backup idea for a different career in case you decide that you do not want to pursue in that career anymore, thats why committing to a career at a young age is only sometimes a good idea because you'll never come up with another career if you keep changing your mind. The courses that you study in high school should be thought about as well because maybe you need a specific degree from a course in order to pursue in that career.\n\nI believe that, if a student is going to commit to a career that they should be very passionate about this career, they should be at least a junior in high school so that they've had time to get a feel of the other careers and decide which one they enjoy and suits them the best, and they should keep in mind the requirements that are needed, the benefits, and the types of jobs that it offers to them. Students who commit to a career at a young age are usually athletes, or they plan on working in their family business.\n\nPursuing your career needs a lot of hard work in school especially in this generation because you're going to need to go to a good college so you need a good GPA because you're going to want to go to the college that has a good academic program for the career that you plan on pursuing. Therefore, you need to go to college, and work hard so you can get a good job because most jobs, don't hire anyone without a college degree.\n\nFinally, thats what I think about choosing the right career for yourself, and committing to a career at a young age. although some may still believe differently and disagree with my view on this issue.
regression_fit <- parsnip::fit(regression_wf, 
                     regression_train_df)

Identifying examples with especially poor performance can help us follow up and investigate why these specific predictions are poor. Conceptually, its easy for a baseline know-nothing model to assign all essays to the median score of 3. The predictive power is in the ability to model the essays that are not 3 into buckets higher and lower than 3.

Because the ratings are a form of ordinal value, or even a likert scale, we will ensemble a second classification model that includes the output of the regression.

classification_train_df <- train_essays_raw  |> 
                select({{outcome}}, full_text) |> 
                bind_cols(
                  predict(
                    regression_fit,
                    regression_train_df
                  )
                ) |> 
               rename(regression_pred = .pred) |> 
               mutate({{outcome}} := factor(.data[[outcome]]))

classification_wf <- workflow(multiclass_recipe_builder(outcome = outcome), svm_spec) 

folds <- vfold_cv(classification_train_df, strata = !!outcome)

set.seed(42)  
rs <- fit_resamples(
  classification_wf,
  folds,
  metrics = metric_set(kap, accuracy),
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
kapmulticlass0.3364463100.008541008Preprocessor1_Model1
accuracymulticlass0.4665812100.007468007Preprocessor1_Model1
collect_predictions(rs) |> 
  ggplot(aes(x = .data[[outcome]], y = abs(as.numeric(.data[[outcome]]) - as.numeric(.pred_class))/2)) +
  geom_violin() +
  scale_y_continuous(breaks = seq(-5,5,0.5)) +
  labs(y = "Residuals",
       title = "{{outcome}} Residual errors for essays in held out folds",
       subtitle = "The highest and lowest essays are still not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = as.numeric(.data[[outcome]]) - as.numeric(.pred_class)) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text, {{outcome}})
ABCDEFGHIJ0123456789
full_text
<chr>
My talent and skill is drawing, painting, and coloring, and writing. Those are my favorite talents and skills. And the things I like to do with them is making cartoons, painting and drawing pictures, and coloring, and writing novels. But, also last year I did art and took all art clubs ,and classes ,and usually I like to be a real cartoonist so this year I want to be a writer. And I want to do that for this year. But I am still good at it. So next year in ninth grade I am doing art again next year. And I use whenever I'm bored and there nothing I can do at home of at school.\n\nSo for writing I want to write novels and books for everybody. And lately I have been taking writing classes during the summer. But last year I started being a cartoonist and start writing newspapers and drawing cartoons for the newspapers. At School I join the animate club and then I started drawing pictures for the scenes of the cartoon. And I like it. So I join the yearbook club and I started writing the captions under the photos. To tell and say what it actually means. So last year for third block I had facs ,and I use art for the cakes and cupcakes and also ice cream. And then I think that art is good for me.\n\nSo let me tell about my favorite skill writing. The main I like writing is I like to write novels and books. But my favorite book I like to write is about Transformers Dark of the moon. My favorite graphic novel of all times and it is the number one movie to be produce of all times and in the beginning of the novel is the war of cybertron and the rest of the movie is all about everything about the space race. But the main thing I like about writing is you know is the words and feelings of it ,but also I like to write about poems , and poems help think about feeling.\n\nAnd other kind of stuff let give you some specific reasons.\n\ndetail#1:\n\nI think that writing can impress you detail#2:\n\nWriting can also contain facts and opinions detail#3:\n\nWriting can also have poems\n\nSo for art is everything\n\nArt is everything\n\nIt can be all around us\n\nAnd ,but also writing can have vocabulary and it is for spelling. But you must check your spelling whenever you are done with an article or an essay. And it also contains art. But also for art it shows like it graphic novels authors must make bubble speeches for the people it the book to say. Whenever they are happy, sad, or other kinds of feelings. But it contains all kinds of words and languages for people to say ,and the bold means what is important and what it really means. But it means whenever a person reads a book. And what it have to say what it self.\n\nMy conclusion is that in the future I continue to think about my talents and skills and what they really means to me. But still I think I still care about it. And that is for everyone else's. That is my favorite. For example I draw and write comics. That is my conclusion. The end
Hi my name is Generic_Name and I am going to talk about energy and resources. The reason why we are talking about energy and resourses is because ,some busineses have adopted a four day work week. They want to because they want to conserve energy and resourses.\n\nEach work week is going to be for 10 hours but in my opinon that is not going to work. I think it is not going to work because, people are barely working 8 hour shift and working 10 hour shifts. It is going to be more painful for people, and they are going to get really tired. In my opinion if they are going to make people work for 10 hours for 4 days, they have to increase the minumim wage and pay a little bit more money.\n\nTheir is alot of reason why I do not agree with this new change. The only positive reason I see is getting 3 days off. Another positive reason I see for this change is, if you get payed every 2 weeks, and you worked\n\n4 days and, make 40 hours 1 week and 40 hours another week, it is going to be a good paycheck. Now it depends how much you get payed but im pretty sure if you are going to do 10 hours shifts, they are atleast going to pay $12.00 an hour or they are going to pay you $11.00 dollars in hour. Those would be good reasons to work in a job like that. It depends to if the people have time to work 10 hour shifts for 4 days.\n\nTheir are some school that want to have those same rules that some jobs have of 10 hours. I do not think that would work for students, because 10 hours of being in school is really stressing. I know how it feel like to be in school for 8 hours, is it is not fun and it is really stress full. I think that the classes in highschool would be more longer the students would not concentrate .The reason they would not concentrate is because, you would be doing a lot of asighnments and, you would lose intrest in what they are teaching and, you would lose focus. In my opinion I would not like that but I am pretty sure the school would like it because, they would be completing more work and they would be finishing lessons really quick and the students would study more.\n\nThere would be another advantage to that because the students would be in school for 10 hours for 4 days a week. They would have 3 days off every week that in my opinon it would propably be friday saturday and sunday. It would sound kind of good since you get 3 days off every week, but at the same time no students want to be in school for 10 hours for 4 days a week ,that sounds stressing and hard .You would propably have more classes, a lot of home work ,and more test, and quizes. It would propably be hard for teachers to do 10 hour shift to because ,they would have to do more planings of lessons because they would propably have to teach lot of classes during the day since the school day is 10 hours.\n\nIn my opinion this prompt that I wrote today was really intresting. The topic was really intresting it made me think a lot of what I was going to type in this prompt. The topic was really intresting because it was about what I thought about jobs only working 4 days a week and 10 hour shifts. The other part of the topic was what if school was 4 days and 10 hours. This prompt made me put myself in that position and I did not like it if this would ever happen in real life I would be against it .
The type of work I would like to have is a stalyst professional and paint landscapes.\n\nStalyst professional is a really good job you get a lot of money only doing hairstyles.\n\nPainting landscapes is a really good job too because you are doing what you want doing a really good art and a lot of people like how it looks like they pay a lot of money for the landscapes if you do a really good job.\n\nI chose stalyst professional because is interesting to do, you learn a lot about girls hairstyles and boys hairstyles I think is a really good job because a lot of people likes to do hairstyles and people likes to do haicuts because there is a lot of different things for example new hair color or a new hairstylt and stalyst is a really good job because you get a lot of money and you can do whatever you want with your own money but working hard.\n\nI think the workplace will be in a place that there is a lot of people, because when is people they are interesting to have new haistyles for example if someone goes to have a new hairstyle and is really cool people are going to wish have the same hairstyle or a different hairstyle.\n\nPeople are going to be really happy to have a new hairstyle because some people are bored to have the same haircut and if is a place with a lot of people they are going to love that place.\n\nI chose doing landscapes because is interesting for a lot of people, because if you do a really good lanscapes people are going to love it and they are going to be interest to have one.\n\nlandscapes are so beutiful because you see how the paints are combinated houw the color are mixted and you see a really cool landscape. The work for the landscapes with acrilic paint it looks really nice because it looks realistic, and that's interesting for people that like to have landscapes.\n\nI think the workplace for landscapes is like where is a lor of people that like to see landscapes and buy them because landscapes are so pretty. I chose to do landscapes because I like to paint\n\nI like to see the color and how they are mixted that's so cool. I li9ke to paint landscapes because I\n\nfeel relax and am not thinking nothing I forget about everything and I reflect how I feel doing landscapes\n\nI also like to paint landscapes because I love acrilic paints and how they mix and how they work.
I have heard that many people gets bully by others people sometimes, and which is I don't understand, why this it happens probably for the color of you're skin and we all are the same just the color of the skin is different. Or can be other reason why they bully other people, which is people who gets bully they could kill themselves about getting bullied by other ones and thats a bad situation.\n\nBut those bad people they keep on bulling they don't stop until something happens and I ask my self why? this happens sometimes, probably its because we are different than they are or they feel more stronger than other ones or can be any other reason probably they are rich they have more money than other people, probably thats why bulling someone is not nice it could cause bad things to you.\n\nAnd I understand that its hard for those people who are suffering about bulling, and its hard to support all that when you get bullied for someone, when you bullied i thin k is not for some reason and its horrible for those people who gets bullied by someone, I think thats something that those people who are bulling they should stop bulling those poor people.\n\nWhat should we do about bulling collaborate to stop we should stop because, it can cause bad situation to those people who are bulling other they can go to jail for the reason they make fun of others, why they can go jail because those poor people who are getting bullied they could kill themselves and thats why they can go to jail its a bad thing thats what can happen to them if they don't stop bulling
Students graduated in three year of the High School!\n\nI think is good idea because all student that want a best future try to do a good thing that it is a benefit for the school. when a student is smart make the time important for take other course for to have for credit is for that some student don't need to take the four grade in the high school, A student also that have excellent grade in all the classes, and only have a difficult classes, this student that had the opportunity for graduated early that other students.\n\nExample:\n\nA student of Generic_School is in 9 grade, but this student have a difficult classes, but this students is focus just in the classes, and have a excellent grade also this student take a deport after school all the days. The student he's prepared every time for the quiz, and for test.\n\nFinish the school the student is the best student of the year in the school because He passed all the classes and the SOL. During the summer He go to the summer school for to pass other class that he going to have in 10 grade, finish the summer school He pass the class with excellent grade, so this student had a so much credit of the normal.\n\nHe stars the 10 grade, so He had other advanced classes, because in summer school he pass the classes that He was going to have in 10 grade. This student continue that, He pass all the classes, and SOL that He need for graduated. Now this students is in 11 grade, but the student had a big credit and He go to the school for 4 classes so this student have the opportunity for graduated in 11 grade because is a excellent student.\n\nHe finally is graduated the school in 11 grade, so He finish the school, but He said that want to go the collage because want to prepare more for to go to the university, because He want to be a excellent lawyer.\n\nThe excellent student finish the collage, and the university, so now He is a big lawyer with a great statutes. The parents of this excellent students, and good person, so they feeling fortunate for have a big son.\n\nAll we have the opportunity for to be a best person in the life, all depended how we wants to be in the life. Many student wants to have a excellent grade but don't put of they part for be a good students.\n\nNow in day the most students just want to come to school for 3 or 4 classes but don't want study for had a good grade,many students go to school but don't go the classes, and other students is stay outside of school for smoky, because the most students used cigarette or other thing.\n\nWe don't know appreciated the best opportunity of the life.\n\nReasons for graduated in three year\n\nAll students who graduated early have a big opportunity in the collage, and the university, and the work or whatever place.\n\nwhy?\n\nbecause the old person thinking that this type of person are responsible in all the thing.\n\nAre a people responsible!\n\nWhy?\n\nbecause when have a big responsibility never said 'NO' and have care for all thing.\n\nExample:\n\nI'm Generic_Name, I work in Bank Of America, today my boss need to leave early because He had a compromised with other important person, and He give me the responsibility for received the money of today.\n\nBe carefully!\n\nWhy?\n\nbecause they try to make with carefully the work or whatever thing.\n\nExample:\n\nMy name is Generic_Name, and I work a company of cake, and my supervisor said me congratulation because you are very carefully with the work all the time.\n\nMy Idea!\n\nI think all the people we have the best opportunity in the life to be a best person in the live,but the major opportunity is that when we have somebody is protected, and supported our decisions.\n\nWhen we start the education needed to keep the marge for be the person who we want to be. The thing are best when we support all bad thing.\n\nThe best idea is continue with the school and be a good students, because all student that it is educated, they type students have a more opportunity that other who they don't want to be a best person in the future.\n\nWhy the younger people just thinking in pass the life in party or in the street?\n\nWhy now in day we see a kids abandoned in the street?\n\nBecause many mother don't have a good education for to have a compromise of the had a kids, this type of mother just thinking in that the drugs,alcohol,or party is the major thing.\n\nMany mother having a bad decisions!\n\nSo is for that what we need to prepare for to make more easy our life.\n\nHave a diploma of the High School is very important because we work less, and we have a good job,when we have a good job we have a lot money, and when this happened we are prepare for take a funny moment in our life, But just for that is not the base for make whatever thing, first we need think what we need to do!\n\nWe know that this life is so hurt, and is more hurt when we take a bad decision like not finish the school or don't put care to our thing for to be prospered.\n\nSome time is good help take course when the people don't finish the school.\n\nExample:\n\ntake a course for by the license, and put a beauty salon.\n\ntake a course for by idea how to have a company of electricity.\n\ntake a course for be some body also a little important in the life.\n\ntake a course for be a teacher of music.\n\nWe have so much course for prepare more when we don't finish the school.\n\nSome time when a students go to the school, and they not finish is responsibility of the parent guardian because the parent need to see for the son or daughter keep going the school, I think when the students don't finish the school part of this is fault of the parents.\n\nHow we can finished the school, and how can I do graduated?\n\nThe things for to finished the school is:\n\nGo to the school every day.\n\nMake the homework.\n\nPrepared for the quiz or test.\n\nPass all the SOL.\n\nPass all the classes.\n\nWhen you make all the work in the classes or in the school, and you pass all the thing, you can graduated. If you not want to go to the collage, the diploma of the High School is very important for have a good job in your life.
collect_predictions(rs) |> 
  rmse(truth = as.numeric(.data[[outcome]])/2, estimate = as.numeric(.pred_class)/2)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
.estimate
<dbl>
rmsestandard0.4740788

Results here aren’t great, but they are more are less competitive with the leaderboard figures.

The final fitting ensembles both the regression and classification fits, and makes a prediction on the submission essays.

classification_fit <- parsnip::fit(classification_wf,
                                   classification_train_df)

extract_fit_engine(regression_fit) |> 
  vip::vip(num_features = 20)

submission <- predict(
  classification_fit,
  
  submit_essays_raw |>
    bind_cols(predict(regression_fit, submit_essays_raw)) |>
    rename(regression_pred = .pred)
) |>
  transmute({{outcome}} := .pred_class) |>
  bind_cols(submission)
Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?

Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?
submission
ABCDEFGHIJ0123456789
grammar
<fct>
phraseology
<fct>
vocabulary
<fct>
syntax
<fct>
cohesion
<fct>
223.533
33333
3.53.53.533

We fit for conventions first using an xgboost regression, using case weights to adjust for the frequency of occurrence of each value of conventions.

outcome <- outcomes[6]

regression_train_df <- train_essays_raw  |> 
                select(!!outcome, full_text) |> 
                case_weight_builder(outcome)

regression_wf <- workflow(recipe_builder(outcome = outcome), xgb_spec) |> 
       add_case_weights(case_wts)

folds <- vfold_cv(regression_train_df, strata = {{outcome}})

set.seed(42)  
rs <- fit_resamples(
  regression_wf,
  folds,
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
rsqstandard0.2794699100.010820127Preprocessor1_Model1
rmsestandard0.5706834100.003165901Preprocessor1_Model1
collect_predictions(rs) |> 
  plot_preds(.data[[outcome]]) +
  labs(y = "Predicted",
       title = paste0(outcome, " predictions against essays in held out folds"),
       subtitle = "The highest and lowest essays are not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = .data[[outcome]] - .pred) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text)
ABCDEFGHIJ0123456789
full_text
<chr>
Do you agree or disagree with extending the school day. I disagree with extending the school day. The 3 reasons why i disagree with extending the school day is that the students will get home late,the school will need to spend more money on students,and the students will get more tired.\n\nFirst of all,the students will get home late. The students won't have have time to do after school sports nor activities. The kids will not have time to do homework nor study. The students won't have time to do fun things on their own time.\n\nAdditionally,the school will need to spend more money on students. The state will need to raise taxes for the schools. The school will need to spend more money on bills for utility. The schools will need to spend more money on supplies and food for kids.\n\nFinally,the students will be more exhausted. The students will be exhausted because they will need to do work for extra hours. Students who do after school sports or activities will not get enough sleep because they will be getting home late. The students will get home past there bed time and they have to eat dinner.\n\nIn conclusion,the three reasons why is disagree with extending the school day is that students will get home late,the school will need to spend more money on students,and students will be more tired.
The best time in life is when you become yourself. I agree that the greatest accomplishment, is when you be yourself in a world that constantly trying to make you something else. Because you make your own choices, you become more happy, and you respect others.\n\nFirst, you make your own choices by being yourself. Becoming yourself means that you should be able to make your own choices and not be shy or afraid of what you're doing. Because you're defining yourself by doing those things that you want. Some people follow others, therefore, they don't make their own choices. People are afraid to make their own choice because they don't want to get rejected or be wrong. In this world, most of the teenagers act and follow the people who are strong and bullies. The reason they follow them and make the same choices they make, is because they're afraid that they will get beaten up and be left out. Personally when I came to the United States I used to follow other, because I thought they were amazing. But one day, I knew I was walking in the wrong path and I left them. Making your own choices makes you happy because you get to do what you like and what you want to do. It's hard to make your own choices, but one day you're going to have to make your own choices. The more you mature the more it will become easier for you to not be afraid of what you're doing and how other people are looking at it, because at the end of the day It's your life and you do what you think is right.\n\nSecond, You become more happy by being yourself because you make your own choices, You take responsibilities and you do whatever makes you happy. Also, some people act like they're happy while not being themselves, but matter of fact, they're depressed from the inside. Being yourself makes you more happy because you feel like you achieved something big. Also, Some religious kids who become themselves love everyone. In the bible it says "Those who know God should love others, because God is love."\n\nNot being yourself will get you depressed because you don't do everything you want to do, but you do what others wanna do because you want to fit in. Some kids who come from a different country will do stuff they don't want to do just to fit in, because they don't want to be lonely. Some people are afraid they won't be happy because they would lose a lot of friends for being themselves, but they have to know that those people should be there for them and support them for what he's doing since it's his friends.\n\nLastly, Respecting others will gain them to respect you. Some teenagers like to make fun of others, not listen to what they have to say, and they like to beat kids up. Also some kids don't like to not listen to their parents, and that is also disrespectful. The bible says " Honor your father and mother."\n\nIf you respect your parents and listen to them, then they would trust you and not ask you lots of questions. Respecting other should be really important, because you don't want others to not respect you. Also, Some people are disrespectful because they were never respected. Important things to do to be respectful is, Listen to what the other person has to say, Stand up for them, Being friends with them Doing all of that will gain you respect and you would have good friends. Also, if you see someone bullying a kid don't watch, and stand up for them, don't be afraid to stand up for someone because you're doing the right thing.\n\nSome may disagree with me and say that it's not that big of a deal, and it doesn't feel like a big accomplishment. But with all do respect, I agree that it's a big accomplishment because nowadays it's really hard to become yourself.\n\nIn conclusion, It's hard to become yourself in this world, because others are holding that opportunity back from you and you're afraid to fight it back. That's why I agree that to be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.
Student and teachers are have opposing views on working together for various reasons. However, according to new Stanford research, when people are treated as partners working together their motivation, student are able to communicate with each other, therefore creating a better final product. Working in team also prepares students for future careers and job. Whoever they will be required to learn to cope with other people and personalities, it is valued by employers. Even though students are not agree with each other all the time, working together is ore beneficial than working alone.\n\nEvery body ha heard someone in their life say " two minds are better than one" before right, this quote has never range more, and all of the idea it promotes reflect crystal clear off of group work. Working in a group can be drastically reduce the amount of work you need to do as well as make thing of more efferent, whether it be a group project paperer presentation. Because it cuts down on how much work one person has to do. It allows for group to achieve more as alone. Things are also finished much quicker because of the way many people can split up different jobs in a group an people with different skill sets can do what they are best at and do not have to worry about what they are bad at, this broader range of skill can also be used to help other people members develop their own by learning from their team members. The diversity found within a group of people is one of most powerful resources a person can have when it comes to finishing a task.\n\nit lends a group of people to have many more ideas to come up with and bounce off of because many people are working\n\n"The best way to have good idea is to have a lot of the a quote from Linus Pauting dealing with dilemma new idea's. When dealing with abdicating an idea from thin air, it be best to have multiple people instant of one because it brings multiple ideas all have fair and different point rather than multiple ideas no opposition or diversity.\n\nAnother benefit of having multiple people working in one group is that this can cause an evolutionary like phenomenon with multiple, stronger idea that complete and mulute, creating one in tribute and exceptional idea. This also comes with the help of a group, as a group can decide which idea would be main idea and smoothe out the edyes.\n\nAnother problem that can come up is well problem. Having a group of people can become extremely helpful for solving a problem that may come up in situations where a problem can arise, having a group of people can allow for quick and easy way to get out of a situation. Now working in a group does not have its advantage but some things are best done alone\n\nThough working in a group can seem to be good working alone can be better depending on the situation. Being in group full of adult and unfocused group members is infuriating and may seem like torture. Although, some people prefer working alone because they can focus better and make decision faster, in the end, it is a better to working in a group.\n\nif one does not do work the only they fail. Also being in a group fell safe. While being alone means you are much more impotent so working in group\n\nThough working alone can be better for one reason such as anxiety. paranoia worry about other preference, or simply because they would prefer to work alone. Working in a team is advantage over some others who are unaccustomed to doing so , it helps develop people skill decision making skills and general expertise for putting up with others.\n\nworking in a group is also good for getting other people's opinion on group member work, as long as they do their part, oftentimes students will learn and experience more in a group of their peers than working alone which is definitely better for their future an possibly what lies ahead. Developing these skill will most likely help in the coming times of college, careers their future family and even retirement.\n\nOverall, working together is beneficial because it creates less work and allow work to be completed faster. Working together promotes constructive criticism from other member of the group , which produces a better final product, working together create different points of view with different points of view new ideas are generated. New idea create diversity is the way to success.
Welll its going to be ah good beefit but in the same time it's a bad benefit to doing class in the house .\n\n(03/10/2020).\n\nThe oportunity the not miss one class and be in you house is the best thing the can happen to one school students, this benefist the school and the students beacuse they never going to miss one day of school and the homeworks and tests to. In the actually some kids miss the school for be sicks, some familiar pass away ,they in vacation and they not return in time to the country , they miss the bus school and they can't go to the school beacuse they not have car ,oh they wake up late. This is a benefit because they can learn about the class oh activity and not miss homework oh test and be prepare for the next class in the school, and be in his house relaxing and be in a safe place and always have ready you homework oh test to next class and its ah good benefits to the people ho its in the hospital and can go to the school for ah broken legh oh medical condition .\n\nBut not everething it's good about this idea some kids maybe oh actually they gonna stop going to the school and stay in his house and skiping the school. this its going to affect them beacuse they can't sociable with other people ,they can have ah computer oh in his house, they not have wife oh cellfone and other guys oh kids will skip the online class to and go play video games,and they parents are not gonna have idea about what his kid did oh do, and during the test they can copy using this class peapers oh using his fone to find out the answers. ( In my case i will always if they give me the opportunity to online classes i will always stay in my house relaxing in my bed when i listening the class ) but in the end this option of learn in his house have his good and bad bennefits (some school in the united states are not using this becuse they not have personal wedsites and can garanteed if the student are going to use this ) .\n\n( I have one idea in how they can do this in ah good way. The students ho miss the school need to call the school and inform why they not going to the school and need the have a parent in his house, then they send them the link of the online class and notify the parent if they are doing work, oh they are skiping the online classes, and they can have ah limet time of online classes so they can be focus to his work and doit on time and when they are doing ah test they doing the test in a video coferincing with one teacher if they and not chating oh copy during the test. ).\n\nMy personal opinion:\n\nIn my opinion its ah good offer becouse sometimes i miss the school bus and i can't go to the school becuse i not have ah car and i always miss the class,homework and tests, and this can be help me a lot to have all the work in time and be prepare for the next day of school and be ready take the class oh to take one test .\n\none sad fact:\n\nIn the intere world some kids can have this oportunity to have online classes in some countries around the world they not have the tecnology to do that so if they miss the school one its like they are missing one day of his life and fact even they are kids ho not are going to the school bacuse the parents not have money to send them to the school ( yep in some countries the education cost money and they not have free schools like united states ) and they have to work in one short age to help his family in my country was like this thaks to good i was alow to go to the school thanks to my mother and come her to the united states so when i come to the school her in united states and i hear students said i hate the school and i wanna be in home i remember my country and i said thanks to this country for give me free education (even in her they do video school conferencing to the people ho not coming to the school and i said wow , Even they do that for the students, and the students are doing protest to have more off days so what i try to said is always thanks to you parents for the education they are give to you and thaks always to you country to give you free education to you can be some one in you future and have a nice work and never ask why i not have this. and always think some in around the world not have the stuff the you have and always thanks to GOD for the stuff you have ( I always do that wen i wake up).\n\nExtra fact:\n\nIn some countries i the world like China,South Korea,Russia... etc, the education in vidio its ilegaly in all school this is bacuse they think the education its have to be like the oll days paepar pencil and uniform (some schools in united states more in the private schools) and they not use laptops to do classes the have to read every single book and the attendence its obligatory what i read if you miss the school in that countries they punch you in the hands with one metal stinck ( like in some countries in south america) and the leave detention in the school and you have to writte in 10 oh 20 pages the i have to come to the school every day . sometimes they stay in the school all day bacuese they need study for ah test. I some countries ( South Korea ) its elegal have computers and cellphones in the school . in south america yeah they can cellphones and laptops in the schools but the problem its the internet so many people have to steall the wife to his neighbord.
What is positive attitude? Positive attitude is when a person has positive thoughts about something that went wrong or good, but they see all the possibles ways to success in life. Having a positive attitude is essential in lifestyle, this can bring happiness to your life, and can take you to extraordinary places. I think having a positive attitude is important because this is a way to express yourself around others, and to show the way you can manage your thoughts. I agree that having positive attitude is the key to success in life, and that everyone should have a positive attitude not just for a work area but anywhere.\n\nThere are many reasons to have a positive attitude, for example: you may want to have a positive attitude when you get a bad grade on the test, because you can think positive and say: " I did bad on this test today but, I am going to keep trying and studying hard every time so I can do better".\n\nAnother example is when you are doing a sport and you think you can't do it and that you are going to give up, you can tell yourself you can do it and have a positive attitude towards it. There are always problems in the daily life, and people deal with this problems not always with a good attitude.\n\nWhat will happen if you don't have a positive attitude? Well if you don't have a positive attitude, you won't have success in life because you are going to have negativity in your mind and the word "fail" is going to become one of your favorites. Having a positive attitude is not always easy, and not all people have it. A negative attitude is the opposite of a positive attitude, and this can affect your life. For example: In school if you have a bad attitude things can go bad, when you are always being negative usually your problems don't get fix and you struggle more with your thoughts. This can mentally affect you, and teenagers are challenged every day by this issue.\n\nThe key is positively to a succesful life. I personally consider myself as a postive person. I try to solve every problem with a positive attitude because when I do so, my problems get fix the good way and I am happy with the results. If I don't have a postive attitude, all my goals would be nothing, I get stress and change my attitude, and I even hurt people's feelings without knowing. Success is important too because by this you can be a better person for society, people can judge you differently and you can help others when they are going through a lot. Positively is also mental strength,\n\nit expands your knowledge, it changes the way you think about everything, and makes your life easier.\n\nIn conclusion, having positive attitude helps you to have success in life. Sometimes it's hard to understand how people can be so positive about everything, but not all people are happy in their lifes. Some people have their reasons to not be positive, and it's important to understand these people. Other people, like me, have postitive attitude towards anything, which is good because it helps you in your daily life, work, school and others activities. A lot of people like other people with a positive attitude, because it brings positive energy and hapiness to other people's life. Everyone should have a positive attitude, if you are not a positive person, it's not to late to change the way you are living , and it's time to have more positive thoughts and say " positive" for a successful life.
regression_fit <- parsnip::fit(regression_wf, 
                     regression_train_df)

Identifying examples with especially poor performance can help us follow up and investigate why these specific predictions are poor. Conceptually, its easy for a baseline know-nothing model to assign all essays to the median score of 3. The predictive power is in the ability to model the essays that are not 3 into buckets higher and lower than 3.

Because the ratings are a form of ordinal value, or even a likert scale, we will ensemble a second classification model that includes the output of the regression.

classification_train_df <- train_essays_raw  |> 
                select({{outcome}}, full_text) |> 
                bind_cols(
                  predict(
                    regression_fit,
                    regression_train_df
                  )
                ) |> 
               rename(regression_pred = .pred) |> 
               mutate({{outcome}} := factor(.data[[outcome]]))

classification_wf <- workflow(multiclass_recipe_builder(outcome = outcome), svm_spec) 

folds <- vfold_cv(classification_train_df, strata = !!outcome)

set.seed(42)  
rs <- fit_resamples(
  classification_wf,
  folds,
  metrics = metric_set(kap, accuracy),
  control = control_resamples(save_pred = TRUE))

collect_metrics(rs) |> arrange(mean)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
mean
<dbl>
n
<int>
std_err
<dbl>
.config
<chr>
kapmulticlass0.3258944100.010379311Preprocessor1_Model1
accuracymulticlass0.4683396100.007796526Preprocessor1_Model1
collect_predictions(rs) |> 
  ggplot(aes(x = .data[[outcome]], y = abs(as.numeric(.data[[outcome]]) - as.numeric(.pred_class))/2)) +
  geom_violin() +
  scale_y_continuous(breaks = seq(-5,5,0.5)) +
  labs(y = "Residuals",
       title = "{{outcome}} Residual errors for essays in held out folds",
       subtitle = "The highest and lowest essays are still not predicted well")

train_essays_raw[

collect_predictions(rs) |> 
  mutate(residual = as.numeric(.data[[outcome]]) - as.numeric(.pred_class)) |> 
  arrange(desc(abs(residual))) |> 
  slice_head(n = 5) |> 
  pull(.row)

, ] |> 
  select(full_text, {{outcome}})
ABCDEFGHIJ0123456789
full_text
<chr>
Scientist Albert Eisnste sad " imagination is more important than knowledge " I disagree with the statement.\n\nI disagree imagination is more important that knowledge.\n\nI disagree because, I think knowledge it's more important because, you have to knowledge after you imagine because, I think knowledge it'a more important because you have to knowledge. The situation to think really good if you dont due you can not think what it's gonna happen.\n\nbecause if you only imagine you don't gonna knowledge good because, if you only imajinate and say the words after you knowledge the words you what to says. and if you knowledge first after think you can be able to due son tings.\n\nIf you gonna to due a story if you only imagine you can not be able to due because you have to Knowles the situation first after you think because son times you can get good imagination and you have to knowledge.\n\nlike for example if don't knowledge you don't gonna now were put tings to knowledge the situation were you gonna put things and the ca n be better.\n\nI don't no what scientists Albert Einstein think and i gonna now what he thinks because, people have different opinion like how it's more better to they can use, and because persons have different ideas,like me i think then knowledge it's more important, then imagination but others people they can think it'snot because for people to see things it's different, because if the person am gonna write the story am gonna use the knowledge to knowledge, the situation better and make good story.\n\nThe knowledge it's like then a group because you have to search or knowledge to now what you gonna due because, if you only have in a imagination to what you gonna due that can work, like when you go to your job and you have to knowledge,what you gonna due for the day.\n\nwhen you go to school and you go to science if you have to examine the a plant you have to knowledge the plant to now were you can star to examine the plant.\n\nwhen you due sometimes you have to knowledge the situation,like for example,when a person quilled to another person, the police they have to knowledge,the scene and who was the criminal and knowledge the situation how died and who was .\n\nsome people think the imagination it's was first and it's more important would, I think the people see for different forms to due would a think some people it's right because, I see for different forms like when you imajinate it's like when you imajinate the things would you can have a picture in your minds like you can see pictures like were you what to put things.\n\nbut you can have im imajine in your mied but you have to knowledge first because i think if you knowleged because i feel more necesary to knowleged beause when you knowledged you can feel it's more easy or if you look like the pictures way it's more easy, because you see the things more specific en your miend.\n\nit's alot ways to you can see things because for people some people looks diferets to others you can see more better in you way if you don't get.\n\ni think people it's look things different ways and other they look like the same but the most important it's the way you see the tings for you.
The students enter in high school for graduating, and they expected to indentify a careers of cources in high school and are selected to guide them toward a specific career. I think was a good idea to commit to a career at a young age because they have more time to think about our career and learn more for that, and practice of the career, and take the position of a good life with work and pacient on careers.\n\nThe reasons why is good for a young age by know more careers and learning for a future, and earn more money and teach others about you learn in this proffesional career, and is most easily to find jobs in internet of in stores. For my example of this I choose a chef's carrer, and I learning more they teach me everyday of how to cooking and other things I do not know that; other example is when i am in high school and my teachers select me and others students for what is my career for my future they show me how to find careers in internet and i choose one of chef and the other is a doctor career i, choose the doctors and they help me more in topic doctors and how to work in this job etc. and i more of medicine and i help people for have more safety. This is my examples of careers.,lol\n\nThe students enter in high school for graduating, and they expected to indentify a careers of cources in high school and are selected to guide them toward a specific career. I think was a good idea to commit to a career at a young age because they have more time to think about our career and learn more for that, and practice of the career, and take the position of a good life with work and pacient on careers.\n\nThe reasons why is good for a young age by know more careers and learning for a future, and earn more money and teach others about you learn in this proffesional career, and is most easily to find jobs in internet of in stores. For my example of this I choose a chef's carrer, and I learning more they teach me everyday of how to cooking and other things I do not know that; other example is when i am in high school and my teachers select me and others students for what is my career for my future they show me how to find careers in internet and i choose one of chef and the other is a doctor career i, choose the doctors and they help me more in topic doctors and how to work in this job etc. and i more of medicine and i help people for have more safety. This is my examples of careers. The students enter in high school for graduating, and they expected to indentify a careers of cources in high school and are selected to guide them toward a specific career. I think was a good idea to commit to a career at a young age because they have more time to think about our career and learn more for that, and practice of the career, and take the position of a good life with work and pacient on careers.\n\nThe reasons why is good for a young age by know more careers and learning for a future, and earn more money and teach others about you learn in this proffesional career, and is most easily to find jobs in internet of in stores. For my example of this I choose a chef's carrer, and I learning more they teach me everyday of how to cooking and other things I do not know that; other example is when i am in high school and my teachers select me and others students for what is my career for my future they show me how to find careers in internet and i choose one of chef and the other is a doctor career i, choose the doctors and they help me more in topic doctors and how to work in this job etc. and i more of medicine and i help people for have more safety. This is my examples of careers.
Showing kindness to others is very important because people see you that you have a kind soul, people can spread kindness around the world, and kindness will help you throughout your future. Kindness is the key for success and enjoying your life. The world would not been the same if their were not any kindness, imagine what it would be like if no one knew what kindness is. Having kindness in your blood could change your future to an even better one. Having no kindness means that you are negative and misrable but all that could change when a person shows you how kindness could change your personality.\n\nWhen people see you showing kindness, that shows that you have a good heart and a good soul. And, it also shows that you care and very nice so, people could trust you. Thinking kindness is very positive and relaxing because it is a very good thing to do in life. Kindness will never be a bad thing because it is meant to change the future. No matter what, kindness could never go wrong as long as you try it to others.\n\nSpreading kindness around the world could change how people think, in terms of doing something bad is not part of kindness. Therefore, giving kindness to a person could spread around the world, and you would not even know that all this kindness was because of you. Without kindness, all the virture words would not even exsist. There would be no such things as being caring, loving, sharing, humble, and so much more. Every small kindness you show to others, will change their emotion and follow your action as they did to you.\n\nKindness will really help you in the future because it shows you who you truly are. If you show kindness everywhere then their could be a chance for you to get into jobs easily or, for you to get good grades on your school work. Also, in the future you would be very grateful that kindness brought you here into this amazing life, and all the kindness you have done in your previous years. Kindness is always by your side. You will appreciate having kindness in your life because it helps you to become a better person.\n\nKindness will not randomly appear to you, you just need to make and share kindness. Life is waiting patiently for the people to spread kindness everywhere but, unfortunatly some people would not let that happen. In our expectation people should already have kindness for, in reality thousands of people do not want to share their kindness. Some people are trying to spread kindness because they want the world to be a good place for the future. Finally, kindness will always be their in your heart, you just have to let it out.
I feel that this learning program can hep younger and older students and have a very big a effect on the people involved in the program, that is taking place in the schools.\n\nNot many many other schools have this program to get extra help and kids need to understand that the there is a big opportunity that is being given to them and they need to take it.\n\nThis program helps the younger students get a opportunity to get better at something that they are having a hard time on inside of school.\n\nIf the kids are having a hard time on doing work at home or not understanding, they dont have to get worried about there grades dropping because there are other options that you can do.\n\nIf the younger kids parents do not have that much time to sit and help them with work, then they can just get help from the learning program that happens at there school.\n\nThe more you go to the meetings the better you will get even if it takes time.\n\nI also feel that this could be important to the older kids that help as well.\n\nThis program would do very good for their service hours for there service hours for school.\n\nIt must be a good feeling for them because they were chosen to do something they are good and smart at.\n\nThey could possibly put this program on there college resume if they would like to become a teacher when they grow up.\n\nThere are many other reasons that this program could be helpful to others.
Solution, learning, and smart are three words that describe why knowledge is more important than creativity. Knowledge is more important than creativity because with knowledge people will do better at school, they will get a job easily, and if there is a problem they will find a solution.\n\nKnowledge is more important than creativity because with knowledge people will do better at school. The students will do better on test and quiz. If they get good grade on test and quiz they will have a better GPA. They will get smarter. If they get smarter they will learn faster. They will have good grades. If they have good grades they will get a good job later in their lives. Creativity is less important than knowledge because knowledge will help in life.\n\nKnowledge is more important than creativity because people will get a job easily. They will know where to search. If they know where to search they will waste less time. They will make a good impression. If they know a lot about the job they will make a good impression. People will have more chance to get hire. If they already know a lot about the job they want they will have more chance to get hire.\n\nKnowledge is more important than creativity because knowledge will help to get a job\n\nKnowledge is more important than creativity because if there is a problem people will find a solution. If there is a problem at work they will find how to fix it. If they find how to fix it they will have a chance to not get fired. When there is a problem with a friend people always fix it. If the problem is fixed everything comes back to normal. If there is a family problem someone will manage to fix it. When everything is fix everything is going back to normal. Knowledge is more important than creativity because knowledge will help to find solution.\n\nDoing better at school, getting a job easily, and finding solution to problems are way that knowledge is more important than creativity. Without knowledge humans will not be able to do anything. Knowledge will always help to get a job, to find solutions, and will help at school.
collect_predictions(rs) |> 
  rmse(truth = as.numeric(.data[[outcome]])/2, estimate = as.numeric(.pred_class)/2)
ABCDEFGHIJ0123456789
.metric
<chr>
.estimator
<chr>
.estimate
<dbl>
rmsestandard0.4548806

Results here aren’t great, but they are more are less competitive with the leaderboard figures.

The final fitting ensembles both the regression and classification fits, and makes a prediction on the submission essays.

classification_fit <- parsnip::fit(classification_wf,
                                   classification_train_df)

extract_fit_engine(regression_fit) |> 
  vip::vip(num_features = 20)

submission <- predict(
  classification_fit,
  
  submit_essays_raw |>
    bind_cols(predict(regression_fit, submit_essays_raw)) |>
    rename(regression_pred = .pred)
) |>
  transmute({{outcome}} := .pred_class) |>
  bind_cols(submission)
Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?

Warning in get_dtm(corp): dtm has 0 rows. Empty iterator?
submission
ABCDEFGHIJ0123456789
conventions
<fct>
grammar
<fct>
phraseology
<fct>
vocabulary
<fct>
syntax
<fct>
cohesion
<fct>
3.5223.533
433333
3.53.53.53.533

The Submission

Kaggle’s system runs the workbook twice. The first time is on the tiny three line public test dataset here. The second time is on a much much larger hidden test dataset. As a check to simulate how the hidden datset might fit, we could re-fit on the train dataset text across all of the fits.

submission
ABCDEFGHIJ0123456789
conventions
<fct>
grammar
<fct>
phraseology
<fct>
vocabulary
<fct>
syntax
<fct>
cohesion
<fct>
3.5223.533
433333
3.53.53.53.533
# write_csv(submission, here::here("data", "submission.csv"))

Outcome

Not only was this exercise a good study of Likert evaluation data, but also of NLP techniques and of statistical resampling to assure that the model performs on unseen data. The resulting models here lack the predictive power needed for production use.


sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] LiblineaR_2.10-12  xgboost_1.6.0.1    textfeatures_0.3.3 textrecipes_1.0.1 
 [5] tidytext_0.3.4     text2vec_0.6.2     yardstick_1.1.0    workflowsets_1.0.0
 [9] workflows_1.1.2    tune_1.0.1         rsample_1.1.0      recipes_1.0.3     
[13] parsnip_1.0.3      modeldata_1.0.1    infer_1.0.3        dials_1.1.0       
[17] scales_1.2.1       broom_1.0.1        tidymodels_1.0.0   forcats_0.5.2     
[21] stringr_1.4.1      dplyr_1.0.10       purrr_0.3.5        readr_2.1.3       
[25] tidyr_1.2.1        tibble_3.1.8       ggplot2_3.4.0      tidyverse_1.3.2   
[29] workflowr_1.7.0   

loaded via a namespace (and not attached):
  [1] readxl_1.4.1           backports_1.4.1        splines_4.2.2         
  [4] listenv_0.8.0          SnowballC_0.7.0        tidylo_0.2.0          
  [7] digest_0.6.30          ca_0.71.1              foreach_1.5.2         
 [10] htmltools_0.5.3        float_0.3-0            fansi_1.0.3           
 [13] magrittr_2.0.3         memoise_2.0.1          googlesheets4_1.0.1   
 [16] tzdb_0.3.0             globals_0.16.2         modelr_0.1.10         
 [19] gower_1.0.0            vroom_1.6.0            hardhat_1.2.0         
 [22] timechange_0.1.1       colorspace_2.0-3       vip_0.3.2             
 [25] rappdirs_0.3.3         rvest_1.0.3            haven_2.5.1           
 [28] xfun_0.35              callr_3.7.3            crayon_1.5.2          
 [31] jsonlite_1.8.3         survival_3.4-0         iterators_1.0.14      
 [34] glue_1.6.2             registry_0.5-1         gtable_0.3.1          
 [37] gargle_1.2.1           ipred_0.9-13           future.apply_1.10.0   
 [40] mlapi_0.1.1            DBI_1.1.3              Rcpp_1.0.9            
 [43] GPfit_1.0-8            bit_4.0.5              lava_1.7.0            
 [46] prodlim_2019.11.13     httr_1.4.4             RColorBrewer_1.1-3    
 [49] ellipsis_0.3.2         farver_2.1.1           pkgconfig_2.0.3       
 [52] nnet_7.3-18            sass_0.4.4             dbplyr_2.2.1          
 [55] utf8_1.2.2             here_1.0.1             labeling_0.4.2        
 [58] tidyselect_1.2.0       rlang_1.0.6            DiceDesign_1.9        
 [61] later_1.3.0            munsell_0.5.0          cellranger_1.1.0      
 [64] tools_4.2.2            cachem_1.0.6           cli_3.4.1             
 [67] corrr_0.4.4            generics_0.1.3         rsparse_0.5.1         
 [70] evaluate_0.18          fastmap_1.1.0          yaml_2.3.6            
 [73] textdata_0.4.4         processx_3.8.0         RhpcBLASctl_0.21-247.1
 [76] knitr_1.41             bit64_4.0.5            fs_1.5.2              
 [79] lgr_0.4.4              future_1.29.0          whisker_0.4           
 [82] xml2_1.3.3             tokenizers_0.2.3       compiler_4.2.2        
 [85] rstudioapi_0.14        reprex_2.0.2           lhs_1.1.5             
 [88] bslib_0.4.1            stringi_1.7.8          highr_0.9             
 [91] ps_1.7.2               lattice_0.20-45        Matrix_1.5-3          
 [94] conflicted_1.1.0       vctrs_0.5.1            pillar_1.8.1          
 [97] lifecycle_1.0.3        furrr_0.3.1            jquerylib_0.1.4       
[100] data.table_1.14.6      seriation_1.4.0        httpuv_1.6.6          
[103] R6_2.5.1               TSP_1.2-1              promises_1.2.0.1      
[106] gridExtra_2.3          janeaustenr_1.0.0      parallelly_1.32.1     
[109] codetools_0.2-18       MASS_7.3-58.1          assertthat_0.2.1      
[112] rprojroot_2.0.3        withr_2.5.0            parallel_4.2.2        
[115] hms_1.1.2              grid_4.2.2             rpart_4.1.19          
[118] timeDate_4021.106      class_7.3-20           rmarkdown_2.18        
[121] googledrive_2.0.0      git2r_0.30.1           getPass_0.2-2         
[124] lubridate_1.9.0       
LS0tDQp0aXRsZTogIkthZ2dsZSBGZWVkYmFjayBQcml6ZSAtIEVuZ2xpc2ggTGFuZ3VhZ2UgTGVhcm5pbmciDQphdXRob3I6ICJKaW0gR3J1bWFuIg0KZGF0ZTogIk9jdG9iZXIgMTUsIDIwMjIiDQpvdXRwdXQ6DQogIHdvcmtmbG93cjo6d2Zsb3dfaHRtbDoNCiAgICB0b2M6IG5vDQogICAgY29kZV9mb2xkaW5nOiBoaWRlDQogICAgY29kZV9kb3dubG9hZDogdHJ1ZQ0KICAgIGRmX3ByaW50OiBwYWdlZA0KZWRpdG9yX29wdGlvbnM6DQogIGNodW5rX291dHB1dF90eXBlOiBjb25zb2xlDQotLS0NCg0KVGhlIEthZ2dsZSBDaGFsbGVuZ2UgcHJlc2VudGVkIGhlcmUgd29ya3Mgd2l0aCBhIGRhdGFzZXQgdGhhdCBjb21wcmlzZXMgYXJndW1lbnRhdGl2ZSBlc3NheXMgKHRoZSBFTExJUFNFIGNvcnB1cykgd3JpdHRlbiBieSA4dGgtMTJ0aCBncmFkZSBFbmdsaXNoIExhbmd1YWdlIExlYXJuZXJzIChFTExzKS4gVGhlIGVzc2F5cyBoYXZlIGJlZW4gc2NvcmVkIG9uIHNpeCBtZWFzdXJlczogKipjb2hlc2lvbiwgc3ludGF4LCB2b2NhYnVsYXJ5LCBwaHJhc2VvbG9neSwgZ3JhbW1hciwqKiBhbmQgKipjb252ZW50aW9ucyoqLg0KDQpFYWNoIG1lYXN1cmUgcmVwcmVzZW50cyBhIGNvbXBvbmVudCBvZiB3cml0aW5nIHByb2ZpY2llbmN5LCByYW5naW5nIGZyb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