Skip to content

Issues in chapter 3 #24

@mdoumbouya

Description

@mdoumbouya
  • Typo like should be liked

item appeal is how easy it is for the item to be like by the population of users.

  • Eq 5 description. This should say if item j is preferred (i is the subject)

is one if the item i is preferred

  • Typo generate should be generating

The code below is for generate a response matrix for Rasch response:

  • In the code example for the Rasch model, I don't think I understand the reason for the following lines of code. This might confuse students. Perhaps the following flow will make things more digestible:
Y = Y[np.argsort(Y.mean(axis=1))][:, np.argsort(Y.mean(axis=0))]

We first just plot P (the output of the Rasch model (probability of subject i liking item j) for randomly samples subjects and items.

plt.imshow(P, cmap='coolwarm')
Image

In this plot, we could observe that
- user#4 has a very small appetite, the probability of them liking anything ends up being very small
- user#5 has a very big appetite, the probability of them liking anything ends up being very high
- item#10 is not appetizing. The probability of anyone liking this item is low
- item#0 is very appetizing. The probability of anyone liking this item is high

To simulate a user preference matrix, we sample from the obtained probabilities (assuming that they represent the parameter of a Bernoulli distribution) to obtain binary preference indicators

sampled_choices = (rng.random(size=(N, M)) < P)
plt.imshow(sampled_choices, cmap='coolwarm')
Image

This choice matrix can finally be sorted if necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions