GithubHelp home page GithubHelp logo

rpforest's People

Contributors

maciejkula avatar provostjoe avatar whereswardy 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpforest's Issues

label points that are being fit()

I'm not sure if the implementation already supports this, but is it possible assign a label with every point with fit(), so when there is a query, I can identify the neighbors by the labels?

Does windows support the libs

In win7 environment, when i install rpforest ,i met the problem. i use vs2015.
the complie error informatios:
C:\Users\juine\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python
\9.0\VC\Bin\cl.exe /c logo /Ox /MD /W3 /GS- /DNDEBUG -ID:\Python27\lib\site-p
ackages\numpy\core\include -ID:\Python27\include -ID:\Python27\PC /Tprpforest/rp
forest_fast.cpp /Fobuild\temp.win32-2.7\Release\rpforest/rpforest_fast.obj -ffas
t-math
cl : Command line warning D9002 : ignoring unknown option '-ffast-math'
rpforest_fast.cpp
d:\python27\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_ap
i.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_N
O_DEPRECATED_API NPY_1_7_API_VERSION
rpforest/rpforest_fast.cpp(271) : fatal error C1083: Cannot open include fil
e: 'stdint.h': No such file or directory
error: command 'C:\Users\juine\AppData\Local\Programs\Common\Microsof
t\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2

Errors installing rpforest in conda environment on Mac OS X

OS/compiler details:

OS X version: 10.11.2 (El Capitan)

$ clang --version
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix

gcc is an alias for clang.

Installing rpforest in a fresh virtualenv environment works fine:

$ mkvirtualenv rpfenv
... python 3.4 env built ...
(rpfenv)$ pip install numpy
... numpy 1.10.2 installed ...
(rpfenv)$ pip install rpforest
... rpforest 1.1 installed ...

rpforest_fast was compiled successfully with:

clang -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dsc/.virtualenvs/rpfenv/lib/python3.4/site-packages/numpy/core/include -I/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c rpforest/rpforest_fast.cpp -o build/temp.macosx-10.10-x86_64-3.4/rpforest/rpforest_fast.o -std=c++11

Trying to do the same in a conda environment results in compilation errors however:

$ conda create -n rpfenv2 python=3.4
... python 3.4 env built ...
$ source activate rpfenv2
(rpfenv2)$ pip install numpy
... numpy 1.10.2 installed ...
(rpfenv2)$ pip install rpforest

rpforest 1.1 is downloaded, but compilation fails. Compilation command:

clang -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dsc/miniconda3/envs/rpfenv2/include -arch x86_64 -I/Users/dsc/miniconda3/envs/rpfenv2/lib/python3.4/site-packages/numpy/core/include -I/Users/dsc/miniconda3/envs/rpfenv2/include/python3.4m -c rpforest/rpforest_fast.cpp -o build/temp.macosx-10.5-x86_64-3.4/rpforest/rpforest_fast.o -std=c++11

Compiler errors:

  In file included from rpforest/rpforest_fast.cpp:271:
  In file included from /Users/dsc/miniconda3/envs/rpfenv2/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h:4:
  In file included from /Users/dsc/miniconda3/envs/rpfenv2/lib/python3.4/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
  In file included from /Users/dsc/miniconda3/envs/rpfenv2/lib/python3.4/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781:
  /Users/dsc/miniconda3/envs/rpfenv2/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
  #warning "Using deprecated NumPy API, disable it by " \
   ^
  rpforest/rpforest_fast.cpp:5727:28: error: no member named 'shrink_to_fit' in 'std::vector<int, std::allocator<int> >'
      __pyx_v_node->indices->shrink_to_fit();
      ~~~~~~~~~~~~~~~~~~~~~  ^
  rpforest/rpforest_fast.cpp:5940:28: error: no member named 'shrink_to_fit' in 'std::vector<int, std::allocator<int> >'
      __pyx_v_node->indices->shrink_to_fit();
      ~~~~~~~~~~~~~~~~~~~~~  ^
  1 warning and 2 errors generated.
  error: command 'clang' failed with exit status 1

Compile error when installing rpforest

In file included from rpforest/rpforest_fast.cpp:271:

In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:

In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:

In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:

/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

#warning "Using deprecated NumPy API, disable it by " \

 ^

rpforest/rpforest_fast.cpp:5727:28: error: no member named 'shrink_to_fit' in 'std::vector<int, std::allocator<int> >'

    __pyx_v_node->indices->shrink_to_fit();

    ~~~~~~~~~~~~~~~~~~~~~  ^

rpforest/rpforest_fast.cpp:5940:28: error: no member named 'shrink_to_fit' in 'std::vector<int, std::allocator<int> >'

    __pyx_v_node->indices->shrink_to_fit();

    ~~~~~~~~~~~~~~~~~~~~~  ^

1 warning and 2 errors generated.

error: command 'gcc' failed with exit status 1

C++ error with python 3.5

Hello,
I'm trying to fir an rpforet module on a big matrix (3000000 x 300) in python 3.5 on OS X 10.11 and I get the following error:

Traceback (most recent call last):
  File "rpforest_test.py", line 29, in <module>
    index.fit(model.syn0)
  File "/usr/local/lib/python3.5/site-packages/rpforest/rpforest.py", line 81, in fit
    tree.make_tree(self._X)
  File "rpforest/rpforest_fast.pyx", line 237, in rpforest.rpforest_fast.Tree.make_tree (rpforest/rpforest_fast.cpp:3896)
ValueError: Buffer dtype mismatch, expected 'double' but got 'float'

Is rpforest supports custom similarity/distance function

hi, @maciejkula ,
According to your paper titled "Metadata Embeddings for User and Item Cold-start Recommendations", lyst generate recommendation using lightfm and some kind of ANN algorithm. So I came to rpforest in lyst's repository and I think maybe that's exactly the ANN.
Now Suppose that we have trained a lightfm model, include embeddings and bias. It seems that it is still hard to rapidly generate top-k recommendation using rpforest, Since as Readme said, rpforest is based on cosine similarity, however, the score for a user-item pair in lightfm is the sum of a dot product of two embeddings and two bias.
So my question is:

Is rpforest supports custom similarity/distance function, or some other way can achieve top-k recommendation?

thanks
jianyi

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.