<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JMP functions (neural network) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-functions-neural-network/m-p/649224#M84164</link>
    <description>&lt;P&gt;I am not sure what you did. I used Big Class as an example. I modeled &lt;STRONG&gt;:weight&lt;/STRONG&gt; with &lt;STRONG&gt;:age&lt;/STRONG&gt;, &lt;STRONG&gt;:sex&lt;/STRONG&gt;, and &lt;STRONG&gt;:height&lt;/STRONG&gt; as inputs. I published the model to Formula Depot. I generated Python code. Here it is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;from __future__ import division
import jmp_score as jmp
from math import *
import numpy as np

""" ====================================================================
 Copyright (C) 2022-2023 JMP Statistical Discovery LLC. All rights reserved.
 
 Notice: The following permissions are granted provided that the above
 copyright and this notice appear in the score code and any related
 documentation. Permission to copy, modify and distribute the score
 code generated using JMP (r) software is limited to customers of JMP
 Statistical Discovery LLC ("JMP") and successive third parties, all
 without any warranty, express or implied, or any other obligation by
 JMP. JMP and all other JMP Statistical Discovery LLC product and
 service names are registered trademarks or trademarks of JMP
 Statistical Discovery LLC in the USA and other countries. Except as
 contained in this notice, the name of JMP shall not be used in the
 advertising or promotion of products or services without prior
 written authorization from JMP Statistical Discovery LLC.
 ==================================================================== """

""" Python code generated by JMP 17.2.0 """

def getModelMetadata():
	return {"creator": u"Neural", "modelName": u"", "predicted": u"weight", "table": u"Big Class", "version": u"17.2.0", "timestamp": u"2023-06-22T15:05:18Z"}

def getInputMetadata():
    return {
        u"age": "float",
        u"height": "float",
        u"sex": "str"
	}

def getOutputMetadata():
    return {
        u"Predicted weight": "float"
	}

def score(indata, outdata):

    sex_asCode = jmp.match(indata[u"sex"],{u"F":0,u"M":1}, np.nan)

    H1_1 = tanh((12.9380978259799 + -0.216077718694819 * indata[u"height"] + 0.5 * jmp.match(indata[u"age"],{12:-0.0752869145775503,13:1.43808466048513,14:2.51676030243735,15:1.74966392837427,16:-3.99748804536747,17:-1.63173393135173}, np.nan) + 0.5 * jmp.match(sex_asCode,{0:-1.0888433588967,1:1.0888433588967}, np.nan)))

    H1_2 = tanh((19.7761183161641 + -0.331952318291445 * indata[u"height"] + 0.5 * jmp.match(indata[u"age"],{12:-0.476738410666868,13:-2.86567218066002,14:0.848951695382413,15:1.24849250460232,16:6.92106266494234,17:-5.67609627360018}, np.nan) + 0.5 * jmp.match(sex_asCode,{0:1.56127362393991,1:-1.56127362393991}, np.nan)))

    H1_3 = tanh((1.43246192499634 + -0.037575857404148 * indata[u"height"] + 0.5 * jmp.match(indata[u"age"],{12:-0.519079596013513,13:-2.26923722344442,14:3.65113577518731,15:2.78561481785367,16:1.59523547291602,17:-5.24366924649907}, np.nan) + 0.5 * jmp.match(sex_asCode,{0:-0.207032194138191,1:0.207032194138191}, np.nan)))

    outdata[u"Predicted weight"] = 100.343111337815 + -28.0586522707582 * H1_1 + -16.1719623964746 * H1_2 + 2.89859037837539 * H1_3

    return outdata[u"Predicted weight"]


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I do not see the function you asked about.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2023 15:11:10 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2023-06-22T15:11:10Z</dc:date>
    <item>
      <title>JMP functions (neural network)</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-functions-neural-network/m-p/644450#M84120</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I exported a python code from JMP with a neural network function. I am trying to run the code on Spyder but there is a function called "jmp.mz" and I don't know how to replace it. I do not know what this function does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me with this ? Thank you in advance for your time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alyson&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 07:38:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-functions-neural-network/m-p/644450#M84120</guid>
      <dc:creator>BathyAly</dc:creator>
      <dc:date>2023-06-21T07:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: JMP functions (neural network)</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-functions-neural-network/m-p/649224#M84164</link>
      <description>&lt;P&gt;I am not sure what you did. I used Big Class as an example. I modeled &lt;STRONG&gt;:weight&lt;/STRONG&gt; with &lt;STRONG&gt;:age&lt;/STRONG&gt;, &lt;STRONG&gt;:sex&lt;/STRONG&gt;, and &lt;STRONG&gt;:height&lt;/STRONG&gt; as inputs. I published the model to Formula Depot. I generated Python code. Here it is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;from __future__ import division
import jmp_score as jmp
from math import *
import numpy as np

""" ====================================================================
 Copyright (C) 2022-2023 JMP Statistical Discovery LLC. All rights reserved.
 
 Notice: The following permissions are granted provided that the above
 copyright and this notice appear in the score code and any related
 documentation. Permission to copy, modify and distribute the score
 code generated using JMP (r) software is limited to customers of JMP
 Statistical Discovery LLC ("JMP") and successive third parties, all
 without any warranty, express or implied, or any other obligation by
 JMP. JMP and all other JMP Statistical Discovery LLC product and
 service names are registered trademarks or trademarks of JMP
 Statistical Discovery LLC in the USA and other countries. Except as
 contained in this notice, the name of JMP shall not be used in the
 advertising or promotion of products or services without prior
 written authorization from JMP Statistical Discovery LLC.
 ==================================================================== """

""" Python code generated by JMP 17.2.0 """

def getModelMetadata():
	return {"creator": u"Neural", "modelName": u"", "predicted": u"weight", "table": u"Big Class", "version": u"17.2.0", "timestamp": u"2023-06-22T15:05:18Z"}

def getInputMetadata():
    return {
        u"age": "float",
        u"height": "float",
        u"sex": "str"
	}

def getOutputMetadata():
    return {
        u"Predicted weight": "float"
	}

def score(indata, outdata):

    sex_asCode = jmp.match(indata[u"sex"],{u"F":0,u"M":1}, np.nan)

    H1_1 = tanh((12.9380978259799 + -0.216077718694819 * indata[u"height"] + 0.5 * jmp.match(indata[u"age"],{12:-0.0752869145775503,13:1.43808466048513,14:2.51676030243735,15:1.74966392837427,16:-3.99748804536747,17:-1.63173393135173}, np.nan) + 0.5 * jmp.match(sex_asCode,{0:-1.0888433588967,1:1.0888433588967}, np.nan)))

    H1_2 = tanh((19.7761183161641 + -0.331952318291445 * indata[u"height"] + 0.5 * jmp.match(indata[u"age"],{12:-0.476738410666868,13:-2.86567218066002,14:0.848951695382413,15:1.24849250460232,16:6.92106266494234,17:-5.67609627360018}, np.nan) + 0.5 * jmp.match(sex_asCode,{0:1.56127362393991,1:-1.56127362393991}, np.nan)))

    H1_3 = tanh((1.43246192499634 + -0.037575857404148 * indata[u"height"] + 0.5 * jmp.match(indata[u"age"],{12:-0.519079596013513,13:-2.26923722344442,14:3.65113577518731,15:2.78561481785367,16:1.59523547291602,17:-5.24366924649907}, np.nan) + 0.5 * jmp.match(sex_asCode,{0:-0.207032194138191,1:0.207032194138191}, np.nan)))

    outdata[u"Predicted weight"] = 100.343111337815 + -28.0586522707582 * H1_1 + -16.1719623964746 * H1_2 + 2.89859037837539 * H1_3

    return outdata[u"Predicted weight"]


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I do not see the function you asked about.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 15:11:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-functions-neural-network/m-p/649224#M84164</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-06-22T15:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: JMP functions (neural network)</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-functions-neural-network/m-p/650466#M84173</link>
      <description>&lt;P&gt;the mz() function is defined in jmp_score.py which is imported in the first line of the score code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import jmp_score as jmp&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find jmp_score.py in:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;BR /&gt;&lt;STRONG&gt;Mac&lt;/STRONG&gt;&lt;BR /&gt;/Library/Application Support/JMP/17/scoring/Python&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;Windows&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;C:\Program Files\SAS\JMPPRO\17\Scoring\Python&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 18:38:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-functions-neural-network/m-p/650466#M84173</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2023-06-22T18:38:37Z</dc:date>
    </item>
  </channel>
</rss>

