Load a catboost model in nodejs to make a prediction

hello there i hope to get a response , i have a jupyter notebook that i’m saving off of it a catboostclassifier model in a .h5 format json file , i want to load this model file in nodejs and use it to predict results off of inputs that i insert !! I have been researching about this for litterly a week , can anyone here help me ? Do you know anything about what i’am talking about , i need to know what are the libraries that i can use to load this model in nodejs (P.S: i already tried tensorflowjs but it doenst work and i dont think its compatible or something like that , i have an unsolvable error when i worked with it ) I can load the code and the error here if you want .
Thnk you so much .

There is an old nodejs package that wraps catboost (https://github.com/quickdevel/node-catboost) (don’t think it still is compatible with new versions of catboost, but you can try)

Just curious, why do you want to use nodejs for this part, it is easier to use python for this part. There are a tutorials on how to create a microservice/api for predictions with python, and then you can use this in a bigger project (for example your nodejs project) via http calls

thak you so much for your reply !!
my goal is to create a dashboard (html) that will consume the fonction in which i create the predictions , i want to input data via a web interface and diplsay the result that the IA model gives back so i thought to save the model from my jupyter notebook in a h5 file and to load the file in a node sever and give my inputs in the node function and get the result and give it back to the html page .
Can i send data from html page to python notebook and then get predictions without having to go via node js ? thank you !!

Depending on what exactly you want to do, they are several options. The easiest and quickest I know of is a project called voila (https://voila.readthedocs.io/en/stable/) .
It allows you to create a dashboard directly from a notebook, without the need to implement a backend server. It uses ipywidget to achieve interactivity.

If this is too restricted for you, I would try to use one of the many python web frameworks (django, flask, responder) and implement the prediction there, and then create the front end.

If you are comfortable with javascript, probably creating a website that uses ajax to call an api created with flask or responder is the easiest option.

Let me know if voila seems good, and if I should try and find some tutorials for using flask and fastai2.

Cheers :slight_smile:

Thank you for your answer once again !!
i will instantly start a trial with voila and if it is a good solution i will write back to you .
The reason why i started working with node because my boss adviced me to because it is an evolving and rapid technology and i even suggested flask but he sed it was retrograding and people don’t use it anymore , instead node is more optimal . But the problem with node is that there is no documentation about these kind of IA model loading (espacially with catboost )whatsoever and even the link that you gave me about node catboost is very vague and you have to do most of the work by yourself and i succedded to load the model with it , but i’m stucking at the prediction part , how to pass the data to the predction method .
Any ways thank you so much and i’ll keepu you updated about how it went .

1 Like