Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Orange with OpenML.org #1184

Closed
brylie opened this issue Apr 15, 2016 · 31 comments
Closed

Integrate Orange with OpenML.org #1184

brylie opened this issue Apr 15, 2016 · 31 comments
Labels

Comments

@brylie
Copy link
Contributor

brylie commented Apr 15, 2016

The OpenML.org website provides buttons to export flows for Weka, MOA, and RapidMiner. E.g.
http://www.openml.org/t/1940

As an Orange user, how do I import a data-flow from OpenML.org into an Orange data flow graph?

Related issues

@kernc
Copy link
Contributor

kernc commented Apr 15, 2016

We don't support loading Weka, MOA, or RapidMiner projects. Orange has its own workflow scheme (.ows). Incidentally, OpenML doesn't (yet) support Orange. If you care, perhaps you can write them and express your interest? 😃

@brylie
Copy link
Contributor Author

brylie commented Apr 18, 2016

@kernc good suggestion. There is some middle ground here it seems.

@brylie
Copy link
Contributor Author

brylie commented Apr 18, 2016

I posed the Orange Data Mining + OpenML question on the OpenML discussion list, and got a response:

We definitely hope to support Orange, as well as other Python libraries. We have a Python interface under development: http://www.openml.org/guide#!python

It currently allows you to download data, run experiments, and upload results. We also have some examples in scikit-learn. What is does not yet support are Orange-specific procedures to export Orange workflows.

As far as I know nobody is currently working on the latter but of course we greatly encourage work in this direction and will help as much as we can. It just takes someone (or a few people) to get this started.

@kernc
Copy link
Contributor

kernc commented Apr 18, 2016

Thanks!

It just takes someone (or a few people) to get this started.

Would you like to work on it?

@brylie
Copy link
Contributor Author

brylie commented Apr 18, 2016

Well, I am rather new to the entire ML realm, having just started learning Orange in the past couple of weeks. I can certainly try, but may need a someone to break the task into small chunks.

@brylie
Copy link
Contributor Author

brylie commented Apr 18, 2016

I got basic approval to pursue this task at work, so can dedicate some time given guidance.

@brylie
Copy link
Contributor Author

brylie commented Apr 18, 2016

One starter idea is to create a UI widget that can be used to enter OpenML credentials.

@brylie
Copy link
Contributor Author

brylie commented Apr 18, 2016

Also, where can I find instructions describing how to set up a development environment? I am running Linux, with primary experience in JavaScript development.

@kernc
Copy link
Contributor

kernc commented Apr 18, 2016

Actually, these are the up-to-date instructions: https://github.com/biolab/orange3#installing If you seem to be missing any packages, install them from your distribution channels.

@brylie
Copy link
Contributor Author

brylie commented Apr 19, 2016

I have followed the "how to install for development" instructions, and am browsing the source.

Where would be a good place to define OpenML related widget(s)? How do I define UI elements (e.g. is there a tool such as QtCreator or other approach)?

@brylie
Copy link
Contributor Author

brylie commented Apr 19, 2016

Basically, this task is a lot of "uphill" for me. I am willing to learn, but have very little experience with Python, PyQt, etc. There seems to be very little documentation for me to lean on.

@brylie
Copy link
Contributor Author

brylie commented Apr 19, 2016

One example of useful documentation would be the Node-RED platform docs, where there are relatively clear instructions about creating new nodes:
http://nodered.org/docs/creating-nodes/first-node

@rahulroxx
Copy link
Contributor

rahulroxx commented Apr 19, 2016

@brylie Documentation is at http://orange.biolab.si/docs/

How do I define UI elements (e.g. is there a tool such as QtCreator or other approach)?

Please don't use QtCreator or QtDesigner for coding widgets , as it will hard at later point of time when dealing with loading and saving settings in Orange . You can use them to design layout of the widget . but widgets should be coded manually .
You can use functions from *gui.py *
https://github.com/biolab/orange3/blob/master/Orange/widgets/gui.py

@brylie
Copy link
Contributor Author

brylie commented Apr 22, 2016

I am working through the widget development getting started tutorial, but cannot get the example widget to appear. I have done the following:

  1. added an orange-demo folder inside /orange3/Orange/widgets/

  2. created the file structure as outlined in the tutorial

    • orangedemo
      • icons
        • DataSamplerA.svg
      • __init__.py
      • OWDataSamplerA.py
    • setup.py
  3. Add the following to orange-demo/setup.py:

    from setuptools import setup
    
    setup(name="Demo",
          packages=["orangedemo"],
          package_data={"orangedemo": ["icons/*.svg"]},
          classifiers=["Example :: Invalid"],
          # Declare orangedemo package to contain widgets for the "Demo" category
          entry_points={"orange.widgets": ("Demo = orangedemo")},
          )
  4. Add the following to orange-demo/orangedemo/OWDataSamplerA.py:

    import sys
    import numpy
    
    import Orange.data
    from Orange.widgets import widget, gui
    
    class OWDataSamplerA(widget.OWWidget):
        name = "Data Sampler A"
        description = "Randomly selects a subset of instances from the data set"
        icon = "icons/DataSamplerA.svg"
        priority = 10
    
        inputs = [("Data", Orange.data.Table, "set_data")]
        outputs = [("Sampled Data", Orange.data.Table)]
    
        want_main_area = False
    
        def __init__(self):
            super().__init__()
    
            # GUI
            box = gui.widgetBox(self.controlArea, "Info")
            self.infoa = gui.widgetLabel(box, 'No data on input yet, waiting to get something.')
            self.infob = gui.widgetLabel(box, '')
    
        def set_data(self, dataset):
            if dataset is not None:
                self.infoa.setText('%d instances in input data set' % len(dataset))
                indices = numpy.random.permutation(len(dataset))
                indices = indices[:int(numpy.ceil(len(dataset) * 0.1))]
                sample = dataset[indices]
                self.infob.setText('%d sampled instances' % len(sample))
                self.send("Sampled Data", sample)
            else:
                self.infoa.setText('No data on input yet, waiting to get something.')
                self.infob.setText('')
                self.send("Sampled Data", None)
  5. run pip install -e . (both with and without sudo)

  6. run python -m Orange.canvas

I do see that a Demo.egg-info directory was created when running without sudo.

Where might I be going wrong?

@rahulroxx
Copy link
Contributor

rahulroxx commented Apr 22, 2016

@brylie You can find your custom widget as shown below ,
screenshot from 2016-04-22 08 10 01

Custome Widgets are under Demo in my case .

@kernc
Copy link
Contributor

kernc commented Apr 24, 2016

If you run python -m Orange.canvas -l 4, do you get any errors? Your orange.widgets entry point is not a tuple, rather a single value enclosed in braces — possibly missing a comma there.

@brylie
Copy link
Contributor Author

brylie commented Apr 24, 2016

Ok, thanks @kernc. For what it's worth, that code comes directly from the demo widget tutorial

@brylie
Copy link
Contributor Author

brylie commented Apr 25, 2016

@kernc given the above mentioned entry_points line:

entry_points={"orange.widgets": ("Demo = orangedemo")}

Should the entry_points line be changed to this?

entry_points=("orange.widgets", ("Demo = orangedemo"))

Or should it look like this:

entry_points={"orange.widgets": ("Demo", "orangedemo")}

@brylie
Copy link
Contributor Author

brylie commented Apr 25, 2016

After some searching (and following a broken link in the Orange documentation), I found an example entry_points definition. So, changing the code as follows seems to resolve the problem:

entry_points={"orange.widgets": "Demo = orangedemo"}

brylie added a commit to brylie/orange3 that referenced this issue Apr 25, 2016
As discovered in [discussion around issue biolab#1184](biolab#1184 (comment)), the tuple is not necessary here. Only a single string is necessary, as is documented in the setuptools official [entry_points example](https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins).
@ajdapretnar
Copy link
Contributor

@brylie How's it going with the widget development? If there's something we need to improve in the documentation (and I'm sure there is), I'd be glad to hear it. Any contribution to a better documentation is highly appreciated. ⭐

@brylie
Copy link
Contributor Author

brylie commented May 10, 2016

@ajdapretnar thanks for following up. I will keep working on a simple widget for now, perhaps an OpenML authentication widget that has text field(s) for authentication details. The authentication details can then be passed into other OpenML related widgets.

@brylie
Copy link
Contributor Author

brylie commented May 10, 2016

As an aside, there is a related ML project called TPOT. In the TPOT repository, there are two ideas related to TPOT + Orange integration:

@ajdapretnar
Copy link
Contributor

@brylie Sounds great! When you have a PR ready, submit it and our folks here will review it. We really appreciate all the enhancements to Orange. ❤️ Once you're done with the widget, you are very welcome to write a guest blog for us on how the development went and how the widget can be used for OpenML tasks.

@brylie
Copy link
Contributor Author

brylie commented May 18, 2016

I will open an issue to track the "OpenML Authentication" widget development.

@brylie brylie changed the title How to import flow from OpenML.org Integrate Orange with OpenML.org May 18, 2016
@brylie
Copy link
Contributor Author

brylie commented May 18, 2016

I renamed this issue to indicate that it is a high-level issue. I updated the issue description with a link to the first sup-tasks:

@joaquinvanschoren
Copy link

Hi, I just noticed this thread. Great that you want to integrate OpenML and Orange. Let me know if you need any help from the OpenML side. You're also welcome to one of our next hackathons to speed things up :).

@brylie
Copy link
Contributor Author

brylie commented Dec 1, 2016

@joaquinvanschoren when/where are your upcoming hackathons?

@joaquinvanschoren
Copy link

joaquinvanschoren commented Dec 1, 2016 via email

@brylie
Copy link
Contributor Author

brylie commented Dec 2, 2016

Cool, I am in Finland, so might be able to 'hop the Baltic' for a hackathon in Germany. Any plans of visiting, for instance, Helsinki? 😉

@joaquinvanschoren
Copy link

joaquinvanschoren commented Dec 2, 2016 via email

@janezd
Copy link
Contributor

janezd commented Apr 1, 2019

In the interest of keeping the list of issues at manageable size, I'm closing this one, but keeping #1265. This one is too complicated and general, and nothing substantial happened in 2.5 years, while #1265 is small enough to be doable, and I believe the OpenML repository is big and well-organized, so it's worth investing some time into it eventually.

@janezd janezd closed this as completed Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants