Skip to content

Instantly share code, notes, and snippets.

Makoto YUI myui

Block or report user

Report or block myui

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@myui
myui / xgboost_iris.md
Created Aug 23, 2019
xgboost_iris.md
View xgboost_iris.md
View titanic_train.tsv
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
survived,pclass,name,sex,age,sibsp,parch,ticket,fare,cabin,embarked
0,3,0,0,22,1,0,0,7.25,0,0
1,3,1,1,26,0,0,1,7.925,0,0
0,3,2,0,35,0,0,2,8.05,0,0
0,3,3,0,0,0,0,3,8.4583,0,1
0,3,4,0,2,3,1,4,21.075,0,0
1,3,5,1,27,0,2,5,11.1333,0,0
1,2,6,1,14,1,0,6,30.0708,0,2
0,3,7,0,20,0,0,7,8.05,0,0
0,3,8,0,39,1,5,8,31.275,0,0
View argsort.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View calibrate_prediction.sql
WITH tmp1 as (
select
userid,
array[
probabilities[1],
probabilities[2],
probabilities[3],
probabilities[4],
probabilities[5],
probabilities[6],
View feature_binning.sql
CREATE TABLE users (
rowid int, name string, age int, gender string
);
INSERT INTO users VALUES
(1, 'Jacob', 20, 'Male'),
(2, 'Mason', 22, 'Male'),
(3, 'Sophia', 35, 'Female'),
(4, 'Ethan', 55, 'Male'),
(5, 'Emma', 15, 'Female'),
(6, 'Noah', 46, 'Male'),
View comment.scpt
set my_coment to "#" --コメント文字
tell application "mi"
tell document 1
set p_count to (count paragraphs of selection object 1)
set start_p to index of paragraph 1 of selection object 1
set end_p to start_p + p_count - 1
repeat with i from start_p to end_p
set tmp_str to quoted form of (paragraph i as Unicode text)
View mapping.sql
with tmp as (
select
-- group by is sometimes faster than distinct
-- distinct extract_feature(feature) as feature
extract_feature(feature) as feature
from
test l
lateral view explode(features) r as feature
),
mapped as (
View libsvm.sql
SELECT
-- conversion for libsvm format
label || ' ' || array_join(array_sort(
feature_hashing(features),
(x, y) -> if(cast(substr(x, 1, strpos(x, ':') - 1) as bigint) < cast(substr(y, 1, strpos(y, ':') - 1) as bigint),
-1,
if(substr(x, 1, strpos(x, ':') - 1) = substr(y, 1, strpos(y, ':') - 1), 0, 1)
)
), ' ') as line
from
View test.sql
SELECT
from_json(to_json(
ARRAY(
NAMED_STRUCT("country", "japan", "city", "tokyo"),
NAMED_STRUCT("country", "japan", "city", "osaka")
)
),'array<struct<city:string>>');
View release_note.md
You can’t perform that action at this time.