Beispiel #1
0
    def load_column_annotation(self):
        clear_output()
        display_markdown(COLUMN_ANNOTATION_TEXT, raw=True)
        self._column_annotation_widgets = data_annotation_widget_collection(
            self.data, self.data_annotation)
        display(self._column_annotation_widgets)

        next_button = widgets.Button(description='next')
        next_button.on_click(lambda _: self.load_metadata_form())
        display(next_button)
Beispiel #2
0
    def load_metadata_form(self):
        clear_output()
        display_markdown(
            "Thanks for bearing with us! All this extra information is going to make sure the dataset is easier for others to find and understand. There's just a few more things we'd like to know:",
            raw=True)
        self._metadata_widget = metadata_widget(self.data_annotation)
        display(self._metadata_widget)

        def after_metadata(_):
            self._oml_dataset = create_openml_dataset(self.data,
                                                      self.data_annotation)
            self.load_api_key_check()

        next_button = widgets.Button(description='next')
        next_button.on_click(after_metadata)
        display(next_button)
Beispiel #3
0
    def load_publish_to_openml(self):
        clear_output()

        def publish(_):
            # The try/except block does not display markdown for whatever reason.
            # try:
            self._oml_dataset.publish()
            display(self._oml_dataset)
            publish_button.disabled = True
            publish_button.description = 'Published!'
            # except Exception as e:
            #     display_markdown(f"Publish was not successful. Exception: {e}")

        publish_button.on_click(publish)
        display_markdown(
            "That's it! By pressing the magical button below, your data will be uploaded to OpenML!",
            raw=True)
        display(publish_button)
Beispiel #4
0
    def load_api_key_check(self):
        if openml.config.apikey != '':
            self.load_publish_to_openml()
            return

        # API Key field was empty, so it needs to be configured.
        clear_output()
        display_markdown(
            """ We noticed you have not configured an API key for OpenML yet.
                To find your API key, log in on the [OpenML website](https://openml.org) ([register](https://www.openml.org/register) if needed)
                , go to your account page (click the avatar image on the top right) and click "API Authentication". """,
            raw=True)

        def on_key_input_change(key):
            if set_openml_apikey(key):
                print('success!')
                self.load_publish_to_openml()

        key_input = widgets.interactive(on_key_input_change, key='')
        key_input.kwargs_widgets[0].description = 'API Key:'
        display(key_input)
Beispiel #5
0
 def load_file_upload(self):
     clear_output()
     display_markdown(
         "Please provide the CSV file you want to upload to OpenML:",
         raw=True)
     display(self._upload_csv)