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

UI to run models #26

Open
vedina opened this issue Feb 20, 2017 · 4 comments
Open

UI to run models #26

vedina opened this issue Feb 20, 2017 · 4 comments

Comments

@vedina
Copy link
Member

vedina commented Feb 20, 2017

Moved from ideaconsult/Toxtree.js#68 and ideaconsult/Toxtree.js#110

@vedina
Copy link
Member Author

vedina commented Sep 4, 2017

See T171

@thejonan
Copy link
Contributor

There are two more skills added to jToxKit: TaskPollng and ModelRunning - they work together to make the prediction running an easy task. (Check this commit: 504c6af)

If they are combined with the Running widget which automates the process of attaching a method invocations to UI element, the entire wiring to enable running predictions on datasets is very easy. There is an example in model_demo.html and it goes like this:

  <input type="text" placeholder="Dataset URI_" id="dataset-uri" size="100"/><br/>
  <input type="text" placeholder="Model URI_" id="model-uri" size="100"/><br/>
  <input type="button" value="Run" id="run-prediction"/>&nbsp;<span id="algorithms-count">0</span><br/>
  <textarea id="result-area" placeholder="Results_" cols="100" rows="20"></textarea>
  
<!-- referred scripts, including jtox-kit.js -->
  <script type="text/javascript">
    var Manager = new (a$(Solr.Management, Solr.QueryingURL, Solr.Configuring))({ 
          serverUrl: "https://apps.ideaconsult.net/data/",
          connector: $
        }),
        Runner = new (a$(jT.ModelRunning, jT.TaskPolling, jT.Running))({ 
          /* Running skill settings */
          runSelector: '#run-prediction',
          runMethod: "onRun",
          target: document,

          /* ModelRunning settings */
          algorithms: true, 
          listFilter: "ToxTree", 
          loadOnInit: true, id: 'toxtree',
//           forceCreate: true,
          onRun: function (e) {
            this.runPrediction(datasetUri, $('#model-uri').val(), function (results) {
              $('#result-area').html(JSON.stringify(results, null, 2));
            });
          },
          onLoaded: function (result) {
            var self = this;
            
            $('#algorithms-count').html(result.algorithm.length);
            
            self.getModel(result.algorithm[0].uri, function (modelUri) {
              $('#model-uri').val(modelUri);
            });
          }
        });
    
    Manager.addListeners(Runner);
    Manager.init();

Pay attention to the fact that this is an exemplary Manager object, and that it also refers to AMBIT server.

@thejonan thejonan assigned vedina and unassigned thejonan Sep 28, 2017
@thejonan
Copy link
Contributor

thejonan commented Sep 29, 2017

The challenging part could be matching the proper column for each predicted feature.

This is actually easy, the features should have sameAs label which is the same as the endpoint category (which defines the column of the read across matrix)

@thejonan
Copy link
Contributor

thejonan commented Oct 1, 2017

I've added some version of this functionality. It can be found on this commit: 33e6f9fe247c399e407dd407236058766937406a of the old repo (branch: feature/ui-model-running). It does the same:

  • Adds an additional tab Models next to Export. In there are listed all models found on the server. (Yes, the jToxComound extraTabs feature is added).
  • Fills this tab as the normal jToxModel widget does - i.e. with quite a good information and leaving a checkbox in front.
  • Adds a button after the whole list, which runs selected models (actually - selection is on algorithms).
  • After all models ran finish, it issues a simple matrix reload (i.e. jToxCompund re-query), hoping that the newly available (due to initiated calculation) features will arrive and show up in the table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants