hivemall icon indicating copy to clipboard operation
hivemall copied to clipboard

add Grid search UDTF.

Open myui opened this issue 11 years ago • 1 comments

create table hyperparams
as
WITH dual as (
  select 1
)
select
  gridsearch(array('linear','kernel'), array('lambda 1', 'lambda 2'))
    as params
from
  dual
;

create table hyperparams as
select '-linear -lambda 1' 
union all
select '-linear -lambda 2'
union all
select '-kernel -lambda 1'
union all
select '-kernel -lambda 2'
create table model
as
WTH t as (
select
  train_xxx(t.features, t.label, p.params)
    as (params, feature, weight)
from
  hyperparams p
  LEFT OUTER JOIN -- assume CROSS JOIN using map join
  training t
)
select
  params,
  feature,
  avg(weight)
from
  m
group by
  params, feature
;

myui avatar Sep 29 '13 13:09 myui

hyperparams in presto ml https://youtu.be/6NYXYZT0n4A?t=10m51s

myui avatar May 12 '16 10:05 myui