분류 전체보기502 [Python] 머신러닝 - 지도학습(회귀분석)1 ################################# # 머신러닝 : 기계학습. 예측에 사용. AI(인공지능) # 변수(컬럼, 피처)들의 관계를 통해서 예측을 하는 과정 # 지도 학습 : 기계학습시 정답을 지정. # 회귀분석 : 가격, 매출, 주가 예측등 연속성이 있는 데이터 예측에 사용 # 대략적인 추세를 분석한다? # 분류 : 데이터 선택. 평가 ex) 사진을 보고 찾음 # yes or no # 비지도 학습 : 기계학습시 정답이 없음. # 군집 : 비슷한 데이터들끼리 그룹화함. # 강화학습 : 행동을 할 때 마다 보상을 통해 학습하는 과정 # 머신러닝 프로세스() # : 데이터 정리(전처리) -> 데이터 분리(훈련/검증/테스트) -> 알고리즘 준비 # -> 모형학습(훈련데이터를 이용) -> 예.. 2023. 4. 26. [Python] crime_in_Seoul.csv파일과 경찰관서 위치.csv파일 분석하기2 ######################## # 2022-12-14 복습 import numpy as np import pandas as pd # 서울 구별 CCTV 정보 데이터 읽기 CCTV_Seoul = pd.read_csv("data/01. CCTV_in_Seoul.csv") # 서울시 경찰서별 범죄율 정보 데이터 읽기 crime_Seoul = pd.read_csv("data/02. crime_in_Seoul.csv", thousands=',', encoding="cp949") # 전국 경찰서 위치 데이터 읽기 police_state = pd.read_csv("data/경찰관서 위치.csv", encoding="cp949") # police_Seoul 데이터에 서울청 데이터만 저장하기 police_.. 2023. 4. 26. [Python] crime_in_Seoul.csv파일과 경찰관서 위치.csv파일 분석하기 📌 # 서울시 경찰서별 범죄율 데이터와 경찰서 위치 데이터 읽기 import numpy as np import pandas as pd crime_Seoul = pd.read_csv("data/02. crime_in_Seoul.csv", thousands=',', encoding="cp949") crime_Seoul.info() police_state = pd.read_csv("data/경찰관서 위치.csv", encoding="cp949") police_state police_state.info() # 지방청 컬럼의 내용 조회 police_state["지방청"].unique() # police_Seoul 데이터에 서울청 데이터만 저장하기 #1 police_Seoul = police_state[police.. 2023. 4. 26. [Python] CCTV_in_Seoul.csv파일과 population_in_Seoul.xls파일을 분석하기 📌 파일읽기 ################################## # CCTV_in_Seoul.csv파일과 population_in_Seoul.xls파일을 분석하기 ''' 서울시 각 구별 CCTV수를 파악하고, 인구대비 CCTV 비율을 파악해서 순위 비교 서울시 각 구별 CCTV수 : 01. CCTV_in_Seoul.csv 서울시 인구 현황 : 01. population_in_Seoul.xls ''' import pandas as pd CCTV_Seoul = pd.read_csv("data/01. CCTV_in_Seoul.csv") CCTV_Seoul.info() Pop_Seoul = pd.read_excel("data/01. population_in_Seoul.xls") Pop_Seoul.in.. 2023. 4. 26. [Python] drinks.csv 파일 분석하기4 ################################# # 전세계 음주 데이터 분석하기 : drinks.csv import pandas as pd drinks = pd.read_csv("data/drinks.csv") drinks.info() ''' country : 국가명 beer_servings : 맥주소비량 spirit_servings : 음료소비량 wine_servings : 와인소비량 total_litres_of_pure_alcohol : 순수 알콜량 continent : 대륙명 ''' drinks.head() 📌 ''' total_servings 전체 술소비량을 막대그래프로 작성하고, 대한민국의 위치를 빨강색으로 표시하기 1.total_serving_rank = drinks[["count.. 2023. 4. 26. [Python] drinks.csv 파일 분석하기3 ################################# # 전세계 음주 데이터 분석하기 : drinks.csv import pandas as pd drinks = pd.read_csv("data/drinks.csv") drinks.info() ''' country : 국가명 beer_servings : 맥주소비량 spirit_servings : 음료소비량 wine_servings : 와인소비량 total_litres_of_pure_alcohol : 순수 알콜량 continent : 대륙명 ''' drinks.head() 📌 ################ import numpy as np import matplotlib.pyplot as plt #대한민국은 얼마나 술을 독하게 마시는 나라인가? #전체.. 2023. 4. 26. [Python] drinks.csv 파일 분석하기2 - 막대그래프시각화 📌 # 대륙별 spirit_servings의 평균, 최소, 최대, 합계를 출력 #1 # 평균 drinks.groupby("continent")["spirit_servings"].mean() # 최소 drinks.groupby("continent")["spirit_servings"].min() # 최대 drinks.groupby("continent")["spirit_servings"].max() # 합계 drinks.groupby("continent")["spirit_servings"].sum() #2 drinks.groupby("continent")["spirit_servings"].agg(["mean","min","max","sum"]) # 대륙별 알콜량의 평균이 전체 알콜량 평균보다 많은 대륙을 조회.. 2023. 4. 26. [Python] drinks.csv 파일 분석하기1 📌 ################################# # 전세계 음주 데이터 분석하기 : drinks.csv import pandas as pd drinks = pd.read_csv("data/drinks.csv") drinks.info() ''' country : 국가명 beer_servings : 맥주소비량 spirit_servings : 음료소비량 wine_servings : 와인소비량 total_litres_of_pure_alcohol : 순수 알콜량 continent : 대륙명 ''' drinks.head() # 변수 = 컬럼 = 피처 # 상관계수 : 두개의 연속적인 데이터의 상관관계를 수치로 표현 beer_wind_corr =\\ drinks[["beer_servings","wine.. 2023. 4. 26. 이전 1 ··· 16 17 18 19 20 21 22 ··· 63 다음