목록전체 글 (68)
A.I
In [49]: from IPython.core.display import display, HTML display(HTML("")) Scikit-Learn¶ 1. 설치¶ 최신버전 0.23을 위한 준비 Python (>= 3.6) NumPy (>= 1.13.3) SciPy (>= 0.19.1) joblib (>= 0.11) In [1]: !pip install scikit-learn #!conda install scikit-learn Requirement already satisfied: scikit-learn in ./anaconda3/envs/aiffel/lib/python3.7/site-packages (0.23.2) Requirement already satisfied: scipy>=0.19.1 i..
작사가 인공지능 만들기¶ 1. 시퀀스¶ 시퀀스는 데이터의 나열로 정렬과는 다르다 종류에는 리스트(list), 튜플(tuple), 레인지(range), 문자열(string)이 있다. 시퀀스 명령어 sum(number_list) center(['가', '나', '다', '라', '마']) = '다' mirror([1, 2, 3]) = [1, 2, 3, 2, 1] minmax([92, -21, 0, 104, 51, 76, -92]) = [-92, 104] mean([92, -21, 0, 104, 51, 76, -92]) = 30.0 append(x) 요소 x를 시퀀스의 끝(오른쪽)에 추가 insert(i, x) 요소 x를 시퀀스의 i 위치에 삽입 extend(seq) 대상 시퀀스를 시퀀스의 끝에 연결 , +=..
1. 파이썬으로 그래프 그리기¶ $ pip install matplotlib $ pip install seaborn In [10]: import matplotlib.pyplot as plt %matplotlib inline #그래프 데이터 subject = ['English', 'Math', 'Korean', 'Science', 'Computer'] points = [40, 90, 50, 60, 100] # 축 그리기 fig = plt.figure() # 도화지 펼치기 ax1 = fig.add_subplot(1,1,1) # 1행 1열로 1개 그릴수 있다는 뜻 # 그래프 그리기 ax1.bar(subject, points) # 라벨, 타..
음성 데이터 분류¶ - 학습 목표¶ Audio 형태의 데이터를 다루는 방법에 대해서 알아보기 Wav 파일의 형태와 원리를 이해하기 오디오데이터를 다른 다양한 형태로 변형시켜보기 차원이 다른 데이터에 사용가능한 classification 모델 직접 제작해보기 1. 오디오 데이터의 표본화¶ In [26]: import numpy as np import matplotlib.pyplot as plt def single_tone(frequecy, sampling_rate=16000, duration=1): t = np.linspace(0, duration, int(sampling_rate)) y = np.sin(2 * np.pi * frequecy * t) return y y = single_tone(400) #..
영화 리뷰 텍스트 감성분석하기¶ 1. 텍스트를 숫자로 표현하는 방법¶ In [11]: # 처리해야 할 문장을 파이썬 리스트에 옮겨담았습니다. sentences=['i feel hungry', 'i eat lunch', 'now i feel happy'] # 파이썬 split() 메소드를 이용해 단어 단위로 문장을 쪼개 봅니다. word_list = 'i feel hungry'.split() print(word_list) ['i', 'feel', 'hungry'] In [12]: index_to_word={} # 빈 딕셔너리를 만들어서 # 단어들을 하나씩 채워 봅니다. 채우는 순서는 일단 임의로 하였습니다...
1. 얼굴 사진 준비¶ 디렉토리 구조 만들기¶mkdir -p ~/aiffel/camera_sticker/models mkdir -p ~/aiffel/camera_sticker/images 스티커 저장 및 디렉토리 이동¶wget https://aiffelstaticprd.blob.core.windows.net/media/original_images/king.png wget https://aiffelstaticprd.blob.core.windows.net/media/original_images/hero.png mv king.png hero.png ~/aiffel/camera_sticker/images In [560]: # 이미지 처리를 위해 opencv 와 노트북에 이미지를 출력하기 위한 matplotlib..
www.aihub.or.kr/ai_data AI데이터 소개 | AI Hub AI데이터 소개 Body AI데이터 AI Hub의 AI데이터는 국내 중소벤처기업, 연구소, 개인 등이 높은 비용과 투입시간으로 인해 자체적으로 확보하기 어려운 양질의 대용량 인공지능 학습용 데이터를 누 www.aihub.or.kr
[input] memory = {1: 1, 2: 1} def fibonacci(n): if n in memory: number = memory[n] else: number = fibonacci(n-1) + fibonacci(n-2) memory[n] = number return number print(fibonacci(100)) print(memory) if n in memory를 통해 입력값 n이라는 키가 memory 딕셔너리에 존재할 경우, 그 값 memory[n]을 바로 number로써 반환 [Output] 354224848179261915075 {1: 1, 2: 1, 3: 2, 4: 3, 5: 5, 6: 8, 7: 13, 8: 21, 9: 34, 10: 55, 11: 89, 12: 144, 13:..