khigashi1987 / labeled-lda Goto Github PK
View Code? Open in Web Editor NEWThe C implementation of Labeled-LDA with collapsed gibbs sampling estimation.
The C implementation of Labeled-LDA with collapsed gibbs sampling estimation.
Hi khigashi,
I am trying to use your code to create a topic model with multiply labeled text.
However I am not sure how the input format should look like.
What I am trying is:
from sklearn import cross_validation
from LLDA.llda import LLDAClassifier
import numpy
X_train = numpy.array([[1,2], [3,4]]) # 2 documents - with 4 unique words in total
y_train = numpy.array([[0,1], [1,0]]) # two classes
llda = LLDAClassifier(alpha = 0.5/y_train.shape[1], threshold=0.10)
llda.fit(X_train, y_train)
The console ouput says "Number of words 2" which I expected to be 4. (words 1,2,3,4)
In addition I looked at the phi-values because I wanted to know the topic-word distribution:
phi = numpy.loadtxt(os.path.join(llda.tmp, "fit.phi"))
phi
I exptected to see a 2x4 matrix (topicsxwords) but actually its 2x2...
Is there anything wrong with my input?
Thank you and best regards!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.