여러분, 안녕하세요,
신경망 기능을 사용하여 JMP에서 Python 코드를 내보냈습니다. Spyder에서 코드를 실행하려고 하는데 "jmp.mz"라는 함수가 있고 대체하는 방법을 모르겠습니다. 이 기능이 무엇인지 모르겠습니다.
누구든지 이것으로 나를 도울 수 있습니까? 시간 내주셔서 미리 감사드립니다.
좋은 하루 되세요.
앨리슨
나는 당신이 무엇을했는지 잘 모르겠습니다. Big Class를 예로 사용했습니다. 내가 모델 :무게 ~와 함께 :나이 , :섹스 , 그리고 :키 입력으로. 모델을 Formula Depot에 게시했습니다. 파이썬 코드를 생성했습니다. 여기있어:
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"]
질문하신 기능이 보이지 않습니다.
mz() 함수는 점수 코드의 첫 번째 줄에서 가져온 jmp_score.py에 정의되어 있습니다.
import jmp_score as jmp
다음 위치에서 jmp_score.py를 찾을 수 있습니다.
맥
/Library/Application Support/JMP/17/scoring/Python
윈도우
C:\Program Files\SAS\JMPPRO\17\Scoring\Python