Git Product home page Git Product logo

labeled-lda's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

labeled-lda's Issues

Input Format unclear

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.