2018-07-01から1ヶ月間の記事一覧

sshできる local serverのIPに辺りをつける。

Mac

nmap で 探す sudo nmap -sS -p 22 --open 192.168.33.0/24 ## 権限の変更を使った。 sudo chown -R $(whoami) /usr/local/Homebrew serverfault.com

ubuntu18.4 にtensolrflow 動かすためにしたこと

cudaとかcudnnとか。gpuに関係しているものだろうか。 apt-get install cuda-9.0 wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.0.5/cudnn-9.0-linux-x64-v7.tgz tar xzf cudnn-9.0-linux-x64-v7.tgz cp -a cuda/lib64/* /usr/local/l…

glibcをcentosにインストールしようとして苦戦した。

以下を行ってからバグった。確かめよう。 export LD_LIBRARY_PATH=/opt/glibc-2.14/lib unix.stackexchange.com gist.github.com Index of /results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/ Index of /gnu/glibc

Mysql で特定id毎の上位ランキングを出す

SQL

以下は結構便利。 SELECT * FROM Table1 t1 WHERE 2 >= ( SELECT COUNT(*) FROM Table1 t2 WHERE t1.category = t2.category AND t2.point >= t1.point ) ORDER BY category,point desc select id, category, point, name from ( select *, @rank := if (@ca…

matplotまとめてあったので、引用

python-remrin.hatenadiary.jp

models の CharField に regex の判定を追加

alphanumeric の RegexValidator で追加。 alphanumeric = RegexValidator(r'^[0-9a-zA-Z]*$', 'Only alphanumeric characters are allowed.') name = models.CharField(max_length=50, blank=True, null=True, validators=[alphanumeric]) email = models.E…

Varnishについて

いつの日にか実装するかもしれないので、メモ github.com qiita.com

Django の models に対応したテーブルを MySQL から grep する方法

以下のコマンドで、取り出す。 mysql -uroot -N information_schema -e "select table_name from tables where table_schema = 'tablename' and table_name like 'prefix_%'" > table.txt

tf の mnist をニューラルネットワークで分析

正解率が90%と低めに出た。。原因は今度調べよう import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) mnist.train.images.shape => (55000, 784) n_feat…

Solrのパフォーマンスチューニング

yomon.hatenablog.com JVM Settings | Apache Solr Reference Guide 6.6 SolrPerformanceFactors - Solr Wiki ShawnHeisey - Solr Wiki SolrPerformanceProblems - Solr Wiki JVM 自体のチューニング yoskhdia.hatenablog.com fomsan.sakura.ne.jp

word2vecすごいぞ

結構すごい。。表記ゆれとかも吸収できそう。 from gensim.models import word2vec ls = [] for row in df_id['review_comment'].values[:100000]: ls.append(_split_to_rawwords(row)) model = word2vec.Word2Vec(ls, size=500, window=5, min_count=5, wor…

LDA(Latent Dirichlet Allocation) でのトピック抽出 でレビュー分析

レビューの分析方法をまとめる。 import os import glob import sys from datetime import (datetime, date, timedelta) import logging import re import shutil import tempfile import pandas as pd import numpy as np from scipy.sparse.csc import csc…

pythonのscipyでsparseな行列の変換

sparseな行列についての実装 import numpy as np from scipy.sparse import coo_matrix ) a = np.arange(30).reshape(10,3) print(a) [[ 0 1 2] [ 3 4 5] [ 6 7 8] [ 9 10 11] [12 13 14] [15 16 17] [18 19 20] [21 22 23] [24 25 26] [27 28 29]] b, c, d …

GCPでのレコメンド実装について

Building a Recommendation System in TensorFlow: Overview | Solutions | Google Cloud

pandasを使うときに利用したサイト

applyとかassignとかpipeとかapplymapとか。numpyで対応していたところもあって知らなかった。 qiita.com stackoverflow.com stackoverflow.com