DataScience90 Streamlit 웹대시보드 ec2 백그라운드 실행 streamlit 이 설치되어있는 가상환경으로 진입 conda activate "이름" 실행할 디렉토리로 이동 [실행] nohup streamlit run app.py --server.port 8501 & [프로세스확인] ps -ef | grep app.py [프로세스종료] kill "pid" 2023. 4. 29. pandas selenium base64 재미로 보는 예제 In [ ]: import pandas as pd In [ ]: # 부재료 - 시트1.csv 파일을 판다스로 읽어옵니다 df2 = pd.read_csv('부재료가공완료.csv', encoding='utf-8') # df2 index를 1부터 시작하게 바꿔줍니다 df2.index = range(1, len(df2) + 1) df2 Out[ ]: 재료 사진 Unnamed: 2 1 소주잔 NaN https://www.google.com/imgres?imgurl=https%3A%... 2 맥주잔 NaN https://www.google.com/imgres?imgurl=https%3A%... 3 얼음 NaN https://www.google.com/imgres?imgurl=http%3A%2... 4 토닉워터 Na.. 2023. 3. 7. Crawling 구글자동검색이미지다운 1.필요한 라이브러리를 그냥많이 불러온다 import requests from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.common.keys import Keys import time import pandas as pd import numpy as np import csv import os from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.. 2023. 3. 6. Selenium 구글웹드라이버 사용 기본 from selenium import webdriver # 웹 브라우저 제어 from urllib.parse import quote_plus # 한글 검색어를 URL에 사용할 수 있도록 인코딩 import time from selenium.webdriver.common.by import By # 웹 요소를 찾기 위한 방법을 지정 from selenium.webdriver.common.keys import Keys # 키보드 입력을 위한 키를 지정 import numpy as np # 필요한 옵션 설정 chrome_options = webdriver.ChromeOptions() # 크롬 옵션 설정 chrome_options.add_argument('--headless') # 브라우저를 띄우지 않고 백그라운.. 2023. 2. 24. Pandas 시카고 범죄율을 예측 Prophet, error_bad_lines, to_datetime(format), resample 함수의 사용법과, 이 함수를 사용하기 위해 인덱스를 설정하는 방법 시카고 범죄율을 예측해 보자 ( Facebook 의 Prophet 라이브러리 활용 )¶ STEP #0: PROBLEM STATEMENT¶ The Chicago Crime dataset : 2001 ~ 2017. Datasource: 캐글 https://www.kaggle.com/currie32/crimes-in-*chicago* Dataset contains the following columns: ID: Unique identifier for the record. Case Number: The Chicago Police Department RD Number (Records Division Number), which is unique to the incident. Date: Date when the in.. 2023. 1. 3. Pandas (영화 추천 시스템)pivot_table 함수 사용법, item based collacborative filtering 을 하기 위해, corr() 함수를 이용한 correlation과min_periods 파라미터 사용법 영화 추천 시스템¶ PROBLEM STATEMENT¶ 추천시스템은 영화나 노래등을 추천하는데 사용되며, 주로 관심사나 이용 내역을 기반으로 추천한다. 이 노트북에서는, Item-based Collaborative Filtering 으로 추천시스템을 구현한다. Dataset MovieLens: https://grouplens.org/datasets/movielens/100k/ STEP #0: LIBRARIES IMPORT¶ In [23]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline In [24]: from google.colab import drive.. 2023. 1. 3. 딥러닝 Transfer Learning 이란 (코드없음 진행순서만) 딥러닝 모델의 정확도를 높이기 위해선 대학원 이상의 전문지식을 요한다. 따라서 응용프로그래머는 잘 만들어진 검증된 모델을 가져다 쓴다는 개념이 Transfer Learning 이라고 한다. 사용법은 사이드바 딥러닝 부분에 자세히 설명해놓았기 때문에, 여기선 전체적인 그림만 그린다 1. 필요한 라이브러리를 임포트 2.Building the model (Loading the pre-trained model) 학습이 잘 된 모델의 베이스 모델만 가져온다.(헤드모델은 빼고) 3. Freezing the base model 가져온 베이스 모델 부분은 이미 특징을 잘잡게 학습되어있기 때문에 재학습 하지않도록 사전작업을 하는것 4.Defining the custom head for our network 내 문제에 맞.. 2023. 1. 2. Pandas Prophet 라이브러리를 이용한 Time Series 데이터 예측 방법 AVOCADO 가격 예측 (Facebook Prophet )¶ STEP #0: 데이터셋¶ 데이터는 미국의 아보카도 리테일 데이터 입니다. (2018년도 weekly 데이터) 아보카도 거래량과 가격이 나와 있습니다. 컬럼 설명 : Date - The date of the observation AveragePrice - the average price of a single avocado type - conventional or organic year - the year Region - the city or region of the observation Total Volume - Total number of avocados sold 4046 - Total number of avocados with PLU 40.. 2023. 1. 2. 딥러닝 텐서플로우 에포크 시마다, 가장 좋은 모델을 저장하는, ModelCheckpoint 사용방법, 에포크 시마다, 기록을 남길 수 있는, CSVLogger 사용 방법 The Vehicle Type Classification Project¶ Summary¶ Use Case: Vehicle Type Algorithm: MobileNetV2 Number of training images: 603 Number of classes: 7 Batch Size: 64 Optimizer: Adam Learning Rate: 0.0001 Loss Type:CategoricalCrossentropy Transfer Learning: Yes | Imagenet Labels¶0: 'car-bus-alltypes', 1: 'car-sedan-alltypes', 2: 'car-suv-alltypes', 3: 'motocycle-bicycle-kids', 4: 'motocycle-bicycle-.. 2023. 1. 2. 딥러닝 텐서플로우 Transfer_Learning_and_Fine_Tunning 개와 고양이 분류를, 이미 잘 만들어진 뉴럴네트워크를 활용하여, 성능을 올려보자.¶ Stage 1: Install dependencies and setting up GPU environment¶ In [ ]: # !pip install tensorflow-gpu==2.0.0.alpha0 In [ ]: # !pip install tqdm Requirement already satisfied: tqdm in /usr/local/lib/python3.6/dist-packages (4.28.1) Downloading the Dogs vs Cats dataset¶ In [1]: !wget --no-check-certificate \ https://storage.googleapis.com/mledu-datasets.. 2023. 1. 2. 딥러니 텐서플로우 CNN을 이용하여, CIFAR-10 이미지 분류하기, 데이트셋이 이미 넘파이라면? CNN을 이용하여, CIFAR-10 이미지 분류하기¶ STEP 0: 데이터셋 설명¶ CIFAR-10 is a dataset that consists of several images divided into the following 10 classes: Airplanes Cars Birds Cats Deer Dogs Frogs Horses Ships Trucks The dataset stands for the Canadian Institute For Advanced Research (CIFAR) CIFAR-10 is widely used for machine learning and computer vision applications. The dataset consists of 60,000 32x32 colo.. 2023. 1. 2. 파이썬 원본 폴더에 이미지 파일 여러개를 일정비율로 나눠서, 랜덤으로 파일의 순서를 바꾼다음, 새로운폴더를 생성하여 넣는 방법 환경 : 리눅스 ( 윈도우도 됨) PetImages 라는 원본폴더 안에 Cat 폴더 안에는 고양이 사진이 12500장 Dog 폴더 안에는 개사진이 12500장 있다고 해보자 새로운 cats-v-dogs 라는 폴더를 생성하고 그안에 testing 폴더, training 폴더를 생성 testing 안에 cats, dogs training 안에 cats, dogs 폴더를 생성한다음 원본에 있는 사진을 일정 비율로 나눠서 (예를들면 9대1로 나누면 11250장, 1250장) testing 안에 cats 폴더에 1250장 testing 안에 dogs 폴더에 1250장 training 안에 cats 폴더에 11250장 training 안에 dogs 폴더에 11250장 이렇게 옮길것이다. 1.필요한 라이브러리를 임포.. 2022. 12. 30. 이전 1 2 3 4 ··· 8 다음