Sistem Rekomendasi Untuk Buku Bacaan

Background

Membaca buku secara daring dan juga website penjualan buku seperti Kindle maupun Goodreads memiliki banyak faktor yang membuat kedua platform tersebut bersaing satu sama lain.

Tidak dapat dipungkiri platform membaca serta menjual buku selalu memiliki peminat yang tinggi. Apalagi di era digital seperti saat ini, pembelian buku serta para pembaca secara perlahan mulai beralih untuk membaca buku secara digital. Membaca buku secara digital sendiri memiliki beberapa keuntungan, di antaranya adalah lebih hemat dalam biaya, lebih eco-friendly, serta praktis.

Salah satu faktor yang mempengaruhi kedua hal tersebut adalah sistem rekomendasi buku. Sistem rekomendasi buku sendiri dibuat untuk merekomendasikan buku-buku yang diminati oleh pembeli. Para peminat bisa langsung melakukan pembelian buku tanpa harus datang ke toko secara langsung dan membacanya secara digital. Selain itu juga dapat mencari buku sesuai dengan rating dan review lebih mudah dibandingkan dengan membeli langsung ke toko.

Sistem rekomendasi akan membantu para user untuk menemukan produk apa yang sesuai serta berguna dari sekian banyak produk yang ada. Tujuan dari adanya sistem rekomendasi buku sendiri adalah untuk memprediksi hal apa yang menjadi ketertarikan oleh para pembeli serta merekomendasikannya kepada mereka. Sistem rekomendasi buku bisa dilihat dari berbagai banyak faktor seperti konten isi buku serta kualitas buku berdasarkan dari reviewnya.

Dengan memberikan analisa informasi buku untuk mengerti kebiasaan para pembaca, sistem rekomendasi juga bisa menjadi salah satu tempat untuk memprediksi buku yang layak untuk di baca serta meningkatkan efisiensi dalam membaca.

Project Idea

Peningkatan peminat dalam membaca buku saat ini semakin meningkat, terutama dikalangan pemuda membuat platform market place juga ikut meningkat. Dengan adanya sistem rekomendasi buku, akan memudahkan para pembaca, penulis, hingga platform bisnis untuk mengetahui lebih lanjut tentang pasar buku yang sedang diminati.

Problem Scope

Pada project ini akan digunakan sebuah data dari platform buku Goodreads yang diambil dari situs Kaggle dengan judul “Goodreads-books: Comprehensive list of books listed in goodreads”.

Selanjutnya, kebutuhan pembuatan model machine learning untuk mengetahui rekomendasi buku berdasarkan rating, review serta bahasa yang digunakan akan menggunakan data numerik untuk mempermudah permodelan.

Model sendiri akan dibuat dengan memanfaatkan metode KNN dan K-Means Clustering.

Output

Output dari project ini berupa dashboard analysis yang menampilkan Exploratory Data untuk menunjukkan buku dengan rating atau review paling tinggi untuk mengetahui buku apa yang sedang diminati.

Business Impact:

  1. Project ini dapat membantu para penulis, pembaca, serta platform buku mengenai buku seperti apa yang paling diminati
  2. Membantu user untuk meningkatkan penjualan
  3. Meningkatkan kreativitas dan mempermudah penulis untuk dapat mengetahui buku seperti apa yang ingin dibuat selanjutnya.

Exploratory Data Analysis

Libraries

library(dplyr)
library(factoextra)
library(FactoMineR)
library(lubridate)
library(corrplot)
library(tidyverse)

Read Data

book <- read.csv("books.csv")

head(book)
##   bookID
## 1      1
## 2      2
## 3      4
## 4      5
## 5      8
## 6      9
##                                                                                   title
## 1                             Harry Potter and the Half-Blood Prince (Harry Potter  #6)
## 2                          Harry Potter and the Order of the Phoenix (Harry Potter  #5)
## 3                            Harry Potter and the Chamber of Secrets (Harry Potter  #2)
## 4                           Harry Potter and the Prisoner of Azkaban (Harry Potter  #3)
## 5                                Harry Potter Boxed Set  Books 1-5 (Harry Potter  #1-5)
## 6 Unauthorized Harry Potter Book Seven News: Half-Blood Prince Analysis and Speculation
##                       authors average_rating       isbn        isbn13
## 1 J.K. Rowling/Mary GrandPré           4.57 0439785960 9780439785969
## 2 J.K. Rowling/Mary GrandPré           4.49 0439358078 9780439358071
## 3                J.K. Rowling           4.42 0439554896 9780439554893
## 4 J.K. Rowling/Mary GrandPré           4.56 043965548X 9780439655484
## 5 J.K. Rowling/Mary GrandPré           4.78 0439682584 9780439682589
## 6      W. Frederick Zimmerman           3.74 0976540606 9780976540601
##   language_code num_pages ratings_count text_reviews_count publication_date
## 1           eng       652       2095690              27591        9/16/2006
## 2           eng       870       2153167              29221         9/1/2004
## 3           eng       352          6333                244        11/1/2003
## 4           eng       435       2339585              36325         5/1/2004
## 5           eng      2690         41428                164        9/13/2004
## 6         en-US       152            19                  1        4/26/2005
##         publisher
## 1 Scholastic Inc.
## 2 Scholastic Inc.
## 3      Scholastic
## 4 Scholastic Inc.
## 5      Scholastic
## 6    Nimble Books

Deskripsi Data:

  • bookID : A unique Identification number for each book.
  • title : The name under which the book was published.
  • authors : Names of the authors of the book. Multiple authors are delimited with -.
  • average_rating : The average rating of the book received in total.
  • isbn : Another unique number to identify the book, the International Standard Book Number.
  • isbn13 : A 13-digit ISBN to identify the book, instead of the standard 11-digit ISBN.
  • language_code : Helps understand what is the primary language of the book. For instance, eng is standard for English.
  • num_pages: Number of pages the book contains.
  • ratings_count : Total number of ratings the book received.
  • text_reviews_count : Total number of written text reviews the book received.
  • publication_date : Date when the book was first published.
  • publisher : The name of the publisher.

Data Wrangling

Cek tipe data dari book

str(book)
## 'data.frame':    11131 obs. of  12 variables:
##  $ bookID            : chr  "1" "2" "4" "5" ...
##  $ title             : chr  "Harry Potter and the Half-Blood Prince (Harry Potter  #6)" "Harry Potter and the Order of the Phoenix (Harry Potter  #5)" "Harry Potter and the Chamber of Secrets (Harry Potter  #2)" "Harry Potter and the Prisoner of Azkaban (Harry Potter  #3)" ...
##  $ authors           : chr  "J.K. Rowling/Mary GrandPré" "J.K. Rowling/Mary GrandPré" "J.K. Rowling" "J.K. Rowling/Mary GrandPré" ...
##  $ average_rating    : chr  "4.57" "4.49" "4.42" "4.56" ...
##  $ isbn              : chr  "0439785960" "0439358078" "0439554896" "043965548X" ...
##  $ isbn13            : chr  "9780439785969" "9780439358071" "9780439554893" "9780439655484" ...
##  $ language_code     : chr  "eng" "eng" "eng" "eng" ...
##  $ num_pages         : chr  "652" "870" "352" "435" ...
##  $ ratings_count     : int  2095690 2153167 6333 2339585 41428 19 28242 3628 249558 4930 ...
##  $ text_reviews_count: int  27591 29221 244 36325 164 1 808 254 4080 460 ...
##  $ publication_date  : chr  "9/16/2006" "9/1/2004" "11/1/2003" "5/1/2004" ...
##  $ publisher         : chr  "Scholastic Inc." "Scholastic Inc." "Scholastic" "Scholastic Inc." ...

Cek karakter unik yang ada pada kolom language_code

unique(book$language_code)
##  [1] "eng"           "en-US"         "fre"           "spa"          
##  [5] "en-GB"         "mul"           "grc"           "enm"          
##  [9] "en-CA"         "ger"           "jpn"           "ara"          
## [13] "nl"            "zho"           "lat"           "por"          
## [17] "srp"           "9780674842113" ""              "ita"          
## [21] "9781593600112" "rus"           "9781563841552" "msa"          
## [25] "glg"           "wel"           "swe"           "nor"          
## [29] "9780851742717" "tur"           "gla"           "ale"

Pada kolom tersebut ternyata memiliki isi data yang tidak sesuai dengan kolomnya. Dapat dilihat bahwa terdapat angka-angka yang seharusnya berada pada kolom isbn namun berada pada kolom language_code. Sebelum mengubah kolom menjadi factor,kita perlu untuk cek apakah character tersebut benar berada dalam kolom yang sesuai atau tidak.

book[book$language_code %in% c("9780674842113", "", "9781593600112", "9780851742717",  "9781563841552"), ]
##                           bookID
## 3349                       12224
## 3350    Harvard University Press
## 4704                       16914
## 4705           Cold Spring Press
## 5880                       22128
## 5881 Huntington House Publishers
## 8983                       34889
## 8984   Brown Son & Ferguson Ltd.
##                                                                                                                                                                 title
## 3349                                                                                                    Streetcar Suburbs: The Process of Growth in Boston  1870-1900
## 3350                                                                                                                                                                 
## 4704                                                                                                                                The Tolkien Fan's Medieval Reader
## 4705                                                                                                                                                                 
## 5880                                                                                                                                   Patriots (The Coming Collapse)
## 5881                                                                                                                                                                 
## 8983 Brown's Star Atlas: Showing All The Bright Stars With Full Instructions How To Find And Use Them For Navigational Purposes And Department Of Trade Examinations.
## 8984                                                                                                                                                                 
##                                       authors
## 3349                          Sam Bass Warner
## 3350                                         
## 4704 David E. Smith (Turgon of TheOneRing.net
## 4705                                         
## 5880                             James Wesley
## 5881                                         
## 8983                                    Brown
## 8984                                         
##                                                                                     average_rating
## 3349                                                                             Jr./Sam B. Warner
## 3350                                                                                              
## 4704  one of the founding members of this Tolkien website)/Verlyn Flieger/Turgon (=David E. Smith)
## 4705                                                                                              
## 5880                                                                                        Rawles
## 5881                                                                                              
## 8983                                                                                Son & Ferguson
## 8984                                                                                              
##      isbn     isbn13 language_code num_pages ratings_count text_reviews_count
## 3349 3.58 0674842111 9780674842113     en-US           236                 61
## 3350                                                    NA                 NA
## 4704 3.58 1593600119 9781593600112       eng           400                 26
## 4705                                                    NA                 NA
## 5880 3.63 156384155X 9781563841552       eng           342                 38
## 5881                                                    NA                 NA
## 8983 0.00 0851742718 9780851742717       eng            49                  0
## 8984                                                    NA                 NA
##      publication_date publisher
## 3349                6 4/20/2004
## 3350                           
## 4704                4  4/6/2004
## 4705                           
## 5880                4 1/15/1999
## 5881                           
## 8983                0  5/1/1977
## 8984

Seperti yang sudah diduga, isi dari kolom-kolom tersebut bergeser dan terdapat isi kolom yang tidak sesuai. Karena tidak sesuai, kita perlu mengembalikan beberapa baris data yang bergeser ke kolom yang sesuai.

# book <- book %>% 
#   filter(language_code != c("9780674842113", "", "9781593600112", "9780851742717",  "9781563841552"))
`%!in%`  <- Negate("%in%")

book <- book[book$language_code %!in% c("9780674842113", "", "9781593600112", "9780851742717",  "9781563841552"), ] 
length(unique(book$language_code))
## [1] 27

Selanjutnya perlu dilakukan perubahan tipe data. Hal pertama yang akan dilakukan adalah merubah tipe data kolom publication_date ke tipe data date.

Ubah tipe data

book$publication_date <-  as.Date(book$publication_date, format = "%m/%d/%Y")

Sebelum mengubah tipe data pada kolom yang lain, saya ingin mengetahui terlebih dahulu apakah terdapat missing value pada data tersebut, terutama pada kolom publication_date.

Cek missing value

colSums(is.na(book))
##             bookID              title            authors     average_rating 
##                  0                  0                  0                  0 
##               isbn             isbn13      language_code          num_pages 
##                  0                  0                  0                  0 
##      ratings_count text_reviews_count   publication_date          publisher 
##                  0                  0                  2                  0

Diketahui, terdapat 2 baris pada kolom publication_date yang hilang.

book[is.na(book$publication_date),]
##       bookID                                                   title
## 8184   31373 In Pursuit of the Proper Sinner (Inspector Lynley  #10)
## 11103  45531             Montaillou  village occitan de 1294 à 1324
##                                               authors average_rating       isbn
## 8184                                Elizabeth  George           4.10 0553575104
## 11103 Emmanuel Le Roy Ladurie/Emmanuel Le Roy-Ladurie           3.96 2070323285
##              isbn13 language_code num_pages ratings_count text_reviews_count
## 8184  9780553575101           eng       718         10608                295
## 11103 9782070323289           fre       640            15                  2
##       publication_date      publisher
## 8184              <NA>   Bantam Books
## 11103             <NA> Folio histoire

Saya memilih untuk menghilangkan dua baris missing value pada kolom publication_date karena kedua baris tersebut tampak tidak terlalu berpengaruh.

book <- book %>% filter(!is.na(publication_date))
colSums(is.na(book))
##             bookID              title            authors     average_rating 
##                  0                  0                  0                  0 
##               isbn             isbn13      language_code          num_pages 
##                  0                  0                  0                  0 
##      ratings_count text_reviews_count   publication_date          publisher 
##                  0                  0                  0                  0

Setelah menghilangkan missing value, kita juga perlu menghilangkan beberapa kolom yang tidak penting atau mempengaruhi untuk model. Dalam hal ini, kita akan menghilangkan kolom bookID, isbn, dan isbn13. Kemudian, kita juga akan melanjutkan perubahan tipe data dengan melakukan convert format dalam kolom title, num_pages, average_rating, isbn ke numerik.

str(book)
## 'data.frame':    11121 obs. of  12 variables:
##  $ bookID            : chr  "1" "2" "4" "5" ...
##  $ title             : chr  "Harry Potter and the Half-Blood Prince (Harry Potter  #6)" "Harry Potter and the Order of the Phoenix (Harry Potter  #5)" "Harry Potter and the Chamber of Secrets (Harry Potter  #2)" "Harry Potter and the Prisoner of Azkaban (Harry Potter  #3)" ...
##  $ authors           : chr  "J.K. Rowling/Mary GrandPré" "J.K. Rowling/Mary GrandPré" "J.K. Rowling" "J.K. Rowling/Mary GrandPré" ...
##  $ average_rating    : chr  "4.57" "4.49" "4.42" "4.56" ...
##  $ isbn              : chr  "0439785960" "0439358078" "0439554896" "043965548X" ...
##  $ isbn13            : chr  "9780439785969" "9780439358071" "9780439554893" "9780439655484" ...
##  $ language_code     : chr  "eng" "eng" "eng" "eng" ...
##  $ num_pages         : chr  "652" "870" "352" "435" ...
##  $ ratings_count     : int  2095690 2153167 6333 2339585 41428 19 28242 3628 249558 4930 ...
##  $ text_reviews_count: int  27591 29221 244 36325 164 1 808 254 4080 460 ...
##  $ publication_date  : Date, format: "2006-09-16" "2004-09-01" ...
##  $ publisher         : chr  "Scholastic Inc." "Scholastic Inc." "Scholastic" "Scholastic Inc." ...
book <- book %>%
  select(-c(bookID, isbn, isbn13)) %>%
  mutate(language_code = as.factor(language_code),
         average_rating = as.numeric(average_rating),
         num_pages = as.numeric(num_pages))
book %>% summary()
##     title             authors          average_rating  language_code 
##  Length:11121       Length:11121       Min.   :0.000   eng    :8907  
##  Class :character   Class :character   1st Qu.:3.770   en-US  :1408  
##  Mode  :character   Mode  :character   Median :3.960   spa    : 218  
##                                        Mean   :3.934   en-GB  : 214  
##                                        3rd Qu.:4.140   fre    : 143  
##                                        Max.   :5.000   ger    :  99  
##                                                        (Other): 132  
##    num_pages      ratings_count     text_reviews_count publication_date    
##  Min.   :   0.0   Min.   :      0   Min.   :    0.0    Min.   :1900-01-01  
##  1st Qu.: 192.0   1st Qu.:    104   1st Qu.:    9.0    1st Qu.:1998-07-17  
##  Median : 299.0   Median :    745   Median :   47.0    Median :2003-03-01  
##  Mean   : 336.3   Mean   :  17945   Mean   :  542.1    Mean   :2000-08-29  
##  3rd Qu.: 416.0   3rd Qu.:   4996   3rd Qu.:  238.0    3rd Qu.:2005-10-01  
##  Max.   :6576.0   Max.   :4597666   Max.   :94265.0    Max.   :2020-03-31  
##                                                                            
##   publisher        
##  Length:11121      
##  Class :character  
##  Mode  :character  
##                    
##                    
##                    
## 

Kemudian hal selanjutnya yang akan kita cek adalah apakah terdapat duplicate dalam data ini

sum(duplicated(book))
## [1] 0

Berdasarkan hasil di atas, tidak terdapat duplicate pada data.

head(book)
##                                                                                   title
## 1                             Harry Potter and the Half-Blood Prince (Harry Potter  #6)
## 2                          Harry Potter and the Order of the Phoenix (Harry Potter  #5)
## 3                            Harry Potter and the Chamber of Secrets (Harry Potter  #2)
## 4                           Harry Potter and the Prisoner of Azkaban (Harry Potter  #3)
## 5                                Harry Potter Boxed Set  Books 1-5 (Harry Potter  #1-5)
## 6 Unauthorized Harry Potter Book Seven News: Half-Blood Prince Analysis and Speculation
##                       authors average_rating language_code num_pages
## 1 J.K. Rowling/Mary GrandPré           4.57           eng       652
## 2 J.K. Rowling/Mary GrandPré           4.49           eng       870
## 3                J.K. Rowling           4.42           eng       352
## 4 J.K. Rowling/Mary GrandPré           4.56           eng       435
## 5 J.K. Rowling/Mary GrandPré           4.78           eng      2690
## 6      W. Frederick Zimmerman           3.74         en-US       152
##   ratings_count text_reviews_count publication_date       publisher
## 1       2095690              27591       2006-09-16 Scholastic Inc.
## 2       2153167              29221       2004-09-01 Scholastic Inc.
## 3          6333                244       2003-11-01      Scholastic
## 4       2339585              36325       2004-05-01 Scholastic Inc.
## 5         41428                164       2004-09-13      Scholastic
## 6            19                  1       2005-04-26    Nimble Books

Plotting

Distribusi Rating

book %>%
  ggplot() +
  aes(x = (average_rating)) +
  geom_histogram(bins = 50) +
  theme_minimal() +
  theme(
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank()
  )

Berdasarkan ploting distribusi rating pada data buku Goodreads, terlihat bahwa rating buku memiliki pola distribusi normal. Dapat dilihat juga bahwa rata-rata rating yang diberikan oleh pengguna Goodreads memberikan rating atau nilai buku cukup tinggi pada angka 4 dari 5 nilai. Sehingga dapat dikatakan bahwa data buku-buku yang ada memiliki nilai yang tinggi dari para pembaca atau konsumen.

Distribusi Halaman Buku

book %>%
  ggplot() +
  aes(x = (num_pages)) +
  geom_histogram(bins = 25) +
  theme_minimal() +
  theme(
    panel.grid.major.x = element_blank(),
    panel.grid.minor = element_blank()
  )

Pada plot distribusi halaman buku di atas, dapat terlihat bahwa terdapat banyak buku yang memiliki kurang dari 1000 halaman. Hal ini menunjukkan bahwa penulis sangat jarang untuk membuat buku dengan jumlah halaman yang terlalu banyak.

Buku yang paling banyak muncul di data

Dalam data ini, memungkinkan apabila terdapat judul buku yang sama sehingga kita perlu mengecek apakah terdapat judul buku yang saling bertumpang tindih atau tidak.

# judul buku
length(book$title) - length(unique(book$title))
## [1] 775

Ternyata terdapat 775 judul buku yang saling bertumpang tindih, untuk lebih jelasnya dapat dilihat dengan plot di bawah ini.

book %>%
  group_by(title) %>%
  summarise(count = n()) %>%
  arrange(desc(count)) %>%
  head(25) %>%
  ggplot(aes(
    x = reorder(title, count),
    y = count,
    fill =as.factor(count)
  )) +
  geom_col() +
  coord_flip() +
  scale_y_continuous(breaks = c(1:10)) +
  theme_minimal() +
  theme(legend.position = "none",
        axis.title = element_blank())

Pada plot di atas memperlihatkan judul buku apa yang paling banyak muncul pada data. Terlihat bahwa terdapat buku dengan judul “The Illiard” paling sering muncul 9 kali lebih banyak dibandingkan dengan buku lainnya. Hal tersebut terjadi karena terdapat banyak buku yang dibuat dengan versi yang berbeda-beda sehingga buku-buku tersebut juga memiliki kode isbn yang berbeda.

Bahasa yang paling diminati

book %>%
  group_by(language_code) %>%
  summarise(count = n()) %>%
  arrange(desc(count)) %>%
  head(10) %>%
  ggplot(aes(
    x = reorder(language_code, -count),
    y = count,
    fill =as.factor(count)
  )) +
  geom_col() +
  theme_minimal() +
  theme(legend.position = "none",
        axis.title = element_blank())

Plot di atas memperlihatkan bahasa apa yang paling diminati dalam membaca buku. Dapat dilihat bahwa peminat pembaca lebih cenderung untuk membaca buku dengan bahasa inggris sebagai bahasa universal.

Buku dengan penilaian paling banyak

book %>% 
  arrange(desc(ratings_count)) %>% 
  head(15) %>% 
    ggplot(aes(
    x = reorder(title, ratings_count),
    y = ratings_count,
    fill =as.factor(ratings_count)
  )) +
  geom_col() +
  theme_minimal() +
  theme(legend.position = "none",
        axis.title = element_blank()) +
  coord_flip()

Penulis dengan buku terbanyak

book %>% 
  group_by(authors) %>% 
  summarise(total_books = n()) %>% 
  arrange(desc(total_books)) %>% 
  head(15) %>% 
  ggplot(aes(
    x = reorder(authors, total_books),
    y = total_books,
    fill =as.factor(total_books)
  )) +
  geom_col() +
  theme_minimal() +
  theme(legend.position = "none",
        axis.title = element_blank()) +
  coord_flip()

Buku dengan review terbanyak

book %>% 
  arrange(desc(text_reviews_count)) %>% 
  head(15) %>% 
    ggplot(aes(
    x = reorder(title, text_reviews_count),
    y = text_reviews_count,
    fill =as.factor(text_reviews_count)
  )) +
  geom_col() +
  theme_minimal() +
  theme(legend.position = "none",
        axis.title = element_blank()) +
  coord_flip()

Buku dengan halaman paling banyak

book %>% 
  arrange(desc(num_pages)) %>% 
  head(7) %>% 
    ggplot(aes(
    x = reorder(title, num_pages),
    y = num_pages,
    fill =as.factor(num_pages)
  )) +
  geom_col() +
  theme_minimal() +
  theme(legend.position = "none",
        axis.title = element_blank()) +
  coord_flip()

Penerbit paling umum

book %>% 
  group_by(publisher) %>% 
  summarise(total_books = n()) %>% 
  arrange(desc(total_books)) %>% 
  head(15) %>% 
  ggplot(aes(
    x = reorder(publisher, total_books),
    y = total_books,
    fill =as.factor(total_books)
  )) +
  geom_col() +
  theme_minimal() +
  theme(legend.position = "none",
        axis.title = element_blank()) +
  coord_flip()

Buku dengan penilaian tertinggi

book %>% 
  arrange(desc(average_rating)) %>% 
  head(15)
##                                                                                                                                                                    title
## 1                                                                                                                  Comoediae 1: Acharenses/Equites/Nubes/Vespae/Pax/Aves
## 2                                                                                                                                      Willem de Kooning: Late Paintings
## 3  Literature Circle Guide: Bridge to Terabithia: Everything You Need For Successful Literature Circles That Get Kids Thinking  Talking  Writingâ\200”and Loving Literature
## 4                                                                                                                      Middlesex Borough (Images of America: New Jersey)
## 5                                                                                                             Zone of the Enders: The 2nd Runner Official Strategy Guide
## 6                                                                                                                The Diamond Color Meditation: Color Pathway to the Soul
## 7                                                                                                              Bulgakov's the Master and Margarita: The Text as a Cipher
## 8                                                                                   The Complete Theory Fun Factory: Music Theory Puzzles and Games for the Early Grades
## 9                                                                                                                     The Goon Show  Volume 4: My Knees Have Fallen Off!
## 10                                                                                                                   The Goon Show  Volume 11: He's Fallen in the Water!
## 11                                                                                                                                                   Winchester Shotguns
## 12                                                                     Colossians and Philemon: A Critical and Exegetical Commentary (International Critical Commentary)
## 13                                                                                                                                             Taxation of Mineral Rents
## 14                                                                                                                                           The New Big Book of America
## 15                                                                         Delwau Duon: Peintiadau Nicholas Evans = Symphonies in Black: The Paintings of Nicholas Evans
##                                 authors average_rating language_code num_pages
## 1   Aristophanes/F.W. Hall/W.M. Geldart              5           grc       364
## 2       Julie Sylvester/David Sylvester              5           eng        83
## 3                        Tara MacCarthy              5           eng        32
## 4  Middlesex Borough Heritage Committee              5           eng       128
## 5                            Tim Bogenn              5           eng       128
## 6                         John  Diamond              5           eng        74
## 7                       Elena N. Mahlow              5           eng       202
## 8       Ian        Martin/Katie Elliott              5           eng        96
## 9                            NOT A BOOK              5           eng         2
## 10                           NOT A BOOK              5           eng         2
## 11             Dennis Adler/R.L. Wilson              5           eng       372
## 12                       R. McL. Wilson              5           eng       512
## 13                         Ross Garnaut              5           eng       350
## 14                 Todd Davis/Marc Frey              5           eng        56
## 15      Nicholas    Evans/Rhonda  Evans              5           wel       150
##    ratings_count text_reviews_count publication_date
## 1              0                  0       1922-02-22
## 2              1                  0       2006-09-01
## 3              4                  1       2002-01-01
## 4              2                  0       2003-03-17
## 5              2                  0       2003-03-06
## 6              5                  3       2006-02-01
## 7              4                  0       1975-01-01
## 8              1                  0       2004-06-01
## 9              3                  0       1996-04-01
## 10             2                  0       1995-10-02
## 11             2                  0       2008-05-15
## 12             1                  0       2005-12-07
## 13             1                  0       1983-11-17
## 14             2                  1       2002-03-21
## 15             1                  0       1987-06-22
##                       publisher
## 1  Oxford University Press  USA
## 2                Schirmer Mosel
## 3            Teaching Resources
## 4            Arcadia Publishing
## 5                    BradyGames
## 6         Square One Publishers
## 7                 Vantage Press
## 8           Boosey & Hawkes Inc
## 9            BBC Physical Audio
## 10           BBC Physical Audio
## 11              Chartwell Books
## 12              T&T Clark Int'l
## 13 Oxford University Press  USA
## 14                Courage Books
## 15                      Y Lolfa
book %>% 
  arrange(desc(average_rating)) %>% 
  head(15) %>% 
    ggplot(aes(
    x = reorder(title, average_rating),
    y = average_rating,
    fill =as.factor(title)
  )) +
  geom_col() +
  theme_minimal() +
  theme(legend.position = "none",
        axis.title = element_blank(),
        axis.text = element_text(size = 4)) +
  coord_flip()

Buku dengan penilaian terendah

book %>%
  filter(average_rating !=0) %>% 
  arrange(desc(average_rating)) %>% 
  head(15)
##                                                                                                                                                                    title
## 1                                                                                                                  Comoediae 1: Acharenses/Equites/Nubes/Vespae/Pax/Aves
## 2                                                                                                                                      Willem de Kooning: Late Paintings
## 3  Literature Circle Guide: Bridge to Terabithia: Everything You Need For Successful Literature Circles That Get Kids Thinking  Talking  Writingâ\200”and Loving Literature
## 4                                                                                                                      Middlesex Borough (Images of America: New Jersey)
## 5                                                                                                             Zone of the Enders: The 2nd Runner Official Strategy Guide
## 6                                                                                                                The Diamond Color Meditation: Color Pathway to the Soul
## 7                                                                                                              Bulgakov's the Master and Margarita: The Text as a Cipher
## 8                                                                                   The Complete Theory Fun Factory: Music Theory Puzzles and Games for the Early Grades
## 9                                                                                                                     The Goon Show  Volume 4: My Knees Have Fallen Off!
## 10                                                                                                                   The Goon Show  Volume 11: He's Fallen in the Water!
## 11                                                                                                                                                   Winchester Shotguns
## 12                                                                     Colossians and Philemon: A Critical and Exegetical Commentary (International Critical Commentary)
## 13                                                                                                                                             Taxation of Mineral Rents
## 14                                                                                                                                           The New Big Book of America
## 15                                                                         Delwau Duon: Peintiadau Nicholas Evans = Symphonies in Black: The Paintings of Nicholas Evans
##                                 authors average_rating language_code num_pages
## 1   Aristophanes/F.W. Hall/W.M. Geldart              5           grc       364
## 2       Julie Sylvester/David Sylvester              5           eng        83
## 3                        Tara MacCarthy              5           eng        32
## 4  Middlesex Borough Heritage Committee              5           eng       128
## 5                            Tim Bogenn              5           eng       128
## 6                         John  Diamond              5           eng        74
## 7                       Elena N. Mahlow              5           eng       202
## 8       Ian        Martin/Katie Elliott              5           eng        96
## 9                            NOT A BOOK              5           eng         2
## 10                           NOT A BOOK              5           eng         2
## 11             Dennis Adler/R.L. Wilson              5           eng       372
## 12                       R. McL. Wilson              5           eng       512
## 13                         Ross Garnaut              5           eng       350
## 14                 Todd Davis/Marc Frey              5           eng        56
## 15      Nicholas    Evans/Rhonda  Evans              5           wel       150
##    ratings_count text_reviews_count publication_date
## 1              0                  0       1922-02-22
## 2              1                  0       2006-09-01
## 3              4                  1       2002-01-01
## 4              2                  0       2003-03-17
## 5              2                  0       2003-03-06
## 6              5                  3       2006-02-01
## 7              4                  0       1975-01-01
## 8              1                  0       2004-06-01
## 9              3                  0       1996-04-01
## 10             2                  0       1995-10-02
## 11             2                  0       2008-05-15
## 12             1                  0       2005-12-07
## 13             1                  0       1983-11-17
## 14             2                  1       2002-03-21
## 15             1                  0       1987-06-22
##                       publisher
## 1  Oxford University Press  USA
## 2                Schirmer Mosel
## 3            Teaching Resources
## 4            Arcadia Publishing
## 5                    BradyGames
## 6         Square One Publishers
## 7                 Vantage Press
## 8           Boosey & Hawkes Inc
## 9            BBC Physical Audio
## 10           BBC Physical Audio
## 11              Chartwell Books
## 12              T&T Clark Int'l
## 13 Oxford University Press  USA
## 14                Courage Books
## 15                      Y Lolfa
book %>%
  filter(average_rating !=0) %>% 
  arrange(desc(average_rating)) %>% 
  head(15) %>% 
    ggplot(aes(
    x = reorder(title, 
                average_rating),
    y = average_rating,
    fill =(average_rating)
  )) +
  geom_col() +
  theme_minimal() +
  theme(legend.position = "none",
        axis.title = element_blank()) +
  coord_flip()

Korelasi Rating vs Reviews

book %>%
  ggplot(aes(x = ratings_count,
             y = text_reviews_count)) +
  geom_point() +
  geom_smooth(formula = y ~ x,
              method = lm) +
  theme_minimal()

Korelasi dengan rata-rata Rating vs rata-rata Reviews

book %>%
  ggplot(aes(y = average_rating,
             x = text_reviews_count)) +
  geom_point() +
  geom_smooth(formula = y ~ x,
              method = lm) +
  theme_minimal()

Rata-rata Rating vs Rating

book %>%
  ggplot(aes(y = average_rating,
             x = ratings_count)) +
  geom_point() +
  geom_smooth(formula = y ~ x,
              method = lm) +
  theme_minimal()

Rata-rata Rating vs Halaman

book %>%
  ggplot(aes(y = average_rating,
             x = num_pages)) +
  geom_point() +
  geom_smooth(formula = y ~ x,
              method = lm) +
  theme_minimal()

Korelasi antara data numerik

book %>%
  select(ratings_count,
         text_reviews_count,
         num_pages,
         average_rating) %>%
  filter(ratings_count > 0,
         text_reviews_count > 0,
         num_pages > 0,
    average_rating > 0) %>%
  cor() %>%
  corrplot(
type = "lower",
order = "hclust",
method = "color",
addgrid.col = "darkgray",
 outline = T,
 tl.cex = 1,
 tl.col = "black"
)