How can we do batch predictions in clickhouse?

I followed the tutorial of clickhouse integration with minds DB. I have a couple of question. Apologies if this is very rudimentary I am very new to minds db.

  1. Is there any way to get batch predictions, currently we get result for a single query only.
  2. I was also wondering if there are any features that does similarity score with the trained data or how we could do something like like look-a-like with minds db

Thanks it looks like a very interesting library

1 Like

Hello @shaweln and welcome to the MindsDB forum. Actually, those are great questions.
At this moment we have two ways to make a batch prediction:

  1. First is using ‘select_data_query’ in ‘where’. Here you will need to specify select statement as text, for example:
    select rental_price from mindsdb.rental_price_predictor where select_data_query = ‘select sqft, number_of_rooms, location from rental_price_data order by publish_date limit 5’
    If you use ‘select_data_query’ in ‘where’, then there should be no other conditions. The requirements to query in ‘select_data_query’ is:
  • it must be a valid SQL statement
  • it must return columns with names the same as predictor fields.
  1. Second is using existing ‘external_datasource’ in where. Like ‘select_data_query’, it should be the only statement in ‘where’. Here you can specify any existing MindsDB datasource. So you can do the following:
  • prepare csv file with data for prediction e.g:
sqft,numver_of_rooms,location
1000,3,good
800,2,great
  • add it as datasource using python module or Scout.
  • make query:
    select rental_price from mindsdb.rental_price_predictor where external_datasource = ‘ds_name’;

For the second question, we don’t have a specific similarity score but you can check MindsDB Scout. After starting MindsDB, Scout should be accessible on http://localhost:47334/static/index.html. There we have explainability features like data analysis, data quality, prediction results like model accuracies, what’s relevant to the model, when can you trust it etc.

Hi Zoran,

Thanks for the info. Batch works great now. I was not able to get MindsDB Scout working though. http://localhost:47334/static/index.html has error response. I am using docker mindsbd:stable does it exist there? I can see swagger working for using the API.

Best

1 Like

Hello @shaweln. It’s great to hear that batch predictions are working great for you. The latest Docker image should work with Scout but Scout will be downloaded only when the container starts not when building the image. We are working on improvements to our Docker and also docs for it to make it more user friendly and extendable. If you still got some issues please share the error you are getting.

Hi @Zoran thanks for the reply

Here is the log i am getting on start up. docker pull mindsdb/mindsdb:stable which seems to be updated recently. The API seems fine but the /static/index.html is a 404

1 Like

Hello @shaweln. We have fixed some of the redirections issues we got when accessing Scout on the localhost. Please get the latest version and see if that works for you.

Hi @Zoran

Is docker updated? I am using stable tag from here. https://hub.docker.com/r/mindsdb/mindsdb/tags
I see no change on my part.

Hi @shaweln,

Thank you, I realize that it is not up to date, we will work on making sure that is up to date are we publish new versions,
in the meantime you can check or great if you help us with this issue:

1 Like