Comments (3)
Your PMML looks fine in this regard.
The important thing to understand is that Evaluator#getActiveFields()
defines the "public API" of your NN model, whereas NeuralInput
elements define the first layer of the "private API" of your NN model.
For example, take the "TxnChannelCodeATM" field. The first element of Evaluator#getActiveFields()
is an org.jpmml.evaluator.InputField
object, that has name=TxnChannelCodeATM
, opType=categorical
and dataType=string
; there are further Evaluator API methods that let you query its valid value space, which would be returned as a set of ATM
, POS
and OnL
. If you execute your NN model then you would specify the corresponding input value like this:
Evaluator evaluator = ..
Map<FieldName, Object> arguments = ...
InputField tccaInput = (evaluator.getInputFields()).get(0); // In real life, use field name-based lookup, not positional lookup
arguments.put(tccaInput.getName(), tccaInput.prepare("POS"));
Map<FieldName, ?> result = evaluator.evaluate(arguments);
The NeuralNetwork
element takes the input value from "public API" layer and can do whatever it likes with it in "private API" layer. Typically, categorical input values are one-hot-encoded, which means that the "TxnChannelCodeATM" would be expanded into three binary indicator fields TxnChannelCodeATM==ATM
, TxnChannelCodeATM==POS
and TxnChannelCodeATM==OnL
(these are your first three NeuralInput
elements). However, an NN model might choose to ignore some categories, combine several categories into one, compute interactions between the categories of different input fields etc.
Some other notes. You don't need to set various "numberOf" attributes such as DataDictionary@numberOfFields
, NeuralInputs@numberOfInputs
, NeuralLayer@numberOfNeurons
, NeuralOutputs@numberOfOutputs
etc. Also, you define 131 NeuralInput
elements, but only use 10 of them (referenced via Con@from
attributes, on lines 2026 -- 2048). Perhaps your NN model is missing some middle layers?
from jpmml-evaluator.
Thanks @vruusmann. When i debug this code
InputField tccaInput = ((evaluator.getInputFields()).get(0));
I do see values of the categorical field like ATM,POS in values array but i am not able access them. Is that method not exposed??
from jpmml-evaluator.
What exactly do you mean by "not able to access them"? Did you use the code example that is provided in the "Querying the data schema of models" section of README.md file?
Anyway, the lesson here is that you're only supposed to care about model input fields at a "public API" level. If the Evaluator#getInputFields()
returns a 100-element list, then this is the information that you're supposed to work with. Internally, a NN model may keep those 100 input values as-is, or expand them to 132 transformed input fields (eg. by binarizing the values of categorical input fields) - it's a low-level algorithmic detail.
from jpmml-evaluator.
Related Issues (20)
- How to work with an association rules model (`AssociationModel` element)? HOT 8
- JPMML is enforcing the definition of target fields while the spec says it is optional HOT 6
- jpmml-evaluator does not handle null values when used in java? HOT 1
- Ability to run multiple JPMML-Evaluator versions in parallel (inside the same JVM) HOT 1
- NumberFormatException for evaluate "Random Survival Forest Model" generated by "SoftwareAG PMML Generator" HOT 3
- Compatibility with GraalVM HOT 12
- Not happy with XGBoost evaluation performance HOT 3
- How to load pre-transpiled PMML service provider JAR files? HOT 2
- Model verification fails for XGBoost models HOT 1
- No class def found for jakarta/xml/bind/JAXBContext HOT 3
- java.lang.IllegalArgumentException: Name cannot be empty HOT 1
- java.lang.NoClassDefFoundError: Could not initialize class org.jpmml.evaluator.FieldUtil HOT 4
- If the version 1.6.4 could work on java 8? HOT 1
- Field pmml(pred) is not defined. HOT 5
- DuplicatedFieldValueException after loading PMML in Java generated by Nyoka HOT 8
- 1.6.4 cannot run on java 8
- Exception: Required attribute `Segmentation@multipleModelMethod` is not defined HOT 3
- Updating Guava dependency to latest HOT 4
- why create jar file create error HOT 1
- LoadingModelEvaluatorBuilder not usable on Android due to "java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/Image" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpmml-evaluator.