strin / bayespa Goto Github PK
View Code? Open in Web Editor NEWOnline Max-Margin Topic Models for Accurate and Fast Text Classification [release v0.1]
Online Max-Margin Topic Models for Accurate and Fast Text Classification [release v0.1]
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.
Hi, is there any way of obtaining some description of the topics learned by this model (for example, a list of top words)?
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?
"gcc > 4.8" should be "gcc >= 4.8"
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
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.