Re: std err formula into pythonHi @Jerry_Winter
Based on this error, I believe you must be using an earlier version of JMP - JMP 13.0 or JMP 14.0. Would you be able to try a newer version?
These functions were added to the Python code generation engine in JMP 14.1. Starting with this version, the following options should all generate fully functioning Python code:
1) the following models should now be working, in addition to the "fast
formulas" Neural Networks (both numeric as well as categorical):
* Analyze->Fit Model Fit Model - Standard Least Squares Standard Error Formula
* Analyze->Fit Model Fit Model - Standard Least Squares Mean Confid Limit
Formula
* Analyze->Fit Model Fit Model - Standard Least Squares Indiv Confid Limit
Formula
* Analyze->Specialized Modeling Gaussian Process Variance Formula
* Analyze->Multivariate Methods Principal Components Components Formulas
(PCA_wide)
* Analyze->Multivariate Methods Discriminant Probability Formulas Discriminant
std err formula into Python or Java scriptI want to write out a standard error formula in python. The formula depot functionality does not know what to do with the "Vec Quadratic", "Concat" or "Design Nom" operators but appears to write everything else out OK. Does anyone know how I could edit the python with equivalents or how to break them down into operations python can deal with?
I noticed a line in the JMP 14 Predictive and Specialized Modeling book about use of the NumPy python library for advanced operators. How could I deploy it to supplement the python translator in formula depot or do I have to use it the reference the equivalent operators and edit the python script myself? I guess I have to make sure the library is available when I want to run the script?
What would be the equivalent solutions to this std err formula problem in Java script which has issue with the same operators?
Re: std err formula into pythonThanks.
Sadly, I have 14.0.0. Working in a large corporation it will be a problem getting hold of 14.1 + in a timely manner. Is there any way I could send someone the formulae (10 of them) and return me the functioning Python and/or Java script code?Re: std err formula into pythonThanks. You were right and I got 14.3 up and running but although the python translator looked like it was going to be happy with the "Vec Quadratic", it still did not know how to handle the "H Direct Product" operator. Any other thoughts on how to proceed?Re: std err formula into pythonTo create implementations for placeholder functions, you can start by searching the JMP doc for technical details and examples. Ideally, this should provide enough detail for you to come up with a matching implementation. The next step would be to run a few tests using JSL to capture their results for known inputs (including edge cases like missing values) and then comparing those results with the results of your implementation. The final step would be to compare the results of the whole JSL version of the JMP model with the score code that was augmented to use your placeholder implementation.
We understand this is not a trivial amount of work. If you want to deploy a model that is generating non-trivial placeholder function calls, please approach your tech support or add an entry to the JMP Wish List.
For this particular scenario, the on-line doc for the "H Direct Product" operator says that:
H Direct Product(A,
Description
Horizontal direct product of two square matrices of the same dimension or scalars.
The Scripting Index adds an example:
Names Default To Here( 1 );
exA = [1 2, 3 4];
exB = [1 1 1, 2 2 2];
exProd = H Direct Product( exA, exB );
Show( exProd );
/* verify result */
Show(
exProd[1, 1 :: 6] == Direct Product( exA[1, 1 :: 2], exB[1, 1 :: 3] )
);
Show(
exProd[2, 1 :: 6] == Direct Product( exA[2, 1 :: 2], exB[2, 1 :: 3] )
);
A search for "NumPy Direct Product" points to this function:
It looks like a direct translation. So I would start with creating an implementation based on the numpy.kron function, and validate using the example and then a comparison of known inputs and outputs.
I hope this gets you in the right direction!
Re: std err formula into Python or Java scriptRe: NumPy dependency. You could use the NumPy doc as a starting point to create your own versions, but I would strongly suggest that first you check for a way to make it available in your deployment environment. We choose to use NumPy because it provides a huge boost to the performance of the generated model, while supporting a large reduction in their size.
NumPy is one of the most popular Python numeric libraries so nowadays it is a lot easier to get a working version of it. Usually, it is just as simple as "pip install numpy" or "conda install numpy".
If you are deploying to AWS Lambda (a great way to run your models in the cloud; check the materials of our St. Louis tutorial), look into their recent Layers feature which was created precisely to facilitate the use of common libraries such as NumPy. The final answer really depends on your deployment scenario.
Re: JavaScript, we don't have support for linear algebra operators in that language. If you are considering it as a deployment target, I'd encourage you to add an entry with details (web? node.js?) to the JMP Wish List. In the meantime, I would look for a library with high-level, optimized operators such as NumJs or MathJs.
Re: std err formula into pythonYou don't need to be the JMP administrator of your org to get patches.
You can upgrade your JMP 14.0 to 14.1 (or better yet 14.0 to 14.3) from here yourself: https://support.sas.com/downloads/package.htm?pid=2368