[데이터 사이언스] 딥러닝 - one hot encoding 을 하려면... @dsschool
Binary Classification 까지 공부하고 이후 Multi-class Classification를 하려면 기억해두어야 할 2문장 y_predict 가 {[0.7, 0.2, 0.1] [0.2, 0.1, 0.7] [0.1, 0.7, 0.2]} 라면 np. argmax를 이용해서 값을 지정할 수 있다. np.arrary로 만들고 argmax(axis = 1)를 시행하면, [0,2,1] 로 나오고 이는 각각 0.7이 위치한 순서를 0,2,1로 나타내는 것이다.
[Python] cheating sheet - 노마드코더
# https://docs.python.org/3.7/library/index.html # repl.it a_string = "like this" a_number = 3 a_float = 3.12 a_boolean = False a_none = None # 1.1 Lists in Python # List 는 [] 로 감싸며 ','로 분리한다. days = ["Mon", "Tue", "Wed", "Thur", "Fri"] print(days[3],',' , type(days)) #List 안에 내용이 있는지 확인 print("Mon" in days) # "Mon" 이 포함되어있으면 true, 그렇지 않으면 false # list count 하기 len print(len(days)) # Mutable, se..
[Pandas] Visualization 관련 정리 (시각화)
figure size 바꾸기 plt.figure(figsize = (가로, 세로)) 로 변경 가능하다. plt.figure(figsize=(18,4)) dayofweek_order = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] sns.pointplot(data = train, x="datetime-hour", y = "count", hue ="datetime-dayofweek" , hue_order = dayofweek_order) figure 여러개 보여주기 pandas seaborn으로 시각화를 하면 한 줄에 1개씩 이미지가 나오는데 여간 불편한게 아니다. 여러줄 나오게 변경하면 매우 간편한다. # matplotl..