728x90

python 24

python으로 Association Rule 구현하기 위한 선행 연구 조사

진행하는 프로젝트에 적용하기 위해 Association Rule(이하 AR)을 사용해야 하는 상황이 생겼다. 우선 찾아본 결과 우리가 적용할 수 있는 두 가지 방법이 있다. 1. python을 이용한 AR 구현 아래 5개의 링크가 파이썬을 이용한 AR 구현 관련된 자료이다. 시간이 날 때 하나씩 테스트 해봐야 겠다.https://pypi.python.org/pypi/apyori/1.1.1https://github.com/asaini/Apriorihttp://orange3-associate.readthedocs.io/en/latest/scripting.htmlhttps://pypi.python.org/pypi/Orange3-Associatehttps://github.com/asaini/Apriori 2. ..

scipy.sparse.coo_matrix

scipy.sparse.coo_matrix class scipy.sparse.coo_matrix(arg1, shape=None, dtype=None, copy=False) coo_matrix는 아래와 같은 방법으로 이용 가능하다 coo_matrix(D)dense matrix D와 함께 사용 coo_matrix(S)또 다른 sparse matrix S (equivalent to S.tocoo()) coo_matrix((M, N), [dtype])shape(M, N)과 함께 빈 matrix를 만든다. dtype은 선택적이고 기본으로 dtype='d'이다 coo_matrix((data, (i, j)), shape=(M, N)])아래와 같은 3개의 배열을 이용해 만든다.data[:] 는 순서에 상관없이 matr..

pandas.DataFrame.iloc

DataFrame.iloc 정의 - 정수 값을 이용해 데이터프레임의 특정 위치를 인덱스 기반으로 선택한다. .iloc[]는 주로 0부터 축의 길이 -1 사이의 정수값으로 사용 가능 가능하지만, boolean array를 사용할 수도 있다. 아래와 같이 이용 가능하다 An integer, e.g. 5.A list or array of integers, e.g. [4, 3, 0].A slice object with ints, e.g. 1:7.A boolean array.A callable function with one argument (the calling Series, DataFrame or Panel) and that returns valid output for indexing (one of the a..

절대값 알고리즘

파이썬으로 구현한 다양한 알고리즘에 대해서 코딩을 해보려고 한다. 우선 절대값 알고리즘을 만들었다. 절대값은 2가지 방법으로 만들 수 있다. 첫 번째 방법은 입력된 값이 0보다 크면 그대로 출력하고, 작으면 마이너스를 붙여서 출력한다. 이는 -1을 곱한 것과 같다고 보면 된다. 두 번째 방법은 입력된 값을 제곱하여 양수로 변경후 루트를 이용하여 다시 제곱하기 전의 값으로 만든다. 그러면 음수만 양수로 되는 효과를 얻을 수 있다. import math # 첫 번째 절대값 알고리즘 def abs_sign(num): if num >= 0: return num else: return -num # 두 번째 절대값 알고리즘 def abs_square(num): result = num * num return int(..

728x90