Coder Social home page Coder Social logo

Comments (21)

BrianMiner avatar BrianMiner commented on May 28, 2024

I ended up re-running everything and it "seemed" to run OK. but I get this error trying to import

from fastFM import sgd

ImportError: /home/anaconda/lib/python2.7/site-packages/fastFM/ffm.so: undefined symbol: g_array_new

from fastfm.

ibayer avatar ibayer commented on May 28, 2024

g_array_new is a function from the c library glib.
Please run (README was missing a dependency):
sudo apt-get install libglib2.0-dev python-dev libatlas-base-dev before
recompiling and installing fastFM.
Please let us know if that helps.

from fastfm.

BrianMiner avatar BrianMiner commented on May 28, 2024

I had run it. When I do this again I receive:

sudo apt-get install libglib2.0-dev python-dev libatlas-base-dev

Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dev is already the newest version.
libatlas-base-dev is already the newest version.
libglib2.0-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 440 not upgraded.

from fastfm.

ibayer avatar ibayer commented on May 28, 2024

You need the following steps:

  1. sudo apt-get install libglib2.0-dev python-dev libatlas-base-dev
  2. cd fastFM/; make
  3. pip install -r /fastFM/requirements.txt
  4. python setup.py install or pip install -e fastFM/

Are you missing step 2 ? Please start with a clean clone.

from fastfm.

BrianMiner avatar BrianMiner commented on May 28, 2024

I got a fresh clone and ran through all the steps. Same error sadly. Not sure why?

/home/anaconda/lib/python2.7/site-packages/fastFM/fastFM/base.py in ()
3
4 import numpy as np
----> 5 import ffm
6 import scipy.sparse as sp
7 from scipy.stats import norm

ImportError: /home/anaconda/lib/python2.7/site-packages/fastFM/ffm.so: undefined symbol: g_array_new

from fastfm.

ibayer avatar ibayer commented on May 28, 2024

I need the command and output for every single step starting with git clone --recursive.

from fastfm.

BrianMiner avatar BrianMiner commented on May 28, 2024

OK I will start over again and supply

from fastfm.

BrianMiner avatar BrianMiner commented on May 28, 2024

Attached. Thanks for your help!

ERRORS_fastFM.TXT

from fastfm.

ibayer avatar ibayer commented on May 28, 2024

Thanks for reporting the error, I can reproduce it locally. I'll comment here as soon as it's fixed!

from fastfm.

ibayer avatar ibayer commented on May 28, 2024

I have committed a bugfix.
Travis is currently only testing the OSX build. I'll add linux asap to avoid issues like this.

from fastfm.

BrianMiner avatar BrianMiner commented on May 28, 2024

Seemed to do the trick! thanks very much!

from fastfm.

BrianMiner avatar BrianMiner commented on May 28, 2024

On a side note, I was curious how FM generally would work on a typical structured data problem (not a click through one with massively high cardinality of IDs) - so I tried fastFM on the current Kaggle dataset from the Prudential challenge. After 1 hot encoding the categorical variables, there is around 850 variables (some numerics, some discrete ordinal ones and the dummy variables). The performance I got so far was very poor. I was curious if you have found that this algorithm can be competitive on problems like this (I noted you mentioned it should be a regular "toolbox" algorithm).

from fastfm.

ibayer avatar ibayer commented on May 28, 2024

FM's can be regarded as second order polynomial regression with factorized coefficients for the variable interaction. The factorization is indeed most interesting for categorical variables with high cardinality.

I'm not surprised that FM's don't work miracles in the Prudential challenge but they should perform at least as good as logistic / linear regression with properly tuned hyper parameter.

I think loads of dummy variables show up more and more these days, not only in CRP. That's why I think it's good to have a tool for this kind of data in you toolbox. :-)

from fastfm.

BrianMiner avatar BrianMiner commented on May 28, 2024

It would be interesting to see what an expert can do with it. I was unable to get even decent results (worse than libfm) but I assume it was my newness to tuning.

from fastfm.

zerowgravity avatar zerowgravity commented on May 28, 2024

Just curious to know if this has been merged into master? I'm facing the same issue on Linux 4.1.17-22.30.amzn1.x86_64 #1 SMP Fri Feb 5 23:44:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux. The issue is that blas is not found while running make.

from fastfm.

ibayer avatar ibayer commented on May 28, 2024

@zerowgravity
Yes, this has been merged. Make sure you have blas installed.
sudo apt-get install python-dev libatlas-base-dev
You need to provide more information: install source / binary, full error output, etc.

from fastfm.

zerowgravity avatar zerowgravity commented on May 28, 2024

I'm running an Amazon Linux AMI, x86_64 x86_64 x86_64 GNU/Linux and installed fastFM from source.

Here is the full error output:

fastFM]$ make
( cd fastFM-core ; make lib )
make[1]: Entering directory /mnt1/anaconda2/lib/python2.7/site-packages/fastFM/fastFM-core' ( cd src ; make lib ) make[2]: Entering directory/mnt1/anaconda2/lib/python2.7/site-packages/fastFM/fastFM-core/src'
( cd ../externals/CXSparse ; make library )
make[3]: Entering directory /mnt1/anaconda2/lib/python2.7/site-packages/fastFM/fastFM-core/externals/CXSparse' ( cd Lib ; make ) make[4]: Entering directory/mnt1/anaconda2/lib/python2.7/site-packages/fastFM/fastFM-core/externals/CXSparse/Lib'
make[4]: Nothing to be done for default'. make[4]: Leaving directory/mnt1/anaconda2/lib/python2.7/site-packages/fastFM/fastFM-core/externals/CXSparse/Lib'
make[3]: Leaving directory /mnt1/anaconda2/lib/python2.7/site-packages/fastFM/fastFM-core/externals/CXSparse' mkdir -p ../bin/ ar rcs ../bin/libfastfm.a kmath.o ffm_random.o ffm_als_mcmc.o ffm_utils.o ffm_sgd.o ffm.o make[2]: Leaving directory/mnt1/anaconda2/lib/python2.7/site-packages/fastFM/fastFM-core/src'
make[1]: Leaving directory `/mnt1/anaconda2/lib/python2.7/site-packages/fastFM/fastFM-core'
python setup.py build_ext --inplace
running build_ext
skipping 'fastFM/ffm.c' Cython extension (up-to-date)
building 'ffm' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/fastFM
gcc -pthread -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -IfastFM/ -IfastFM-core/include/ -IfastFM-core/externals/CXSparse/Include/ -I/usr/include/ -I/mnt1/anaconda2/envs/p3/lib/python3.5/site-packages/numpy/core/include -I/mnt1/anaconda2/envs/p3/include/python3.5m -c fastFM/ffm.c -o build/temp.linux-x86_64-3.5/fastFM/ffm.o
In file included from /mnt1/anaconda2/envs/p3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781:0,
from /mnt1/anaconda2/envs/p3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /mnt1/anaconda2/envs/p3/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from fastFM/ffm.c:244:
/mnt1/anaconda2/envs/p3/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
In file included from /mnt1/anaconda2/envs/p3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:27:0,
from /mnt1/anaconda2/envs/p3/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from fastFM/ffm.c:244:
/mnt1/anaconda2/envs/p3/lib/python3.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:1634:1: warning: β€˜_import_array’ defined but not used [-Wunused-function]
_import_array(void)
^
gcc -pthread -shared -L/mnt1/anaconda2/envs/p3/lib -Wl,-rpath=/mnt1/anaconda2/envs/p3/lib,--no-as-needed build/temp.linux-x86_64-3.5/fastFM/ffm.o -LfastFM/ -LfastFM-core/bin/ -LfastFM-core/externals/CXSparse/Lib/ -L/usr/lib/ -L/usr/lib/atlas-base/ -L/mnt1/anaconda2/envs/p3/lib -lm -lfastfm -lcxsparse -lcblas -lpython3.5m -o /mnt1/anaconda2/lib/python2.7/site-packages/fastFM/ffm.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lcblas
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
make: *** [all] Error 1

from fastfm.

zerowgravity avatar zerowgravity commented on May 28, 2024

This ended up being a symlink issue. From research, I think it's specific to CentOS and RHEL platforms. The symlink seems to be created otherwise.

from fastfm.

ibayer avatar ibayer commented on May 28, 2024

@zerowgravity
Thanks for the heads up. Did you come across a page that describes the symlink issue? Could be useful to document it here, in case someone else runs into it.

from fastfm.

zerowgravity avatar zerowgravity commented on May 28, 2024

I found this http://stackoverflow.com/questions/6789368/how-to-make-sure-the-numpy-blas-libraries-are-available-as-dynamically-loadable and tried to emulate it for fastFM.

from fastfm.

Data-drone avatar Data-drone commented on May 28, 2024

I didn't manage to successfully follow that stackoverflow should I just find the libblas.so in /usr/lib64 and paste it into the fastFM directory in python2.7/dist-packages?

From what I can see /usr/lib64/libblas.so exists so it isn't an issue with it being called .3gf

from fastfm.

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.