cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
rosen0
Level II

Cannot generate Python Code for Boosted Neural Net model. Why?

After saving to the Formula Depot. I can generate C and Java code but not Pyhton code for my Boosted Neural Net model. Why?

I only get commented lines

 

 

 

def score(indata, outdata):
# Original name was: 'xxxxxxxx'
# Original name was: 'yyyyyyyy'

4 REPLIES 4

Re: Cannot generate Python Code for Boosted Neural Net model. Why?

Running the script below, I'm able to send this boosted neural net model to the formula depot, then generate Python code for it. Does the script below work for you?

dt = open ("$SAMPLE_DATA\Body Fat.jmp");

dt << Neural(
	Y( :Percent body fat ),
	X(
		:"Age (years)"n, :"Weight (lbs)"n, :"Height (inches)"n,
		:"Neck circumference (cm)"n, :"Chest circumference (cm)"n,
		:"Abdomen circumference (cm)"n, :"Hip circumference (cm)"n,
		:"Thigh circumference (cm)"n, :"Knee circumference (cm)"n,
		:"Ankle circumference (cm)"n, :"Biceps (extended) circumference (cm)"n,
		:"Forearm circumference (cm)"n, :"Wrist circumference (cm)"n
	),
	Informative Missing( 0 ),
	Validation Method( "Holdback", 0.3333 ),
	Fit( NTanH( 3 ), N Boost( 100 ) )
);
rosen0
Level II

Re: Cannot generate Python Code for Boosted Neural Net model. Why?

Interesting.  It does not work for me. I am using V17. This is what I get

 

""" Python code generated by JMP v17.0.0 """

def getModelMetadata():
return {"creator": u"Neural", "modelName": u"", "predicted": u"Percent body fat", "table": u"Body Fat", "version": u"17.0.0", "timestamp": u"2022-12-01T13:45:24Z"}


def getInputMetadata():
return {
u"Abdomen circumference (cm)": "float",
u"Age (years)": "float",
u"Ankle circumference (cm)": "float",
u"Biceps (extended) circumference (cm)": "float",
u"Chest circumference (cm)": "float",
u"Forearm circumference (cm)": "float",
u"Height (inches)": "float",
u"Hip circumference (cm)": "float",
u"Knee circumference (cm)": "float",
u"Neck circumference (cm)": "float",
u"Thigh circumference (cm)": "float",
u"Weight (lbs)": "float",
u"Wrist circumference (cm)": "float"
}


def getOutputMetadata():
return {
u"Predicted Percent body fat_1": "float"
}


def score(indata, outdata):

 

 

 

 

Re: Cannot generate Python Code for Boosted Neural Net model. Why?

On my machine, I get the same output. If you scroll down about 100 blank lines, you should see the actual formula in Pyhton script. I'm not sure why there would be so many blank lines. Can you confirm that you also see the same?

Jed_Campbell_0-1669906930369.png

 

rosen0
Level II

Re: Cannot generate Python Code for Boosted Neural Net model. Why?

Mystery solved.  I did not go down all the way. The code is there. 

Thank you