Giter Club home page Giter Club logo

bayespa's People

Contributors

strin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bayespa's Issues

Obtain "topics"

Hi, is there any way of obtaining some description of the topics learned by this model (for example, a list of top words)?

Help me to solve this issues plz

when I enter
$sudo python setup.py install
I got this follow blew:

/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/medlda
copying medlda/init.py -> build/lib.linux-x86_64-2.7/medlda
running build_ext
building 'libbayespagibbs' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/medlda
creating build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA
creating build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src
creating build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/ap.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/ap.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/cholesky.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/cholesky.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/cokus.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/cokus.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/InverseGaussian.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/InverseGaussian.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/Mapper.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/Mapper.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/MVGaussian.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/MVGaussian.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/objcokus.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/objcokus.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/spdinverse.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/spdinverse.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/Document.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/Document.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/utils/Sample.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/Sample.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/OnlineGibbsMedLDA.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/OnlineGibbsMedLDA.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=0 -DMINOR_VERSION=1 -Imedlda/OnlineGibbsMedLDA/inc -Imedlda/OnlineGibbsMedLDA/inc/utils -I/usr/include/python2.7 -c medlda/OnlineGibbsMedLDA/src/OnlineGibbsMedLDAWrapper.cpp -o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/OnlineGibbsMedLDAWrapper.o -std=c++11 -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/ap.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/cholesky.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/cokus.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/InverseGaussian.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/Mapper.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/MVGaussian.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/objcokus.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/spdinverse.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/Document.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/utils/Sample.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/OnlineGibbsMedLDA.o build/temp.linux-x86_64-2.7/medlda/OnlineGibbsMedLDA/src/OnlineGibbsMedLDAWrapper.o -L/opt/local/lib/ -lboost_python-mt -o build/lib.linux-x86_64-2.7/libbayespagibbs.so
/usr/bin/ld: cannot find -lboost_python-mt
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

libboost-all-dev is already the newest version.
gcc-4.8 is already the newest version.
python-numpy is already the newest version.
Plz help.

release multi-task medlda

  • refractor global sample representation
  • implement multi-task sampling procedure
  • implement multi-task wrapper

accuracy decays with more topics

with the following setting

import medlda
log = open("20ng_result.txt", "a")
batchsize = 512
label = 20
numword = 53975
num_sample = 100
for k in range(20, 120, 20):
        pamedlda = medlda.OnlineGibbsMedLDA(num_topic = k, labels = label, words = numword, alpha=1/k)
        pamedlda.train_with_gml('/home/wenbo/mfs/data/20ng/20ng_train.gml', batchsize)
        (pred, ind, acc) = pamedlda.infer_with_gml('/home/wenbo/mfs/data/20ng/20ng_test.gml', num_sample)
        log.write("topic: %d, batch: %d, numsample: %d, acc: %0.2f\n" % (k, batchsize, num_sample, acc))
log.close()

the results seem to differ from original paMedLDAgibbs implementation. Here the accuracy drops dramatically as the number of topics k increases.

topic: 10, batch: 512, numsample: 100, acc: 0.80
topic: 20, batch: 512, numsample: 100, acc: 0.80
topic: 30, batch: 512, numsample: 100, acc: 0.80
topic: 40, batch: 512, numsample: 100, acc: 0.80
topic: 50, batch: 512, numsample: 100, acc: 0.79
topic: 60, batch: 512, numsample: 100, acc: 0.78
topic: 70, batch: 512, numsample: 100, acc: 0.76
topic: 80, batch: 512, numsample: 100, acc: 0.72
topic: 90, batch: 512, numsample: 100, acc: 0.72
topic: 100, batch: 512, numsample: 100, acc: 0.70

Obtain scores from infer_with_gml

Hi, thank you for this project! I was able to set up, train and infer this model on my own (binary classification) dataset.

However, infer_with_gml only provides me predicted labels; I would like to obtain a score that I can later use to construct an ROC curve for this model.

Could you guide me on how to modify the code to obtain scores instead of binary predictions?

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.