Fit data into ND4J to get prediction of the model

I’m newbie to DL4J, i read the document, i searched for the answer but i coudnt find it. I want to ask a question please. I have this file comme Json
“asset”: {
“customer”: {
“ID” : 4751060,

I also have a model H5 to import into MultiLayerNetwork model. I need to transform the json file into numeric so that i can put into ND4J ? to do model.output(input)
I also watch some solution, but i dont understand how can be the same (Like the data transform in model H5 and the data transform in Json). Thank you in advance!

@LEphongsac breaking this down a bit…your question is a bit confusing. I would need clarity on what you’re confused on regarding model import. Model import is just for loading the model in.

For conversion of your data in to a dataset, it sounds like you have a model and you’re asking how to create a data pipeline similar to what you already have in python? If so, do you have some pandas code already laying around?

It’s kind of hard to understand what you want here. Do you need help converting the data to an ndarray?
It looks like you’re trading securities here? In here you have some categorical data, usually you convert that to one hot,.

Depending on your task, (forecasting or what have you) you would need to figure out what your target is. Is that going to be a price? Are you doing classification?

If you can elaborate more I’m happy to help.

Thank you for your reply and sorry for my bad explaination.
I am asking how to create a data pipeline similar to what i already have in python. But my pipeline in python hasnt finished yet, though i still want to know how can it be similar to each other.

My task is to create a model which can base on the database and tell exactly that the client will resigne the contract or not. So in python, i will transform and feed the model with the data in database. And with DL4J, i need to use the json like i mentionned before, and convert it to an ndarray (the way the model can understand), so that the model can analyse this json.

I don’t know if you can understand my thought, and sorry again for my English

This might help you: Quickstart with Deeplearning4J – dubs·tech

The example used in that quick start guide uses the same kind of data as I expect you’ll be using.

You can start with the data the example uses to get accustomed to the way data loading works, and then you can switch to your data.

@LEphongsac I would perfect your pipeline in python first. If you want to, you can actually just use python4j to directly embed that pipeline in to a script and output an ndarray:

You can see the quickstart for that above.

Then if your pipeline is set you can consider migrating over to a transform process. At that point you can follow Paul’s tutorial. If you can post more I can point to more specific data points.

Thank you for your reply, i’ll take a look this example

Thank you, i’ll will try to go further, ill show you more point if i has a problem, Thank you for the example

Do you have any example in detail for the python4j, pls ?

Otherwise, I have a database with plein of data, and each categorical data have like 30 40 differents value, so i cant use like one hot code. And i do see the example of using schema with add categorical column, but its difficile because i cant write on my own 30 40 different value and change it to integer.

In python, I use catboost to transform categorical data to numeric. So, can I import the database into java, use some algorithme like catboost to transform categorical data to numeric (so that when i put my data to predict, it can transform just like the way it transform the database). And i use the same algorithme in Python to train the model (So that the result of this transformation would be the same with java => the same with the data that i want to predict).

Sorry if its hard to understand. Thank you for giving me some advices.


Just ensure you have the relevant version of conda installed and the python path setup + have the python version match ours when we execute.

1 Like