Clickhouse: High version is not compatible with CatBoost

Created on 8 Jan 2020  Β·  2Comments  Β·  Source: ClickHouse/ClickHouse

  • With the following config, we can use a trained catboost model to predict data.
cat catboost/models/trips_price_model.xml
<models>
    <model>
        <!-- Model type. Now catboost only. -->
        <type>catboost</type>
        <!-- Model name. -->
        <name>trip_price</name>
        <!-- Path to trained model. -->
        <path>/data1/clickhouse/catboost/models/trip_price.bin</path>
        <!-- Update interval. -->
        <lifetime>0</lifetime>
    </model>
</models>
  • result
SELECT
    modelEvaluate('trip_price', trip_distance, toYear(pickup_datetime), cab_type) AS prediction,
    total_amount
FROM trips_mergetree_all
LIMIT 5

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€prediction─┬─total_amount─┐
β”‚  9.245315066134815 β”‚          9.2 β”‚
β”‚ 10.368612172918901 β”‚         10.8 β”‚
β”‚  9.931151401302877 β”‚          8.8 β”‚
β”‚ 18.997186263989573 β”‚         14.5 β”‚
β”‚   7.11047499713387 β”‚          6.3 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

5 rows in set. Elapsed: 0.009 sec.


SELECT version()

β”Œβ”€version()──┐
β”‚ 19.11.9.52 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • but the higher version can not parsed the catboost model config file.

  • error.log

2020.01.08 14:24:15.691965 [ 1 ] {} <Warning> ExternalModelsLoader: /data1/clickhouse/catboost/models/trips_price_model.xml: file contains unknown node 'model', expected 'models'
SELECT version()

β”Œβ”€version()────┐
β”‚ 19.19.1.1957 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

1 rows in set. Elapsed: 0.002 sec.


SELECT
    modelEvaluate('trip_price', trip_distance, toYear(pickup_datetime), cab_type) AS prediction,
    total_amount
FROM trips_mergetree_all
LIMIT 5

Received exception from server (version 19.19.1):
Code: 36. DB::Exception: Received from 127.0.0.1:9000. DB::Exception: external model 'trip_price' not found.

image

bug comp-ml

All 2 comments

Confirm, have the same issue with

SELECT version()

β”Œβ”€version()──┐
β”‚ 19.17.6.36 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

That was the reason: https://github.com/ClickHouse/ClickHouse/commit/42692ad07b6e37fe3697c6611fcc672f358048bb
Unfortunately, I've missed the slides source, so can't fix mistake there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fizerkhan picture fizerkhan  Β·  3Comments

vvp83 picture vvp83  Β·  3Comments

zhicwu picture zhicwu  Β·  3Comments

SaltTan picture SaltTan  Β·  3Comments

vixa2012 picture vixa2012  Β·  3Comments