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
3
votes
1 answer

How to use multinomial function in C with Rmath.h

I'm trying to draw a random sample from 1,2,3,4 under a given probability vector of length four in C, with the help of Rmath.h. I found this line of code could do this for me. inline void rmultinom(int n, double* prob, int k, int* rn) For example, I…
Ashley
  • 67
  • 1
  • 7
3
votes
1 answer

Multinomial regression (different results -- same dataset, R vs SPSS). nnet package -- multinom function

Recently, I had to work with R and SPSS to analyze a dataset with Multinomial Regression framework. We surveyed some participants (10-12 years old) and we asked which "professional field" they like the most, then we asked how often they accessed the…
Luis
  • 1,388
  • 10
  • 30
3
votes
1 answer

difference between coef_ and feature_log_prob_ in multinomial naive bayes?

The below code represnets sklearn multinomial naive bayes. import numpy as np from sklearn.naive_bayes import MultinomialNB X = np.random.randint(5, size=(10, 100)) y=np.random.randint(2,size=(10,)) clf = MultinomialNB() clf.fit(X, y) Then I want…
user10360186
3
votes
1 answer

Error in H2O h2o.stackedEnsemble: "Don't know how to determine the distribution for a multinomial classifier"

I am trying to build a stacked ensemble using H2O in R. It has five base learners - Random Forest, XGBoost, GLM, GBM and Naive Bayes. It is a classification problem with three levels. The base learners ran successfully and returned accuracy values…
AshwiniJ
  • 51
  • 1
  • 5
3
votes
1 answer

multinominal regression with imputed data

I need to impute missing data and then coduct multinomial regression with the generated datasets. I have tried using mice for the imputing and then multinom function from nnet for the multnomial regression. But this gives me unreadable output. …
Branners
  • 63
  • 1
  • 9
3
votes
2 answers

Sum of dice rolls

I am trying to compute the probability of getting a specific sum from n rolls of s-sided dice. I found the formula in this link (formula 10). This is the code that I wrote in C: # include # include # include # define…
Rami Zouari
  • 109
  • 1
  • 9
3
votes
1 answer

sklearn NB classifier: How to get the actual probabilities of individual samples?

I am making a machine learning program which classifies words in one of the following categories: Hardware, Software, None_of_these. I make use of the Multinomial Naive Bayes classifier from sklearn. The function predict() gives me the prediction of…
user3656099
  • 155
  • 1
  • 11
3
votes
1 answer

something similar to permutation accuracy importance in h2o package

I fitted a random forest for my multinomial target with the randomForest package in R. Looking for the variable importance I found out permutation accuracy importance which is what I was looking for my analysis. I fitted a random forest with the h2o…
nicola
  • 83
  • 7
3
votes
0 answers

Plotting VGLM multinomial logistic regression with 95% CIs

I would like to plot the predicted values of a multinomial logistic regression derived from the vglm() function in the VGAM package. It is important that I use VGAM because I am trying to replicate a colleague's analysis conducted in Stata, which I…
Calen
  • 305
  • 4
  • 17
3
votes
0 answers

Multinomial Naive Bayes Classifier sliding window (MOA implementation, weka)

I am facing the following problem: I am trying to implement a MNB classifier in a sliding window. I implemented a LinkedList of the size of the window and store all instances of the stream which have to be considered in it. When a new instance…
3
votes
2 answers

How to solve mlogit marginal effects error?

After successfully running the mlogit model in R, I get an error trying to obtain marginal effects that says: "Error in predict.mlogit(object, data) : the number of rows of the data.frame should be a multiple of the number of alternatives" I have…
Ed.
  • 31
  • 4
3
votes
1 answer

R multiclass/multinomial classification ROC using multiclass.roc (Package ‘pROC’)

I am having difficulties understanding how the multiclass.roc parameters should look like. Here a snapshot of my data: > head(testing.logist$cut.rank) [1] 3 3 3 3 1 3 Levels: 1 2 3 > head(mnm.predict.test.probs) 1 2 …
user3628777
  • 529
  • 3
  • 10
  • 20
3
votes
0 answers

Coefficients from multinomial logistic regression in sklearn

I'm running sklearn.linear_model.LogisticRegression on a multi-class problem. From what I understand, the output of the coef_ attribute are the coefficients for each feature for each class. What I don't understand is the interpretation in sklearn.…
arikuja
  • 31
  • 2
3
votes
4 answers

Efficient Matlab implementation of Multinomial Coefficient

I want to calculate the multinomial coefficient: where it is satisifed n=n0+n1+n2 The Matlab implementation of this operator can be easily done in the function: function N = nchooseks(k1,k2,k3) N =…
tashuhka
  • 5,028
  • 4
  • 45
  • 64
3
votes
1 answer

Multinom with Matrix of Counts as Response

According to the help of multinom, package nnet, "The response should be a factor or a matrix with K columns, which will be interpreted as counts for each of K classes." I tried to use this function in the second case, obtaining an error. Here is a…
Pippo
  • 1,543
  • 3
  • 21
  • 40