Git Product home page Git Product logo

Comments (4)

hbaniecki avatar hbaniecki commented on May 21, 2024 3

No worries. Thanks! Works great.

from pyss3.

hbaniecki avatar hbaniecki commented on May 21, 2024 1

Thanks! If the data won't be saved on disk and only loaded into x_train, y_train etc. then load_from_url(url, folder=None) makes perfect sense.

from pyss3.

sergioburdisso avatar sergioburdisso commented on May 21, 2024

Hi again @hbaniecki!

Wow, this is an amazing idea 👏👏👏

What do you think if adding a method called load_from_url() to the Dataset class, which would do the same thing as the current Dataset.load_from_files() but instead of loading the dataset from disk, it will do it from an URL, as you suggested.

Perhaps load_from_url() should take two arguments, load_from_url(url, folder=None), first the url from which to download the zipped dataset and secondly, an optional argument called something like folder that let the user to specify a particular folder to use from inside the zipped dataset. The example would end up being something like:

from pyss3 import SS3

x_train, y_train = Dataset.load_from_url("https://url/to/movie_review.zip", "train")
x_test, y_test = Dataset.load_from_url("https://url/to/movie_review.zip", "test")

clf = SS3()
clf.fit(x_train, y_train)
y_pred = clf.predict(x_test)

What do you think?
(Again, thank you for this suggestion, I think it is an awesome idea 💪😎👍)

from pyss3.

sergioburdisso avatar sergioburdisso commented on May 21, 2024

Hi @hbaniecki! sorry for the delay, I just had to wait for the weekend to get down on this. I've added the suggested methods and also updated the README.md. Just check it out and let me know if everthing is OK 💪 🤓 👍

Below I'm pasting the commit message that marked this issue as closed:

Now datasets can be directly loaded via a given url, not only from disk.
To achieve this, two methods have been added to Dataset class:

  • Dataset.load_from_url(...)
  • Dataset.load_from_url_multilabel(...)

These methods download and extract the zip file (given by the url)
into the system's temporary folder and then call
Dataset.load_from_files() to load it
(or Dataset.load_from_files_multilabel(), respectively).

Note: If the same url is used consecutively, the already downloaded
files will be used as a cache (to avoid downloading and extracting
them again).

from pyss3.

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.