Questions tagged [multinomial]

The multinomial distribution provides a probability distribution over three or more possible outcomes. It generalizes the more fundamental binomial distribution (two outcomes).

In probability theory, the multinomial distribution generalizes the binomial distribution to three or more outcomes.

Suppose two chess players had played numerous games, from which we estimate that Player A would win with probability 0.40, Player B would win with probability 0.35, and the probability that the game ends in a draw is 0.25. The multinomial distribution can be used to answer questions like:

  1. If these two chess players played 12 games, what is the expected number of wins, losses, and draws for player A?
  2. If these two chess players play 3 games, what is the probability that A wins one, B, wins one, and they draw on the other?

Binary classification/prediction methods (such as logistic regression) can also be generalized for multinomial outcomes (i.e., three or more class labels). Multinomial logistic regression is also sometimes called a maximum entropy (MaxEnt) model.

421 questions
0
votes
0 answers

Multinomial Logistic regression Predict in R

I am using multinom function from nnet package for multinomial logistic regression. My dataset has 3 features and 14 different classes with total of 1000 observations. Classes that I have is: 0,1,2,3,4,5,6,7,8,9,10,11,13,15 I divide data set into…
PRITI
  • 29
  • 5
0
votes
1 answer

Propensity score for a multinomial treatment to be used in a propensity score adjusted glm

I have never used propensity scores for mulitnomial variables, and so I am unfamiliar with how the predicted probabilities are handled. I have a factor variable for treatment with 5 categories and I calculated a propensity score using…
Statistix
  • 83
  • 5
0
votes
0 answers

How to convert a multinomial logistics Predicted values into expected values?

I have a continuous variable which I divide in 3 class. Now I have run the multinomial logistics model to predict the occurrence of any particular class. My question is can I convert the predicted probabilities of multinomial logistics model to…
0
votes
0 answers

multinominal regression model on continuous output

I used a multinomial logistic regression on a csv file (3400 records) and the continuous independent variables has too many different variables (2500). When I run the multinominal regression model it takes too much time and then failed to result. I…
Emma
  • 1
0
votes
2 answers

How to get the probability of each possible outcome for a multinomial case?

Using stats.binom.pmf(np.arange(0,11),10,0.5), I can get an array of numbers representing the probability of an event happening n times(0 to 10) in 10 times given the probability of a single occurrence 0.5, like below: array([0.00097656, 0.00976563,…
0
votes
0 answers

Calculating all possible outcomes for Multinom in R

In stats::Multinomial, there is an example of calculating all possible outcomes for Multinom(N=3, K=3): X <- t(as.matrix(expand.grid(0:3, 0:3))); X <- X[, colSums(X) <= 3] X <- rbind(X, 3:3 - colSums(X)); dimnames(X) <- list(letters[1:3],…
0
votes
2 answers

How to recover non-zero coefficients from glmnet multinomial?

Working example from https://glmnet.stanford.edu/articles/glmnet.html#multinomial-regression-family-multinomial-: data(MultinomialExample) x <- MultinomialExample$x y <- MultinomialExample$y cvfit <- cv.glmnet(x, y, family = "multinomial") cvfit…
user328349
  • 11
  • 2
0
votes
1 answer

Changing glmnet from binomial to multinomial gives error

I'm trying to adapt code for a binomial glmnet to make it work for a multinomial problem, but for some reason I keep getting an error code. Here's the original code for the binomial model that works perfectly: traininglasso <- stratified(sp_lasso,…
pfadenhw
  • 119
  • 6
0
votes
1 answer

Wrong formula specification in mformula/mlogit? Error in str2lang(x) : :2:0: unexpected end of input

I'm trying to use the mlogit package in R in order to make a choice model on a panel dataset. For this, I have successfully specified the data in mlogit.data form. The y variable consists of TRUE / FALSE indicating the choice, the service variable…
0
votes
0 answers

IndexError: index -1 is out of bounds for axis 0 with size 0

I get an index -1 is out of bounds for axis 0 with size 0 error from scipy when trying to implement a text generator with ngrams. Traceback (most recent call last): File "C:\Users\hp\PycharmProjects\N-gram poems\trigram_model.py", line 125, in…
Luci
  • 1
  • 1
0
votes
1 answer

Multinomial Logit Fixed Effects: Stata and R

I am trying to run a multinomial logit with year fixed effects in mlogit in Stata (panel data: year-country), but I do not get standard errors for some of the models. When I run the same model using multinom in R I get both coefficients and standard…
Emily
  • 1
  • 3
0
votes
0 answers

AxisError: axis 1 is out of bounds for array of dimension 1 on ROC AUC

I'm trying to split the data set using the stratified k-fold and multinomial logistic regression but I got the mentioned error when I use this code: i=1 for train_set,test_set in skf.split(x,y): print('{} of SKFold…
0
votes
1 answer

How to make naive bayes multinomial with TF-idf from scratch in python?

I know there is a library in python from sklearn.naive_bayes import MultinomialNB but I want to know how to create one from scratch without using libraries like TfIdfVectorizer and MultinomialNB?
fik
  • 1
  • 1
0
votes
1 answer

VIF No intercept: vifs may not be sensible

I am trying to test that the assumption of my Multinomial Logistic Regression model holds or fails. Multinomial Logistic Regression model is a model which could be created and compared, although it has this assumption: Multinomial logistic…
Lyra Orwell
  • 1,048
  • 4
  • 17
  • 46
0
votes
1 answer

MultinomialNB fails with "ValueError: shapes not aligned" during prediction phase

I am trying to do a MultinomialNB(). I have a csv, that I read into a dataframe (data) and did some tokenizing and lemmatization on the data in order to have the most used words. The code for the model is this: max_features = 5000 count_vectorizer =…