Skip to content

Instantly share code, notes, and snippets.

View myui's full-sized avatar

Makoto YUI myui

View GitHub Profile

Preparation

Install required softwares

GPG and Maven, JDK 7 is mandatory for verification

brew install gpg gpg-agent pinentry-mac
brew install maven
brew install md5sha1sum
@myui
myui / dynamo_lr.md
Last active February 5, 2018 04:46

予測モデルの作成 (毎日 過去2-3週間分でモデルを作成)

WITH train_input as (
	select
		array_concat(
			array('bias'),
			categorical_features(
				'hour', 'week',
 hour, week
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@myui
myui / bprmf.md
Last active March 12, 2018 07:06
use movielens;

select max(movieid) from ratings;
> 3952

-- list popular items
WITH t as (
  select 
    movieid as itemid,
package puzzle;
import java.util.LinkedList;
import java.util.Queue;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.base.Preconditions;
create table model 
as
select 
 feature,
 voted_avg(weight) as weight
from 
 (select 
     -- hinge loss by the default
     train_classifier(add_bias(features),label,'-iter 20') as (feature,weight)