0
votes

In Google BigQuery, when I enter the following query I get the following error. How can I solve this problem?

Thanks,

Josh

CREATE MODEL `finance-ml-jdb:FOREX.EURGBP_Model`
      OPTIONS( model_type         = 'linear_reg',
               input_label_cols   = ['bidclose'],
               ls_init_learn_rate = .15,
               l1_reg             = 1,
               max_iterations     = 5
              ) AS
SELECT
    bidopen,
    bidhigh,
    bidlow,
    askopen,
    askclose,
    asklow,
    tickqty
FROM `finance-ml-jdb.FOREX.EURGBP`

An internal error occurred and the request could not be completed.

1
File a bug on the issue tracker with a job ID. - Elliott Brossard

1 Answers

1
votes

The problem is in your SELECT statement - it is missing bidclose field in the output while it is defined as a label for a model

Just add it into SELECT list and you should be good (unless something else will come up - like - as an example - having NULL values for bidclose in some rows - so you can add WHERE NOT bidclose IS NULL)

Also fix below line to use . instead of :

CREATE MODEL `finance-ml-jdb.FOREX.EURGBP_Model`    

If this still does not help - try to run with default values like below

CREATE MODEL `finance-ml-jdb.FOREX.EURGBP_Model`
      OPTIONS( model_type         = 'linear_reg',
               input_label_cols   = ['bidclose']
              ) AS
SELECT
    bidopen,
    bidclose,
    bidhigh,
    bidlow,
    askopen,
    askclose,
    asklow,
    tickqty
FROM `finance-ml-jdb.FOREX.EURGBP`