BookmarkSubscribeRSS Feed
cme0015
Calcite | Level 5

Hi all, I have an issue that may be born of simple ignorance. I am trying to get the Java Scoring Code from a Score Node. The C is there, Java Score is set to Y, but there is simply no option for the actual Java code. So at the moment under Java I am only getting "User-defined Formats" and "File Metadata." Does anyone know where this might be hiding? This is version 6.2 FYI.

 

8 REPLIES 8
ledfoot
SAS Employee

The EM Java scoring code is only available as a .class file. There is no .java file. The "Score Code" in the Results viewer is only a wrapper that calls the  "Java Class" file (DS.class) that does the actual scoring. Note, since the DS.class file is not created using a java compiler it cannot be reliably decompiled.

cme0015
Calcite | Level 5

Ok, but then I am confused.  If you look at page 20 of https://support.sas.com/documentation/onlinedoc/miner/em121/emcjscore.pdf it specifies:  

 

5.In the Java Score Code window, return to the list box at the bottom and change the setting from Scoring Function Metadata to Score Code.

6. From the Results window main menu, select File Save As and save the file as Score.java in the c:\temp\scorecode\jscore directory that you created at the beginning of this example.

 

So is that right or not?

ledfoot
SAS Employee

It’s close but it looks like you might have skipped a step in the instructions.

In the Java Score Code window there should be 5 choices in the drop down box.

Scoring Function Metadata

User-defined Formats

Score Code

File Metadata

Java Class

The "Scoring Function Metadata" is an XML description of the models Input variables and Output variables. It is very handy for automating things like choosing what data to feed the model when you run it. 

The "User-defined Formats" is Java code that is often just a stub unless your training data contains user defined formats.

The "Score Code" is Java code that invokes the model that is in the "Java Class".

The "File Metadata" is another XML file that describes the mime types of the other files.

The "Java Class" file is a binary java class file in which the actual model resides.  One way to think of it is as "pre-compiled" java code.

 

The instruction are trying to say ...

Save the "Scoring Function Metadata" as JScore.xml.

Save the "User-defined Formats" as JscoreUserFormats.java.

Save the "Score Code" as Score.java.

Save the "Java Class" as DS.class.

cme0015
Calcite | Level 5

Right, so that is what I am trying to do, but I only get two options in the drop down (please see attachments).  I do not want to use C, but sure, why not?  Except when I go to http://support.sas.com/kb/35/872.html to download cscore.h, the link fails.  FWIW, I strongly prefer Java.  The score node is input from a decision tree, so I am not sure what I am doing wrong to get my only 2 drop downs.


c.PNGjava.PNG
ledfoot
SAS Employee

Something is definately wrong. You should probably contact SAS Tech Support.

In the mean time can you share a pic of your EM flow and the log from the score node?

ledfoot
SAS Employee
What operating system is the EM server on?
cme0015
Calcite | Level 5

The OS is Linux x64.  I think this is the important part of the log:

 

TScore NOTE: Start Java code generation ........
PATHJSCORECODE.sas 1: Could not load class java/lang/Object.
PATHJSCORECODE.sas 1: Could not load class com/sas/ds/DSInterface.
PATHJSCORECODE.sas 1: Could not load class com/sas/ds/DSInterface.
ERROR:  TScore Java code generation failed, attempting error termination.


*------------------------------------------------------------*
* Warning: A problem was encountered while generating the Java score code.
*------------------------------------------------------------*

 

Does this just mean we are missing some kind of config file?

ledfoot
SAS Employee
I looks like you are going to need Tech Support to figure out how to configure your system correctly. The errors indicate that the DTJ_CLASSPATH was not setup correctly when the system was installed.


sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 1542 views
  • 0 likes
  • 2 in conversation