Skip to content

Instantly share code, notes, and snippets.

View myui's full-sized avatar

Makoto YUI myui

View GitHub Profile
#!/bin/bash
# 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
#!/bin/bash
# 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@myui
myui / csr_matrix.py
Last active December 17, 2015 13:21
>>> d.toarray()
array([[2, 1, 0, 0],
[0, 1, 1, 1]])
>>> c.toarray()
array([[2, 1, 0, 0],
[0, 1, 1, 1]])
>>> d
<2x4 sparse matrix of type '<type 'numpy.int64'>'
with 5 stored elements in Compressed Sparse Row format>
16/02/08 11:28:19 INFO ApplicationMasterService: Starting Application Master
16/02/08 11:28:19 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/02/08 11:28:19 INFO RMProxy: Connecting to ResourceManager at dm01/10.14.1.38:8030
16/02/08 11:28:20 INFO ApplicationMasterService: Registered ApplicationMaster: maximumCapability { memory: 15360 virtual_cores: 32 } queue: "default" scheduler_resource_types: MEMORY
16/02/08 11:28:20 INFO NMClientAsyncImpl: Upper bound of the thread pool size is 500
16/02/08 11:28:20 INFO ContainerManagementProtocolProxy: yarn.client.max-cached-nodemanagers-proxies : 0
16/02/08 11:28:22 INFO AMRMClientImpl: Received new token for : ip-10-14-130-102.ec2.internal:60563
16/02/08 11:28:22 INFO AMRMClientImpl: Received new token for : ip-10-14-129-101.ec2.internal:48201
16/02/08 11:28:22 INFO AMRMClientImpl: Received new token for : ip-10-14-130-107.ec2.internal:54722
16/02/08 11:28:22 INFO ApplicationMasterServi
WITH t1 as (
SELECT
rowid() as rowid,
t.stateholiday, t.store, t.promo, t.dayofweek, t.date, t.schoolholiday, t.sales,
SUBSTR(t.date,1,4) as year,
SUBSTR(t.date,6,2) as month,
SUBSTR(t.date,9,2) as day
FROM
train_original t
WHERE sales != 0
WITH train_ordered as (
select * from training2
order by rowid asc
),
train_quantified as (
select
t0.rowid,
t0.sales,
t2.*,
t0.competitiondistance
@myui
myui / make_model.sql
Last active December 23, 2018 03:22
INSERT OVERWRITE TABLE model
SELECT
-- C: Categorical Variable, Q: Quantitative Variable
train_randomforest_regr(features, label, '-trees 20 -attrs C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,Q')
FROM
training3
UNION ALL
SELECT
train_randomforest_regr(features, label, '-trees 20 -attrs C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,C,Q')
FROM
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
INSERT OVERWRITE TABLE testing2
SELECT
rowid() as rowid,
t1.id,
t1.stateholiday, t1.store, t1.promo, t1.dayofweek, t1.date, t1.schoolholiday,
SUBSTR(t1.date,1,4) as year,
SUBSTR(t1.date,6,2) as month,
SUBSTR(t1.date,9,2) as day,
t2.promo2sinceweek,
t2.competitionopensinceyear,