Bernoulli-blandningsmodeller med flexmix

Blandningsmodeller i R

Victor Medina

Researcher at The University of Edinburgh

Problemet

Blandningsmodeller i R

Datamängden

digits_sample <- as.matrix(digits)
dim(digits_sample)
320 256
show_digit(digits_sample[320,])

Blandningsmodeller i R

Anpassa Bernoulli-blandningsmodeller

bernoulli_mix_model <- flexmix(digits_sample~1,
              k=2,
              model=FLXMCmvbinary(),
              control = list(tolerance = 1e-15, iter.max = 1000))
  • digits_sample är en matris
  • FLXMCmvbinary() anger Bernoulli-fördelningen
Blandningsmodeller i R

Andelarna

prior(bernoulli_mix_model)
0.503125 0.496875
Blandningsmodeller i R

Funktionen parameters()

param_comp1 <- parameters(bernoulli_mix_model, component = 1)
param_comp2 <- parameters(bernoulli_mix_model, component = 2)
dim(param_comp1)
256   1
head(param_comp1, 4)
             Comp.1
center.V1 0.3291926
center.V2 0.5093168
center.V3 0.6645963
center.V4 0.7639751
Blandningsmodeller i R

Visualisera komponent 1

show_digit(param_comp1)

Blandningsmodeller i R

Visualisera komponent 2

show_digit(param_comp2)

Blandningsmodeller i R

Nu kör vi en övning!

Blandningsmodeller i R

Preparing Video For Download...