Skip to content

Instantly share code, notes, and snippets.

View GINK03's full-sized avatar
🌴
On vacation

catindog/nardtree GINK03

🌴
On vacation
View GitHub Profile
@GINK03
GINK03 / almost_prime.md
Created July 22, 2018 16:05
almost prime
fun Int.k_prime(x: Int): Boolean {
    var n = x
    var f = 0
    var p = 2
    while (f < this && p * p <= n) {
        while (0 == n % p) { n /= p; f++ }
        p++
 }
@GINK03
GINK03 / jupyterでpandasで省略されるのを防ぐ.md
Last active March 21, 2019 05:02
jupyterでpandasの省略されて出力されるのを防ぐ

pd.set_optionsを変更する

# COL数
import pandas as pd
pd.set_option("display.max_columns", 120)
# 幅
from IPython.core.display import display, HTML
display(HTML(""))
@GINK03
GINK03 / tor-server.md
Last active July 17, 2018 11:47
tor-server

Torのサーバを立てる

torをインストール

$ sudo apt install tor

nyx(旧arm)をインストール

@GINK03
GINK03 / keras_learning_rate.md
Last active July 4, 2018 05:06
kerasで動的にlearning rateを構築する

kerasのbackendで設定する必要があって、いくつか過去のレポジトリを修正しなくては行けない可能性がある

from sklearn.cross_validation import KFold
import swap_noise
from keras import backend as K 

for i in range(100):
 NFOLDS=100
@GINK03
GINK03 / remove_secret.md
Last active June 30, 2018 18:37
githubで間違ってアップロードしたファイルを、過去に遡って消す

以下のコマンドを打つ

$ git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ./pixiv-daily-ranking-web/token_dbx.txt' --prune-empty --tag-name-filter cat -- --all

たぶん、これで消える

@GINK03
GINK03 / proposal-template.md
Last active June 29, 2018 02:38
proposal-template

proposal-template

Agenda

  • プロジェクト、ゴール

  • プロジェクト体制

  • (個別化)ステアリングコミッティ(各人の利害調整)に向けたイメージ

@GINK03
GINK03 / simple-nn-mercari.md
Created June 14, 2018 10:25
simple-nn-model-mercari
@GINK03
GINK03 / tor-requests.md
Last active June 13, 2018 16:11
Tor+Requests

torのインストール

$ sudo apt install tor
$ sudo pip3 install pysocks

requestsで使う

IPがそれぞれ異なる

@GINK03
GINK03 / kaggle-bio.md
Last active January 4, 2020 03:11
kaggle-bio.md

Thank you for watching this BIO.

My policy, Data Science as a Art.

  • choosing best algorithm for each problems.

  • collecting knowledge for each problems' solutions.

  • making unique model.

  • it's fun and beautiful!

Non-competition outputs.

@GINK03
GINK03 / xgboost-kfold.md
Last active June 7, 2018 09:01
xgboostでkfoldする

lightgbmと基本的に同じ

xgb用のパラメータになっているので必要に応じてlgbのパラメータの言い換えを見つける

import xgboost as xgb
def get_oof(clf, x_train, y, x_test):
    oof_train = np.zeros((ntrain,))
    oof_test = np.zeros((ntest,))
    oof_test_skf = np.empty((NFOLDS, ntest))