Comments (7)
The exception is also sent to openscoring log file. What does it say?
I have a reason to think that your PMML file is invalid. More specifically, there's something wrong with the DataDictionary
element (does not contain any DataField
child elements?). Could you share your PMML file?
Every activeField
object should provide id
, dataType
and opType
mappings:
"activeFields" : [
{
"id" : "hsa-miR-16-2-3p",
"dataType" : "double"
"opType" : "continuous"
}
]
For some reason, there is no dataType
mapping in your model response.
from openscoring.
Thank you for your quick response. Here it is (I had to change extenstion to txt):
NeuralNetwork.txt
from openscoring.
I have reminded myself of my previous issue with STATISTICA (#4) and added dataType=""
in all DataField
s. Now I have new message:
{
"message" : "NeuralLayer"
}
from openscoring.
There's no point in adding empty dataType=""
to all DataField
elements.
You should add dataType="double"
to continuous fields, and dataType="string"
to categorical fields.
from openscoring.
I tried evaluating your NN model with the example data record. The exception message "NeuralLayer" is another InvalidFeatureException, which is raised because the second NeuralLayer doesn't specify the activationFunction
attribute.
Am I correct to assume that both neural layers use tanh
activation function?
<NeuralLayer numberOfNeurons="2" activationFunction="tanh" normalizationMethod="softmax">
Anyway, after defining this attribute, the example data record evaluates to the following result:
{
"id" : "Uw4Fz",
"result" : {
"2 group" : "Controls+Borderline"
}
}
from openscoring.
What should we do about STATISTICA neural network models then? Every time you train a new model, you must to do the following:
- Add missing
DataField@dataType
attributes. - Add missing
NeuralLayer@activationFunction
attributes.
This correction work could be automated by developing a special-purpose JPMML-Model Visitor class:
public class StatisticaCorrector extends AbstractVisitor {
@Override
public VisitorAction visit(DataField dataField){
if(dataField.getDataType() == null){
OpType opType = dataField.getOpType();
switch(opType){
case CONTINUOUS:
dataField.setDataType(DataType.DOUBLE);
break;
case CATEGORICAL:
dataField.setDataType(DataType.STRING);
break;
}
}
return super.visit(dataField);
}
@Override
public VisitorAction visit(NeuralLayer neuralLayer){
if(neuralLayer.getActivationFunction() == null){
neuralLayer.setActivationFunction(ActivationFunctionType.TANH);
}
return super.visit(neuralLayer);
}
}
If you register this JPMML-Model Visitor class in Openscoring configuration file, then all the uploaded STATISTICA neural network models would be corrected automatically.
from openscoring.
Thank you. All is working now.
from openscoring.
Related Issues (20)
- Excess use of memory by pmml.gz files HOT 1
- Openscoring war deployment on Tomcat- admin role authorization HOT 2
- get the predictions results HOT 1
- [Question] Default folder for loading models? HOT 1
- tensorflow serving support HOT 2
- Client side throw an exception that java.lang.IllegalStateException: InjectionManagerFactory not found. HOT 2
- .pmml not reconize on upload
- Is there a configuration for enabling/disabling REST endpoints HOT 1
- Error: SEVERE: Failed to evaluate java.lang.NumberFormatException: For input string: "X" HOT 2
- feature request: add deploy method - pip/docker HOT 2
- How to enable CORS for the Server HOT 1
- the lastest jar version 2.0 "xgbValue" is not defined HOT 1
- Missing field when trying to score lightgbm model HOT 9
- IllegalArgumentException: Attribute 'GradientBoostingClassifier.loss_' has an unsupported value (Python class BinomialDeviance) HOT 1
- Service should log information about exceptional conditions before raising an exception HOT 6
- "message" : "Attribute with value RegressionTable@targetCategory=1 is not valid" HOT 4
- How to define the model.version? HOT 1
- openscoring-docker -- PMML 4.4 not supported HOT 1
- Missing derived field declaration HOT 2
- Secured requests HOT 1
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 openscoring.