Skip to content

Instantly share code, notes, and snippets.

Avatar

Aki Ariga chezou

View GitHub Profile
View code-server.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chezou
chezou / ex2-3_plot_saled_prediction.ipynb
Created May 27, 2020
Ex2-3_plot_saled_prediction.ipynb
View ex2-3_plot_saled_prediction.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View pytd_simple.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chezou
chezou / github_vulns.py
Created Dec 25, 2019
GitHub SecurityVulnerabilities
View github_vulns.py
import requests
class GitHubClient:
def __init__(self, apikey, session=None):
self.headers = {"Authorization": f"Bearer {apikey}"}
if not session:
self.sess = requests.Session()
else:
self.sess = session
@chezou
chezou / plot_prophet_with_mpl.py
Last active Dec 9, 2019
Plot Facebook Prophet without model
View plot_prophet_with_mpl.py
import matplotlib as mlp
import pandas as pd
mlp.use("agg")
from matplotlib import pyplot as plt
from matplotlib.dates import (
MonthLocator,
num2date,
AutoDateLocator,
AutoDateFormatter,
@chezou
chezou / mt2md.rb
Created Dec 1, 2019
hatena blog 2 markdown
View mt2md.rb
#!/usr/bin/env ruby
# Forked from: http://hamasyou.com/blog/2014/02/13/movable-type-to-octopress/
require 'date'
require 'mustache'
require 'stringex'
require 'cgi'
require 'reverse_markdown'
@chezou
chezou / as_msgpack_stream.R
Last active Oct 26, 2019
Convert R data frame to msgpack stream
View as_msgpack_stream.R
devtools::install_github("crowding/msgpack-r")
library(msgpack)
x <- data.frame(a=1:3, b=4:6)
conn <- gzfile("test.msgpack.gz", open="w+b")
apply(x, 1, function(x) {writeMsg(c(x, time=as.integer(Sys.time())), conn)})
flush(conn)
close(conn)
@chezou
chezou / rand.dig
Created May 8, 2019
Parallel example with py> operator
View rand.dig
+t1_1:
py>: rand.rand_params
docker:
image: 'digdag/digdag-python:3.6.8-stretch'
n_iter: 5
+t1_2:
echo>: ${param_list}
+t1_3:
@chezou
chezou / calc_multiclass_precision_recall.sql
Last active Mar 15, 2019
Calculate multiclass micro/macro precision and recall in SQL
View calc_multiclass_precision_recall.sql
with agg as (
select
p.label, p.probability, t.survived
from
prediction_rf p
join
test t on (p.rowid = t.rowid)
order by
probability desc
),
@chezou
chezou / R_env.frozen.yml
Last active Jan 31, 2019
Conda environment for R parcel
View R_env.frozen.yml
name: R_env
channels:
- conda-forge
- defaults
dependencies:
- arrow-cpp=0.12.0=py37h0e61e49_0
- attrs=18.2.0=py_0
- backcall=0.1.0=py_0
- binutils_impl_linux-64=2.31.1=h6176602_1
- binutils_linux-64=2.31.1=h6176602_3
You can’t perform that action at this time.