export PMML Model - user-interface

I have a PMML file generated with SPSS's neural networks.
in this model i have 20 predictors, the hidden layer, and a binary result.
Now, i can run this model as many times as i want at home, but i really want to export it for the hospital's pc with a simple interface, like a small window where to enter the 20 predictors and a field displaying the prediction's value.
i'm really really new to the field, i really appreciate any help you can provide.
I have tried googling but there doesn't seem to be an easy way to get this done.

Related

How do I access h2o xgb model input features after saving a model to disk and reloading it?

I'm using h2o's xgboost implementation in Python. I've saved a model to disk and I'm trying to load it later on for analysis and predicting. I'm trying to access the input features list or, even better, the feature list used by the model which does not include the features it decided not to use. The way people advise doing this is to use varimp function to get the variable importance and while this does remove features that aren't used in the model this actually gives you the variable importance of intermediate features created by OHE the categorical features, not the original categorical feature names.
I've searched for how to do this and so far I've found the following but no concrete way to do this:
Someone asking something very similar to this and being told the feature has been requested in Jira
Said Jira ticket which has been marked resolved but I believe says this was implemented but not customer visible.
A similar ticket requesting this feature (original categorical feature importance) for variable importance heatmaps but it is still open.
Someone else who found an unofficial way to access the columns with model._model_json['output']['names'] but that doesn't give the features that weren't used by the model and they are told to use a different method that doesn't work if you have saved the model to disk and reloaded it (which I am doing).
The only option I see is to just use the varimp features, split on period character to break the OHE feature names, select the first part of all the splits, and then run a set over everything to get the unique column names. But I'm hoping there's a better way to do this.

Best barcodes and how/what to generate barcodes from, and how to store it the best way?

I am writing an webapp for a used thrift store. We are planning to add all items to a database, and I will be using Laravel and MySQL for this.
We also want to get a barcode scanner in order to scan and add items.
But I've never worked with barcodes before and info regarded this for a website like mine is hard to find info on, so is the barcode-scanners so I'm asking help from someone with experience.
I'm not sure which barcodes we should use, but I'm thinking a 3D one, like QR would do good. I've found several qr-generators, but I'm unsure on how I should create them properly from items.
Say the store is named Brukten. And it has items, with number IDs. Should I then generate barcodes out of "Brukten_53" or something, or just the ID, or how is a smart way? Because I can use an option like this instead of storing the generated barcode, right, and its better to generate a QR each time instead of storing the data about it?
At first we will use a web interface to add items, and later on we want to get a barcode-scanner to help scan things, so I'm guessing it would be nice with a scanner that could take pictures and add to database. So we want the DB to be ready for this, and properly made to work with such systems. So I'm wondering also if anyone can recommend me a device for this. I've seen several but unsure what to choose. 2d, 3d, something with camera, or is there other devices we could use?
What we want a device for is:
We want to store in the db: Old things, new things
We want to retrieve: all things
We want to alter info: edit things, sell, check things
Something easier than going around with a laptop, phone or a tablet and entering stuff.
Building the site is no problem for me, PHP, MySQL, Laravel framework and all is old stuff, but barcodes is a new world for me.
You only have to make sure that every single distinct physical item has a unique ID.
A simple way to accomplish this is using category ids as prefixes.
Suppose your "used men clothes category" is ID 25, and when you enter a pair on jeans of that category into the system, you app assign them ID 12345.
You can reference that item as 002500012345. You only need to calculate the 13rd digit using this function (http://edmondscommerce.github.io/php/barcode/ean13-barcode-check-digit-with-php.html) and you have a full-fledged EAN13 barcode you can print using this font (http://www.fontpalace.com/font-details/EAN-13/) and read with virtually any code scanner.
The other approach is generating a unique url for each product:
http://www.example.com/25/12345.html
And embed the url into a QR code.
You can generate the image for the QR code using this library:
http://phpqrcode.sourceforge.net/

CouchDB Views - OR and AND operators

I think I'm missing something fundamental about CouchDB views.
Let's say I'm storing cars in a database. I want to get all cars that are blue or red, but NOT green, AND they are Hondas. But this query is dynamic using keys. How do?
Map Function:
function(car) {
emit([car.color, car.make],car);
}
I can't find a way to format keys to make anything like this possible. I'm not married to this map function either, I just want to know how someone would handle a request like this on the fly. Do you have to just narrow it down as far as possible in Couch and then do more process with the returned data? Seems like there should be a way to do this...
One option would be to include the keys parameter with your query:
http://localhost:5984/cars/_design/all-cars/_view/by-color-and-make?keys=[["red","honda"],["blue","honda"]]
More likely though, you have a search page with a bunch of different characteristics, and the user is picking and choosing values to search by. They might choose 4 door, all wheel drive, and priced below 10,000.
You won't be able to make views to satisfy all the different combinations. couchdb-lucene is a good option to solve this problem.
And if you use cloudant.com, it's automatically included: https://cloudant.com/for-developers/search/

Saving files in xCode and making graph

I am new to programming. Now i have been learning for a few weeks and am now making my first app. Probably not for public, just for me. At least for now. So here it goes. I want the user to be able to enter his information (for example weight or something like that) into textField and then save it, so I can later form a graph (for example of weight loss through time). Now the graph should not be that much of a problem, since there are many tutorials on that. I am more interested in how to enter information, then save it so it can be later accessed. Any help? What should I read?
Thanks!
Working with UITextFields in Objective C is pretty straightforward - you can grab the NSString from such an object using the 'text' property. Use plists for storage locally, or JSON.
Look at core data tutorials especially related to Apples' doc on “Core Data and Cocoa Bindings”
CoreData shows how to setup objects and save them to a file or simple database. Cocoa Bindings are how to make input screens pass data to object models.
You should be able to write a program to enter weights, save them and show in a table without writing any code.

Cursors for data selection in matplotlib

I am trying to get user input from matplotlib XY plot. The plot contains multiple datasets and I need get from user selection of which dataset to use and the range. I need this to fit model to right dataset and range.
Therefore I need two indicators, which would be "attached" to specific dataset, per user choosing. I need to get from them both the dataset info and the range info.
Somehow in line with what commercial plotting packages (Igor Pro, Kaleidagraph, Sigmaplot...) provide as "cursors" and similarly named widgets for control of their fitting interface, which is what I am trying to reproduce.
I have checked various examples with rangeselector and other methods I was able to Google on the web, but none I was able to find seems to be able to provide what I need.
Would anyone have any pointers to where to look or what to start with, please?
You might want to look at this example: http://matplotlib.sourceforge.net/examples/pylab_examples/ginput_manual_clabel.html
The interesting functions are ginput, waitforbuttonpress.

Resources