Giter Club home page Giter Club logo

Comments (9)

benfred avatar benfred commented on June 29, 2024

What version of scipy are you using? I think these functions were added in v0.16

from implicit.

rowanv avatar rowanv commented on June 29, 2024

scipy==0.19.1.

The same requirements set worked on Mac OS X 10.12.14, if that helps, this is an error that I encountered when pushing out to the CI server.

from implicit.

benfred avatar benfred commented on June 29, 2024

Interesting. I'm using ubuntu w/ scipy v 0.19.0 (via the python3 anaconda distribution) without any issues myself.

Can you verify that the 'cython_lapack.pxd' file is included in the scipy thats getting picked up?

python -c "import scipy.linalg; import os; dirname = os.path.dirname(scipy.linalg.__file__); print(dirname); print(scipy.__version__); print('\n'.join(os.listdir(dirname)))"

from implicit.

rowanv avatar rowanv commented on June 29, 2024

Hmm you know, I think this might actually be an issue with the CI service provider. I've tried ssh-ing into their CI boxes and doing a manual install of all packages, and can't replicate the error. Have also tried deploying to my own Ubuntu box, and I can't replicate the error. It only seems to happen when the CI service runs the dependency installation as part of their installation chain, so I'm going to assume that something odd is going on on their end.

from implicit.

rowanv avatar rowanv commented on June 29, 2024

Ok, managed to replicate the error. For some reason, if I install the components manually, i.e.

pip install Cython==0.27.2
pip install scipy==0.19.1
pip install implicit==0.2.6
and then
pip install -r requirements.txt for the rest of my requirements

that succeeds on Ubuntu 14.04.

However, moving scipy and implicit into the requirements.txt file results in a failure. As far as I can tell, there shouldn't be a reason that the two are different, since the requirements.txt file output shows that the right package versions are installed or cached:

Collecting scipy==0.19.1 (from -r requirements.txt (line 69))
  Using cached scipy-0.19.1-cp35-cp35m-manylinux1_x86_64.whl
Collecting implicit==0.2.6 (from -r requirements.txt (line 70))
  Using cached implicit-0.2.6.tar.gz
    Complete output from command python setup.py egg_info:
    
    Error compiling Cython file:
    ------------------------------------------------------------
    ...

and yet I still get that odd error that suggests that it's using the wrong version of scipy. No idea why this might be happening since all of the versions are pegged, but installing outside of requirements.txt works fine for now.

from implicit.

benfred avatar benfred commented on June 29, 2024

interesting - I think it must be picking up the wrong version somehow =( glad you managed to work around this problem!

from implicit.

erseema avatar erseema commented on June 29, 2024

HI, I am using implicit to implement ALS . While fitting model, I am getting error "AttributeError: 'DataFrame' object has no attribute 'tocsr'"
Using scipy version 0.16
implicit version - 0.2.7

from implicit.

benfred avatar benfred commented on June 29, 2024

@erseema That looks like you're passing a pandas dataframe to the fit function, when you should be passing a sparse matrix (like a scipy.sparse.csr_matrix or similar) in.

Check out the examples for how to convert: https://github.com/benfred/implicit/blob/master/examples/lastfm.py#L71

from implicit.

guilhermeparreira avatar guilhermeparreira commented on June 29, 2024

Hi, can you provide an example of how you suggest to convert a pandas dataframe to sparse matrix?

I did not understand the link you provided.

I tried this one:
https://hippocampus-garden.com/pandas_sparse/#:~:text=To%20convert%20a%20DataFrame%20to,a%20coordinate%20(COO)%20matrix.

which worked, but I don't know if this is the best way..

from implicit.

Related Issues (20)

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.