Técnica 6. Método estadístico
# Gráfica de caja y bigotes
bd12 <- bd7
boxplot(bd12$Precio, horizontal = TRUE)

boxplot(bd12$Unidades, horizontal = TRUE)

# Agregar columnas
library(lubridate)
bd12$Dia_de_la_semana <- wday(bd12$Fecha)
summary(bd12)
## vcClaveTienda DescGiro Codigo Barras Fecha
## Length:200620 Length:200620 Min. :8.347e+05 Min. :2020-05-01
## Class :character Class :character 1st Qu.:7.501e+12 1st Qu.:2020-06-06
## Mode :character Mode :character Median :7.501e+12 Median :2020-07-11
## Mean :5.950e+12 Mean :2020-07-18
## 3rd Qu.:7.501e+12 3rd Qu.:2020-08-29
## Max. :1.750e+13 Max. :2020-11-11
## Hora Marca Fabricante Producto
## Min. :18 Length:200620 Length:200620 Length:200620
## 1st Qu.:18 Class :character Class :character Class :character
## Median :18 Mode :character Mode :character Mode :character
## Mean :18
## 3rd Qu.:18
## Max. :18
## Precio Ult.Costo Unidades F.Ticket
## Min. : 0.50 Min. : 0.38 Min. : 1.000 Min. : 1
## 1st Qu.: 11.00 1st Qu.: 8.46 1st Qu.: 1.000 1st Qu.: 33967
## Median : 16.00 Median : 12.31 Median : 1.000 Median :105996
## Mean : 19.45 Mean : 15.31 Mean : 1.262 Mean :193994
## 3rd Qu.: 25.00 3rd Qu.: 19.23 3rd Qu.: 1.000 3rd Qu.:383009
## Max. :1000.00 Max. :769.23 Max. :96.000 Max. :450040
## NombreDepartamento NombreFamilia NombreCategoria Estado
## Length:200620 Length:200620 Length:200620 Length:200620
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Mts 2 Tipo ubicación Giro
## Min. :47.0 Length:200620 Length:200620
## 1st Qu.:53.0 Class :character Class :character
## Median :60.0 Mode :character Mode :character
## Mean :56.6
## 3rd Qu.:60.0
## Max. :62.0
## Hora inicio Hora cierre
## Min. :1899-12-31 07:00:00.00 Min. :1899-12-31 21:00:00.00
## 1st Qu.:1899-12-31 07:00:00.00 1st Qu.:1899-12-31 22:00:00.00
## Median :1899-12-31 08:00:00.00 Median :1899-12-31 22:00:00.00
## Mean :1899-12-31 07:35:49.71 Mean :1899-12-31 22:23:11.42
## 3rd Qu.:1899-12-31 08:00:00.00 3rd Qu.:1899-12-31 23:00:00.00
## Max. :1899-12-31 09:00:00.00 Max. :1899-12-31 23:00:00.00
## Dia_de_la_semana
## Min. :1.000
## 1st Qu.:2.000
## Median :4.000
## Mean :3.912
## 3rd Qu.:6.000
## Max. :7.000
bd12$Subtotal <- bd12$Precio * bd12$Unidades
summary(bd12)
## vcClaveTienda DescGiro Codigo Barras Fecha
## Length:200620 Length:200620 Min. :8.347e+05 Min. :2020-05-01
## Class :character Class :character 1st Qu.:7.501e+12 1st Qu.:2020-06-06
## Mode :character Mode :character Median :7.501e+12 Median :2020-07-11
## Mean :5.950e+12 Mean :2020-07-18
## 3rd Qu.:7.501e+12 3rd Qu.:2020-08-29
## Max. :1.750e+13 Max. :2020-11-11
## Hora Marca Fabricante Producto
## Min. :18 Length:200620 Length:200620 Length:200620
## 1st Qu.:18 Class :character Class :character Class :character
## Median :18 Mode :character Mode :character Mode :character
## Mean :18
## 3rd Qu.:18
## Max. :18
## Precio Ult.Costo Unidades F.Ticket
## Min. : 0.50 Min. : 0.38 Min. : 1.000 Min. : 1
## 1st Qu.: 11.00 1st Qu.: 8.46 1st Qu.: 1.000 1st Qu.: 33967
## Median : 16.00 Median : 12.31 Median : 1.000 Median :105996
## Mean : 19.45 Mean : 15.31 Mean : 1.262 Mean :193994
## 3rd Qu.: 25.00 3rd Qu.: 19.23 3rd Qu.: 1.000 3rd Qu.:383009
## Max. :1000.00 Max. :769.23 Max. :96.000 Max. :450040
## NombreDepartamento NombreFamilia NombreCategoria Estado
## Length:200620 Length:200620 Length:200620 Length:200620
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Mts 2 Tipo ubicación Giro
## Min. :47.0 Length:200620 Length:200620
## 1st Qu.:53.0 Class :character Class :character
## Median :60.0 Mode :character Mode :character
## Mean :56.6
## 3rd Qu.:60.0
## Max. :62.0
## Hora inicio Hora cierre
## Min. :1899-12-31 07:00:00.00 Min. :1899-12-31 21:00:00.00
## 1st Qu.:1899-12-31 07:00:00.00 1st Qu.:1899-12-31 22:00:00.00
## Median :1899-12-31 08:00:00.00 Median :1899-12-31 22:00:00.00
## Mean :1899-12-31 07:35:49.71 Mean :1899-12-31 22:23:11.42
## 3rd Qu.:1899-12-31 08:00:00.00 3rd Qu.:1899-12-31 23:00:00.00
## Max. :1899-12-31 09:00:00.00 Max. :1899-12-31 23:00:00.00
## Dia_de_la_semana Subtotal
## Min. :1.000 Min. : 1.00
## 1st Qu.:2.000 1st Qu.: 12.00
## Median :4.000 Median : 18.00
## Mean :3.912 Mean : 24.33
## 3rd Qu.:6.000 3rd Qu.: 27.00
## Max. :7.000 Max. :2496.00
bd12$Utilidad <- bd12$Precio - bd12$Ult.Costo
summary(bd12)
## vcClaveTienda DescGiro Codigo Barras Fecha
## Length:200620 Length:200620 Min. :8.347e+05 Min. :2020-05-01
## Class :character Class :character 1st Qu.:7.501e+12 1st Qu.:2020-06-06
## Mode :character Mode :character Median :7.501e+12 Median :2020-07-11
## Mean :5.950e+12 Mean :2020-07-18
## 3rd Qu.:7.501e+12 3rd Qu.:2020-08-29
## Max. :1.750e+13 Max. :2020-11-11
## Hora Marca Fabricante Producto
## Min. :18 Length:200620 Length:200620 Length:200620
## 1st Qu.:18 Class :character Class :character Class :character
## Median :18 Mode :character Mode :character Mode :character
## Mean :18
## 3rd Qu.:18
## Max. :18
## Precio Ult.Costo Unidades F.Ticket
## Min. : 0.50 Min. : 0.38 Min. : 1.000 Min. : 1
## 1st Qu.: 11.00 1st Qu.: 8.46 1st Qu.: 1.000 1st Qu.: 33967
## Median : 16.00 Median : 12.31 Median : 1.000 Median :105996
## Mean : 19.45 Mean : 15.31 Mean : 1.262 Mean :193994
## 3rd Qu.: 25.00 3rd Qu.: 19.23 3rd Qu.: 1.000 3rd Qu.:383009
## Max. :1000.00 Max. :769.23 Max. :96.000 Max. :450040
## NombreDepartamento NombreFamilia NombreCategoria Estado
## Length:200620 Length:200620 Length:200620 Length:200620
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Mts 2 Tipo ubicación Giro
## Min. :47.0 Length:200620 Length:200620
## 1st Qu.:53.0 Class :character Class :character
## Median :60.0 Mode :character Mode :character
## Mean :56.6
## 3rd Qu.:60.0
## Max. :62.0
## Hora inicio Hora cierre
## Min. :1899-12-31 07:00:00.00 Min. :1899-12-31 21:00:00.00
## 1st Qu.:1899-12-31 07:00:00.00 1st Qu.:1899-12-31 22:00:00.00
## Median :1899-12-31 08:00:00.00 Median :1899-12-31 22:00:00.00
## Mean :1899-12-31 07:35:49.71 Mean :1899-12-31 22:23:11.42
## 3rd Qu.:1899-12-31 08:00:00.00 3rd Qu.:1899-12-31 23:00:00.00
## Max. :1899-12-31 09:00:00.00 Max. :1899-12-31 23:00:00.00
## Dia_de_la_semana Subtotal Utilidad
## Min. :1.000 Min. : 1.00 Min. : 0.000
## 1st Qu.:2.000 1st Qu.: 12.00 1st Qu.: 2.310
## Median :4.000 Median : 18.00 Median : 3.230
## Mean :3.912 Mean : 24.33 Mean : 4.142
## 3rd Qu.:6.000 3rd Qu.: 27.00 3rd Qu.: 5.420
## Max. :7.000 Max. :2496.00 Max. :230.770
# Exportar la base de datos limpia
bd_limpia <- bd12
write.csv(bd_limpia, file="abarrotes_bd_limpia.csv", row.names = FALSE)
# Market basket analysis
library(plyr)
## ------------------------------------------------------------------------------
## You have loaded plyr after dplyr - this is likely to cause problems.
## If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
## library(plyr); library(dplyr)
## ------------------------------------------------------------------------------
##
## Attaching package: 'plyr'
## The following object is masked from 'package:purrr':
##
## compact
## The following objects are masked from 'package:dplyr':
##
## arrange, count, desc, failwith, id, mutate, rename, summarise,
## summarize
library(Matrix)
##
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
##
## expand, pack, unpack
library(arules)
##
## Attaching package: 'arules'
## The following object is masked from 'package:dplyr':
##
## recode
## The following objects are masked from 'package:base':
##
## abbreviate, write
library(arulesViz)
library(datasets)
# Ordenar de menor a mayor los tickets
bd_limpia <- bd_limpia[order(bd_limpia$F.Ticket),]
head(bd_limpia)
## # A tibble: 6 × 24
## vcClaveTienda DescGiro `Codigo Barras` Fecha Hora Marca Fabricante
## <chr> <chr> <dbl> <date> <int> <chr> <chr>
## 1 MX001 Abarrotes 7501020540666 2020-06-19 18 NUTRI LEC… MEXILAC
## 2 MX001 Abarrotes 7501032397906 2020-06-19 18 DAN UP DANONE DE…
## 3 MX001 Abarrotes 7501000112845 2020-06-19 18 BIMBO GRUPO BIM…
## 4 MX001 Abarrotes 7501031302741 2020-06-19 18 PEPSI PEPSI-COL…
## 5 MX001 Abarrotes 7501026027543 2020-06-19 18 BLANCA NI… FABRICA D…
## 6 MX001 Abarrotes 7501025433024 2020-06-19 18 FLASH ALEN
## # ℹ 17 more variables: Producto <chr>, Precio <dbl>, Ult.Costo <dbl>,
## # Unidades <dbl>, F.Ticket <dbl>, NombreDepartamento <chr>,
## # NombreFamilia <chr>, NombreCategoria <chr>, Estado <chr>, `Mts 2` <dbl>,
## # `Tipo ubicación` <chr>, Giro <chr>, `Hora inicio` <dttm>,
## # `Hora cierre` <dttm>, Dia_de_la_semana <dbl>, Subtotal <dbl>,
## # Utilidad <dbl>
tail(bd_limpia)
## # A tibble: 6 × 24
## vcClaveTienda DescGiro `Codigo Barras` Fecha Hora Marca Fabricante
## <chr> <chr> <dbl> <date> <int> <chr> <chr>
## 1 MX004 Carnicería 10248765241 2020-10-15 18 YEMINA HERDEZ
## 2 MX004 Carnicería 7501079702855 2020-10-15 18 DEL FUER… ALIMENTOS…
## 3 MX004 Carnicería 7501055320639 2020-10-15 18 COCA COL… COCA COLA
## 4 MX004 Carnicería 7501214100256 2020-10-15 18 DIAMANTE EMPACADOS
## 5 MX004 Carnicería 7501031311620 2020-10-15 18 PEPSI PEPSI-COL…
## 6 MX004 Carnicería 75004699 2020-10-15 18 COCA COLA COCA COLA
## # ℹ 17 more variables: Producto <chr>, Precio <dbl>, Ult.Costo <dbl>,
## # Unidades <dbl>, F.Ticket <dbl>, NombreDepartamento <chr>,
## # NombreFamilia <chr>, NombreCategoria <chr>, Estado <chr>, `Mts 2` <dbl>,
## # `Tipo ubicación` <chr>, Giro <chr>, `Hora inicio` <dttm>,
## # `Hora cierre` <dttm>, Dia_de_la_semana <dbl>, Subtotal <dbl>,
## # Utilidad <dbl>
# Generar basket
basket <- ddply(bd_limpia, c("F.Ticket"), function(bd_limpia)paste(bd_limpia$Marca, collapse = ","))
# Eliminar número de ticket
basket$F.Ticket <- NULL
# Renombrar el nombre de la columna
colnames(basket) <- c("Marca")
# Exportar basket
write.csv(basket, "basket.csv", quote = FALSE, row.names = FALSE)
library(arules)
library(arulesViz)
# Importar transacciones
tr <- read.transactions( "C:\\Users\\Asus ZenBook\\Documents\\basket.csv", format = "basket", sep = ",")
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in scan(text = l, what = "character", sep = sep, quote = quote, : EOF
## within quoted string
## Warning in asMethod(object): removing duplicated items in transactions
# Generar reglas de asociación
reglas.asociacion <- apriori(tr,parameter = list(supp=0.001, conf=0.2, maxlen=10))
## Apriori
##
## Parameter specification:
## confidence minval smax arem aval originalSupport maxtime support minlen
## 0.2 0.1 1 none FALSE TRUE 5 0.001 1
## maxlen target ext
## 10 rules TRUE
##
## Algorithmic control:
## filter tree heap memopt load sort verbose
## 0.1 TRUE TRUE FALSE TRUE 2 TRUE
##
## Absolute minimum support count: 115
##
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[604 item(s), 115111 transaction(s)] done [0.02s].
## sorting and recoding items ... [207 item(s)] done [0.00s].
## creating transaction tree ... done [0.02s].
## checking subsets of size 1 2 3 done [0.00s].
## writing ... [11 rule(s)] done [0.00s].
## creating S4 object ... done [0.00s].
summary(reglas.asociacion)
## set of 11 rules
##
## rule length distribution (lhs + rhs):sizes
## 2
## 11
##
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2 2 2 2 2 2
##
## summary of quality measures:
## support confidence coverage lift
## Min. :0.001016 Min. :0.2069 Min. :0.003562 Min. : 1.325
## 1st Qu.:0.001103 1st Qu.:0.2356 1st Qu.:0.004504 1st Qu.: 1.787
## Median :0.001416 Median :0.2442 Median :0.005803 Median : 3.972
## Mean :0.001519 Mean :0.2536 Mean :0.006054 Mean :17.563
## 3rd Qu.:0.001651 3rd Qu.:0.2685 3rd Qu.:0.006893 3rd Qu.:21.798
## Max. :0.002745 Max. :0.3098 Max. :0.010503 Max. :65.908
## count
## Min. :117.0
## 1st Qu.:127.0
## Median :163.0
## Mean :174.9
## 3rd Qu.:190.0
## Max. :316.0
##
## mining info:
## data ntransactions support confidence
## tr 115111 0.001 0.2
## call
## apriori(data = tr, parameter = list(supp = 0.001, conf = 0.2, maxlen = 10))
inspect(reglas.asociacion)
## lhs rhs support confidence coverage
## [1] {FANTA} => {COCA COLA} 0.001051159 0.2439516 0.004308884
## [2] {SALVO} => {FABULOSO} 0.001103283 0.3097561 0.003561779
## [3] {FABULOSO} => {SALVO} 0.001103283 0.2347505 0.004699811
## [4] {COCA COLA ZERO} => {COCA COLA} 0.001416025 0.2969035 0.004769310
## [5] {SPRITE} => {COCA COLA} 0.001346526 0.2069426 0.006506763
## [6] {PINOL} => {CLORALEX} 0.001016410 0.2363636 0.004300197
## [7] {BLUE HOUSE} => {BIMBO} 0.001711392 0.2720994 0.006289581
## [8] {HELLMANN´S} => {BIMBO} 0.001537646 0.2649701 0.005803094
## [9] {REYMA} => {CONVERMEX} 0.002093631 0.2441743 0.008574333
## [10] {FUD} => {BIMBO} 0.001589770 0.2183771 0.007279930
## [11] {COCA COLA LIGHT} => {COCA COLA} 0.002745176 0.2613730 0.010502906
## lift count
## [1] 1.561906 121
## [2] 65.908196 127
## [3] 65.908196 127
## [4] 1.900932 163
## [5] 1.324955 155
## [6] 25.030409 117
## [7] 4.078870 197
## [8] 3.971997 177
## [9] 18.564824 241
## [10] 3.273552 183
## [11] 1.673447 316
# Ordenar reglas de asociación
reglas.asociacion <- sort(reglas.asociacion, by = "confidence", decreasing = TRUE)
summary(reglas.asociacion)
## set of 11 rules
##
## rule length distribution (lhs + rhs):sizes
## 2
## 11
##
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2 2 2 2 2 2
##
## summary of quality measures:
## support confidence coverage lift
## Min. :0.001016 Min. :0.2069 Min. :0.003562 Min. : 1.325
## 1st Qu.:0.001103 1st Qu.:0.2356 1st Qu.:0.004504 1st Qu.: 1.787
## Median :0.001416 Median :0.2442 Median :0.005803 Median : 3.972
## Mean :0.001519 Mean :0.2536 Mean :0.006054 Mean :17.563
## 3rd Qu.:0.001651 3rd Qu.:0.2685 3rd Qu.:0.006893 3rd Qu.:21.798
## Max. :0.002745 Max. :0.3098 Max. :0.010503 Max. :65.908
## count
## Min. :117.0
## 1st Qu.:127.0
## Median :163.0
## Mean :174.9
## 3rd Qu.:190.0
## Max. :316.0
##
## mining info:
## data ntransactions support confidence
## tr 115111 0.001 0.2
## call
## apriori(data = tr, parameter = list(supp = 0.001, conf = 0.2, maxlen = 10))
inspect(reglas.asociacion)
## lhs rhs support confidence coverage
## [1] {SALVO} => {FABULOSO} 0.001103283 0.3097561 0.003561779
## [2] {COCA COLA ZERO} => {COCA COLA} 0.001416025 0.2969035 0.004769310
## [3] {BLUE HOUSE} => {BIMBO} 0.001711392 0.2720994 0.006289581
## [4] {HELLMANN´S} => {BIMBO} 0.001537646 0.2649701 0.005803094
## [5] {COCA COLA LIGHT} => {COCA COLA} 0.002745176 0.2613730 0.010502906
## [6] {REYMA} => {CONVERMEX} 0.002093631 0.2441743 0.008574333
## [7] {FANTA} => {COCA COLA} 0.001051159 0.2439516 0.004308884
## [8] {PINOL} => {CLORALEX} 0.001016410 0.2363636 0.004300197
## [9] {FABULOSO} => {SALVO} 0.001103283 0.2347505 0.004699811
## [10] {FUD} => {BIMBO} 0.001589770 0.2183771 0.007279930
## [11] {SPRITE} => {COCA COLA} 0.001346526 0.2069426 0.006506763
## lift count
## [1] 65.908196 127
## [2] 1.900932 163
## [3] 4.078870 197
## [4] 3.971997 177
## [5] 1.673447 316
## [6] 18.564824 241
## [7] 1.561906 121
## [8] 25.030409 117
## [9] 65.908196 127
## [10] 3.273552 183
## [11] 1.324955 155
# Visualizar reglas de asociación
top10reglas <- head(reglas.asociacion, n=10, by= "confidence")
plot(top10reglas, method = "graph", engine = "htmlwidget")
LS0tDQp0aXRsZTogIkFjdGl2aWRhZCAyLjEgRGFuaWVsYSBHYXJ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