기본 콘텐츠로 건너뛰기

이 블로그의 인기 게시물

[Android] Android Studio Github 설정하기

1. Settings File > Settings 2. Version Control 메뉴 or 검색창에서 git 입력 3. 사용중인 Github 계정 및 비번을 입력하고 'Apply' > 'OK'색에서 'git' 검색 4. VCS > Checkout from Version Control > Github 5. Clone Repository에 Checkout 받을 프로젝트를 선택한 후, 'Clone'을 실행

[Hadoop] Snappy 설치

What is Snappy? - 구글에서 자체 개발한 압축 라이브러리 - 라이브러리 주소 http://code.google.com/p/snappy - 2015.01.05 현재 최신 버전은 snappy-1.1.1(?) 설치 과정 1. tar 파일 다운로드 https://code.google.com/p/snappy/downloads/list?can=1&q= 2. tar 파일 압축 풀기 3. root 계정으로 snappy 설치 1) 개인적으로 설치한 fedora에 gcc컴파일러, g++ 컴파일러가 없어 함께 설치하였다. g++      yum install gcc-c++ gcc      yum -y install gcc 2) snappy 폴더 이동 3) ./configure --enable-shared 4) make 5) sudo make install 4. snappy native library를 하둡에 복사한다. 1) cp /usr/local/bin/libsnappy.* $하둡홈/lib/native/Linux-amd64-64 2) cp /usr/local/bin/libsnappy*.* $하둡홈/lib/native/Linux-i386-32 가장 중요한 사실!!!! - mac에서는 snappy 설치시 .so파일이 아닌 .dylib파일이 생성된다. - native library는 Cygwin, Mac OS X 환경에서 동작하지 않는다.( Native Libaries 참조 ) Sample Source @Override public int run(String[] args) throws Exception { JobConf conf = new JobConf(SequenceFileCreator.class); conf.setJobName("SequenceFileCreator"); conf.setMapperClass(Dis...

[machine learning] k means algorithm

#!/usr/bin/python """ skeleton code for k-means clustering mini-project """ import pickle import numpy import matplotlib.pyplot as plt import sys sys.path.append("../tools/") from feature_format import featureFormat, targetFeatureSplit def Draw(pred, features, poi, mark_poi=False, name="image.png", f1_name="feature 1", f2_name="feature 2"): """ some plotting code designed to help you visualize your clusters """ ### plot each cluster with a different color--add more colors for ### drawing more than 4 clusters colors = ["b", "c", "k", "m", "g"] for ii, pp in enumerate(pred): plt.scatter(features[ii][0], features[ii][1], color = colors[pred[ii]]) ### if you like, place red stars over points that are POIs (just for funsies) if mark_poi: for ii, pp in enumerate(pred): ...