GithubHelp home page GithubHelp logo

Comments (13)

maciejkula avatar maciejkula commented on September 28, 2024

Can you:

  1. Check where it's looking for the data (the zip_path above)?
  2. Check that the file at that path is a valid zip file?
  3. Try deleting that file and its directory and run the command again.

My first suspicion is that there might have been a problem with the download and you have a partially completed file cached in the data directory.

from lightfm.

maciejkula avatar maciejkula commented on September 28, 2024

Any luck?

from lightfm.

maciejkula avatar maciejkula commented on September 28, 2024

?

from lightfm.

anshulg8 avatar anshulg8 commented on September 28, 2024

You need to update zip_path in lightfm/datasets/movielens.py

from lightfm.

maciejkula avatar maciejkula commented on September 28, 2024

Are you saying that the code doesn't work? Could you post the trace for the error you encountered?

from lightfm.

anshulg8 avatar anshulg8 commented on September 28, 2024

I was stuck in a similar issue, which I posted here.
All I had to do was replace this:

zip_path = _common.get_data(data_home,
                            ('https://github.com/maciejkula/'
                             'lightfm_datasets/releases/'
                             'download/v0.1.0/movielens.zip'),
                            'movielens100k',
                            'movielens.zip',
                            download_if_missing)

with

zip_path = _common.get_data(data_home,
                            ('https://github.com/maciejkula/
                            lightfm_datasets/releases/
                            download/v0.1.0/movielens.zip'),
                            'movielens100k',
                            'movielens.zip',
                            download_if_missing)

from lightfm.

maciejkula avatar maciejkula commented on September 28, 2024

Can you point out the difference between the two? I don't quite see it!

from lightfm.

anshulg8 avatar anshulg8 commented on September 28, 2024

The 4 extra apostrophes(') in the URL were creating problem for me.

from lightfm.

maciejkula avatar maciejkula commented on September 28, 2024

Are you use? Python uses what's called implicit string concatenation; these quotes are simply dropped in the final string. Your changed code is syntactically identical.

from lightfm.

anshulg8 avatar anshulg8 commented on September 28, 2024

It didn't work for me, I am using Python3.6

from lightfm.

ParikshitSinghTomar avatar ParikshitSinghTomar commented on September 28, 2024

Thanks @anshulg8, for pointing url. While my problem not solved by the help of above solution. What I tried written below.

  1. Copy path and download zip file
  2. Replace below code
    data = fetch_movielens(min_rating=4.0)

with
def _read_raw_data(path):
with zipfile.ZipFile(path) as datafile:
return (datafile.read('ml-100k/ua.base').decode().split('\n'),
datafile.read('ml-100k/ua.test').decode().split('\n'),
datafile.read('ml-100k/u.item').decode(errors='ignore').split('\n'),
datafile.read('ml-100k/u.genre').decode(errors='ignore').split('\n'))

data=_read_raw_data('movielens.zip')
I know this is not right way but I tried it and it works perfect.

from lightfm.

maciejkula avatar maciejkula commented on September 28, 2024

This is not a bug in the code. Your download was corrupted for some reason. Delete the downloaded file and the code should work again. The advice above (wrt changing paths) is incorrect.

from lightfm.

maciejkula avatar maciejkula commented on September 28, 2024

This problem is solved in the newest release, 1.14.

from lightfm.

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.