bayesian

Ranking Contest Results of Images with 5-Star Ratings

老子叫甜甜 提交于 2020-01-23 09:29:07
问题 I run a calendar photo contest that uses a 5-star rating system which ranks the images according to their average rating. However, I would like to factor in the total number of votes a photo receives to get a more accurate ranking. For example, I do not want an image with 1 5-star vote (Avg rating: 5) getting ranked above an image with 10 5-star votes and 1 4-star vote (Avg rating: 4.9). I know this topic has been raised before, but I can't seem to find a straightforward answer to apply to my

Error in bn.fit predict function in bnlear R

情到浓时终转凉″ 提交于 2020-01-15 12:16:05
问题 I have learned and fitted Bayesian Network in bnlearn R package and I wish to predict it's "event" node value. fl="data/discrete_kdd_10.txt" h=TRUE dtbl1 = read.csv(file=fl, head=h, sep=",") net=hc(dtbl1) fitted=bn.fit(net,dtbl1) I want to predict the value of "event" node based on the evidence stored in another file with the same structure as the file used for learning. fileName="data/dcmp.txt" dtbl2 = read.csv(file=fileName, head=h, sep=",") predict(fitted,"event",dtbl2) However, predict

How to interpret the output of choicemodelr (rhierMnlRwMixture) in R

送分小仙女□ 提交于 2020-01-14 01:58:06
问题 My Problem I just started using the R library 'choicemodelr' and succeded in getting some beta values as a solution. But I wonder how do I assign these values to the specific attribute-levels. As a result I only get values for A1B1, A1B2, A1B3,... etc. How does this generic output generally connect to my Design? Didn't find a hint in the documentation. Neither for the choicemodelr libraray, nor the bayesm library (rhierMnlRwMixture) to which it is connected to. I hope you can help me with

JAGS: unit-specific time trends

十年热恋 提交于 2020-01-06 14:59:43
问题 Using JAGS I am trying to estimate a model including a unit-specific time trend. However, the problem is that I don't know how to model this and so far I have been unable to find a solution. As an example, consider we have the following data: rain<-rnorm(200) # Explanatory variable n1<-rnorm(200) # Some noise gdp<-rain+n1 # Outcome variable ccode<-rep(1:10,20) # Unit codes year<-rep(1:20,10) # Years Using normal linear regression, we would estimate the model as: m1<-lm(gdp~rain+factor(ccode)

JAGS: unit-specific time trends

半世苍凉 提交于 2020-01-06 14:59:26
问题 Using JAGS I am trying to estimate a model including a unit-specific time trend. However, the problem is that I don't know how to model this and so far I have been unable to find a solution. As an example, consider we have the following data: rain<-rnorm(200) # Explanatory variable n1<-rnorm(200) # Some noise gdp<-rain+n1 # Outcome variable ccode<-rep(1:10,20) # Unit codes year<-rep(1:20,10) # Years Using normal linear regression, we would estimate the model as: m1<-lm(gdp~rain+factor(ccode)

Multinomial distribution in PyMC

烂漫一生 提交于 2020-01-02 22:11:12
问题 I am a newbie to pymc. I have read the required stuff on github and was doing fine till I was stuck with this problem. I want to make a collection of multinomial random variables which I can later sample using mcmc. But the best I can do is rv = [ Multinomial("rv", count[i], p_d[i]) for i in xrange(0, len(count)) ] for i in rv: print i.value i.random() for i in rv: print i.value But it is of no good since I want to be able to call rv.value and rv.random() , otherwise I won't be able to sample

How can one simulate quantities of interest from the posterior density in MCMCglmm?

旧街凉风 提交于 2020-01-02 19:22:09
问题 I would like to simulate quantities of interest from a model estimated with MCMCglmm more or less the way Zelig package does. In Zelig you can set the values you want for the independent values and software calculates the result for the outcome variable (expected value, probability, etc). An example: # Creating a dataset: set.seed(666) df <- data.frame(y=rnorm(100,20,20),z=rnorm(100,50,70)) # Loading Zelig library(Zelig) # Model m1.zelig <- zelig(y~z, data=df, model="ls") summary(m1.zelig) #

How to implement TF_IDF feature weighting with Naive Bayes

有些话、适合烂在心里 提交于 2020-01-01 17:28:08
问题 I'm trying to implement the naive Bayes classifier for sentiment analysis. I plan to use the TF-IDF weighting measure. I'm just a little stuck now. NB generally uses the word(feature) frequency to find the maximum likelihood. So how do I introduce the TF-IDF weighting measure in naive Bayes? 回答1: You can visit the following blog shows in detail how do you calculate TFIDF. 回答2: You use the TF-IDF weights as features/predictors in your statistical model. I suggest to use either gensim [1]or

How to implement TF_IDF feature weighting with Naive Bayes

谁说我不能喝 提交于 2020-01-01 17:28:00
问题 I'm trying to implement the naive Bayes classifier for sentiment analysis. I plan to use the TF-IDF weighting measure. I'm just a little stuck now. NB generally uses the word(feature) frequency to find the maximum likelihood. So how do I introduce the TF-IDF weighting measure in naive Bayes? 回答1: You can visit the following blog shows in detail how do you calculate TFIDF. 回答2: You use the TF-IDF weights as features/predictors in your statistical model. I suggest to use either gensim [1]or

Weka: How do I get the prediction value in java for a test instance?

混江龙づ霸主 提交于 2019-12-31 07:14:19
问题 I have successfully trained a classifier (bayesnet) and constructed a test set (ARFF-format), which has one instance, with one missing value. Evaluation eTest = new Evaluation(trainingInstance); eTest.evaluateModel(bayes_Classifier, testInstance); How can I access the prediction for the missing value? I have tested both ARFF structures (training & Test) with the GUI. They work. I simply do not know, how to access the prediction value... 回答1: You want to use eTest.evaluateModelOnce() which