2016-01-01から1年間の記事一覧

scikit-learnでロジスティック回帰

コード $ cat learn_test.py import pandas as pd from sklearn.linear_model import LogisticRegression from sklearn.cross_validation import train_test_split from sklearn.metrics import accuracy_score #df=pd.read_table("test.txt",sep=",",header…

Rstanの導入

RのMCMCライブラリのRstanの導入 windows 8 64bit R x64 3.0.2 >R x64 3.2.3 (上のバージョンだと古すぎるので移行) これに従う. https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started (1)基本の整備 バージョンにあったRtoolsのインストー…

Rstanの導入

R

RのMCMCライブラリのRstanの導入 windows 8 64bit R x64 3.0.2 これに従う. https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started (1)基本の整備 バージョンにあったRtoolsのインストール (2)gccのパスをRtoolsのものにする(3)インスト…

Rstanの導入

R

RのMCMCライブラリのRstanの導入 windows 8 64bit R x64 3.0.2 これに従う. https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started (1)基本の整備 バージョンにあったRtoolsのインストール (2)gccのパスをRtoolsのものにする(3)インスト…

Rstanの導入

R

RのMCMCライブラリのRstanの導入 windows 8 64bit R x64 3.0.2 これに従う. https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started (1)基本の整備 バージョンにあったRtoolsのインストール (2)gccのパスをRtoolsのものにする(3)インスト…

sympyで数列の和を計算

インストール pip install sympy例: sympyで数列の和を計算して,因数分解 コード calc.py from sympy import * i,N=symbols('i N',integer=True) a=summation(i**2,(i,1,N)) print a b=factor(a) print b 実行 $ python calc.py 出力 N**3/3 + N**2/2 + N/…

sqlite3 のデータベースの復旧

http://taichino.com/engineer-life/database/4123 を参考に insert 形式がで出力して、 その後、それを新しいデータベースにインポートする。 (0)異常をチェック sqlite> PRAGMA integrity_check OKとかでるとOKで. page xxxx とかでるとエラー(1)insert形…

BeautifulSoupでhtmlをパーズ

(1)とりあえずのリンク抽出 http://www.crummy.com/software/BeautifulSoup/bs4/doc/ from bs4 import BeautifulSoup soup=BeautifulSoup(open("index.html")) #title print(soup.title.string) v=(soup.find_all('a')) for i in v: print(i['href']) (…

screenの使い方

チュートリアル http://wadap.hatenablog.com/entry/20080114/1200288402まず、設定 .screenrc を$HOMEディレクトリにおく autodetach on bell_msg "^G" defkanji utf-8 defencoding utf-8 encoding utf-8 utf-8 defscrollback 10000 escape ^Jj caption alw…

gitで重いファイルを削除

git

gitで重いファイル削除 http://qiita.com/go_astrayer/items/6e39d3ab16ae8094496c http://dskd.jp/archives/46.html http://www.d-wood.com/blog/2014/10/03_6965.html まずサイズを確認 git count-objects -v warning: garbage found: .git/objects/pack/t…

sftpでバッチ処理: 再帰ダウンロード(ディレクトリ以下のすべてのファイル)とレジューム

R

sftpでバッチ処理: 再帰ダウンロード(ディレクトリ以下のすべてのファイル)とレジューム(再開)できるようにする。 結論 mget -ar ディレクトリ名 基本 まず、基本 sftp -o "batchmode no" -b test.ftp username@xxx.xxx.xxx.xxx バッチファイル (1)…

Rで欠損値の可視化

R

Rで欠損値の可視化 http://www.r-bloggers.com/how-to-perform-a-logistic-regression-in-r/ library(Amelia) missmap(training.data.raw, main = "Missing values vs observed")