RMSE
좋아요!
RMSE에 대해 추가로 자세히 설명해드릴게요:
RMSE란?
- RMSE는 Root Mean Squared Error의 약자입니다.
- “평균 제곱 오차의 제곱근” 을 뜻합니다.
- 쉽게 말하면, 모델이 예측한 값과 실제 값 사이의 오차(틀린 정도) 를 숫자 하나로 요약한 지표입니다.
왜 쓰나요?
- RMSE는 오차가 클수록 벌점이 커지게 설계되어 있어서,
예측이 많이 틀린 경우를 민감하게 감지할 수 있습니다. - 그래서 정확한 모델을 만들고 싶을 때 RMSE를 줄이는 걸 목표로 합니다.
수식 (조금 수학적으로 보면)
[ \text{RMSE} = \sqrt{ \frac{1}{n} \sum_{i=1}^{n} (예측값_i - 실제값_i)^2 } ]
서브넷 계산하는 방법
좋은 질문이에요! 서브넷을 계산하는 방법은 네트워크 설계의 핵심이고, 이해해두면 IP 계획할 때 정말 유용합니다.
🧮 서브넷 계산 방법 요약
1️⃣ 기본 개념
- IP 주소는 32비트 (IPv4 기준)
- 서브넷 마스크는 IP 주소 중에서 네트워크/호스트 구분을 위한 비트 수를 나타냄
예:/24→ 상위 24비트는 네트워크, 나머지 8비트는 호스트
2️⃣ 공식
✅ 서브넷당 IP 수 = 2^(32 - 서브넷 비트 수)
- 예:
/24→2^(32-24) = 2^8 = 256개 IP
그중 2개는 항상 예약됨:
GCP + GKE
gcloud config set project
gcloud config set compute/region
gcloud config set compute/zone
export GOOGLE_CLOUD_PROJECT=$(gcloud config get-value core/project)
gcloud container clusters create fancy-prod-268 --num-nodes 3
gcloud compute instances list
gcloud services enable cloudbuild.googleapis.com
# build
cd ~/monolith-to-microservices/monolith
gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/fancy-monolith-220:1.0.0 .
# deploy
kubectl create deployment fancy-monolith-220 --image=gcr.io/${GOOGLE_CLOUD_PROJECT}/fancy-monolith-220:1.0.0
# check
kubectl get all
# Show pods
kubectl get pods
# Show deployments
kubectl get deployments
# Show replica sets
kubectl get rs
#You can also combine them
kubectl get pods,deployments
kubectl get services
# delete
kubectl delete pod/<POD_NAME>
# expose
kubectl expose deployment fancy-monolith-220 --type=LoadBalancer --port 80 --target-port 8080
# Accessing the service
kubectl get service
~/monolith-to-microservices/microservices/src/orders
gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/fancy-orders-430:1.0.0 .
kubectl create deployment fancy-orders-430 --image=gcr.io/${GOOGLE_CLOUD_PROJECT}/fancy-orders-430:1.0.0
kubectl expose deployment fancy-orders-430 --type=LoadBalancer --port 80 --target-port 8081
~/monolith-to-microservices/microservices/src/products
gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/fancy-products-721:1.0.0 .
kubectl delete deployment fancy-products-721
kubectl create deployment fancy-products-721 --image=gcr.io/${GOOGLE_CLOUD_PROJECT}/products-721:1.0.0
kubectl expose deployment fancy-products-721 --type=LoadBalancer --port 80 --target-port 8082
~/monolith-to-microservices/microservices/src/frontend
gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/fancy-frontend-189:1.0.0 .
kubectl create deployment fancy-frontend-189 --image=gcr.io/${GOOGLE_CLOUD_PROJECT}/fancy-frontend-189:1.0.0
kubectl expose deployment fancy-frontend-189 --type=LoadBalancer --port 80 --target-port 8080
------------------
# scale
kubectl scale deployment monolith --replicas=3
kubectl get all
# Make changes to the website
gcloud builds submit --tag gcr.io/${GOOGLE_CLOUD_PROJECT}/monolith:2.0.0 .
# Update website with zero downtime
kubectl set image deployment/monolith monolith=gcr.io/${GOOGLE_CLOUD_PROJECT}/monolith:2.0.0
kubectl get pods
# delete
# Delete the container image for version 1.0.0 of the monolith
gcloud container images delete gcr.io/${GOOGLE_CLOUD_PROJECT}/monolith:1.0.0 --quiet
# Delete the container image for version 2.0.0 of the monolith
gcloud container images delete gcr.io/${GOOGLE_CLOUD_PROJECT}/monolith:2.0.0 --quiet
# The following command will take all source archives from all builds and delete them from cloud storage
# Run this command to print all sources:
# gcloud builds list | awk 'NR > 1 {print $4}'
gcloud builds list | grep 'SOURCE' | cut -d ' ' -f2 | while read line; do gsutil rm $line; done
kubectl delete service monolith
kubectl delete deployment monolith
gcloud container clusters delete fancy-cluster lab region
GCP Website Make
# App Build & Docker Deploy
# artifactregistry Repository
gcloud auth configure-docker us-east1-docker.pkg.dev
gcloud services enable artifactregistry.googleapis.com \
cloudbuild.googleapis.com \
run.googleapis.com
# Submit
gcloud builds submit --tag us-east1-docker.pkg.dev/${GOOGLE_CLOUD_PROJECT}/monolith-demo/monolith:1.0.0
# Cloud Build 에서 진행상태 볼 수 있다.
# Deploy Container
gcloud run deploy monolith --image us-east1-docker.pkg.dev/${GOOGLE_CLOUD_PROJECT}/monolith-demo/monolith:1.0.0 --region us-east1
# check
gcloud run services list
# Create new revision with lower concurrency ??
gcloud run deploy monolith --image us-east1-docker.pkg.dev/${GOOGLE_CLOUD_PROJECT}/monolith-demo/monolith:1.0.0 --region us-east1 --concurrency 1
gcloud run deploy monolith --image us-east1-docker.pkg.dev/${GOOGLE_CLOUD_PROJECT}/monolith-demo/monolith:1.0.0 --region us-east1 --concurrency 80
# Cloud Run에서 확인가능
# node module 지우고 올리기
cd ~
rm -rf monolith-to-microservices/*/node_modules
gsutil -m cp -r monolith-to-microservices gs://fancy-store-$DEVSHELL_PROJECT_ID/
# 인스턴스 만들기
gcloud compute instances create backend \
--zone=$ZONE \
--machine-type=e2-standard-2 \
--tags=backend \
--metadata=startup-script-url=https://storage.googleapis.com/fancy-store-$DEVSHELL_PROJECT_ID/startup-script.sh
# ip확인
gcloud compute instances list
# Firewall. 적용하고 3분 기다려야 된다.
gcloud compute firewall-rules create fw-fe \
--allow tcp:8080 \
--target-tags=frontend
gcloud compute firewall-rules create fw-be \
--allow tcp:8081-8082 \
--target-tags=backend
# 끄고
gcloud compute instances stop frontend --zone=$ZONE
gcloud compute instances stop backend --zone=$ZONE
# 인스턴스를 템플릿으로 만든다.
gcloud compute instance-templates create fancy-fe \
--source-instance-zone=$ZONE \
--source-instance=frontend
gcloud compute instance-templates create fancy-be \
--source-instance-zone=$ZONE \
--source-instance=backend
gcloud compute instance-templates list
# 기존의 것을 지우고
gcloud compute instances delete backend --zone=$ZONE
# managed 로 다시 만든다
gcloud compute instance-groups managed create fancy-fe-mig \
--zone=$ZONE \
--base-instance-name fancy-fe \
--size 2 \
--template fancy-fe
gcloud compute instance-groups managed create fancy-be-mig \
--zone=$ZONE \
--base-instance-name fancy-be \
--size 2 \
--template fancy-be
# set-named-port라는 명령이 있네
gcloud compute instance-groups set-named-ports fancy-fe-mig \
--zone=$ZONE \
--named-ports frontend:8080
gcloud compute instance-groups set-named-ports fancy-be-mig \
--zone=$ZONE \
--named-ports orders:8081,products:8082
# 핼스체크 추가
gcloud compute health-checks create http fancy-fe-hc \
--port 8080 \
--check-interval 30s \
--healthy-threshold 1 \
--timeout 10s \
--unhealthy-threshold 3
gcloud compute health-checks create http fancy-be-hc \
--port 8081 \
--request-path=/api/orders \
--check-interval 30s \
--healthy-threshold 1 \
--timeout 10s \
--unhealthy-threshold 3
gcloud compute firewall-rules create allow-health-check \
--allow tcp:8080-8081 \
--source-ranges 130.211.0.0/22,35.191.0.0/16 \
--network default
# 헬스체크한 뒤 업데이트 해야 하나 보다
gcloud compute instance-groups managed update fancy-fe-mig \
--zone=$ZONE \
--health-check fancy-fe-hc \
--initial-delay 300
gcloud compute instance-groups managed update fancy-be-mig \
--zone=$ZONE \
--health-check fancy-be-hc \
--initial-delay 300
# Create load balancers
gcloud compute http-health-checks create fancy-fe-frontend-hc \
--request-path / \
--port 8080
gcloud compute http-health-checks create fancy-be-orders-hc \
--request-path /api/orders \
--port 8081
gcloud compute http-health-checks create fancy-be-products-hc \
--request-path /api/products \
--port 8082
# 엥?
# Note: These health checks are for the load balancer, and only handle directing traffic from the load balancer; they do not cause the managed instance groups to recreate instances.
gcloud compute backend-services create fancy-fe-frontend \
--http-health-checks fancy-fe-frontend-hc \
--port-name frontend \
--global
gcloud compute backend-services create fancy-be-orders \
--http-health-checks fancy-be-orders-hc \
--port-name orders \
--global
gcloud compute backend-services create fancy-be-products \
--http-health-checks fancy-be-products-hc \
--port-name products \
--global
# 로드 밸런서도?... 이렇게 복잡하게 해야하는건가? 보다.
gcloud compute backend-services add-backend fancy-fe-frontend \
--instance-group-zone=$ZONE \
--instance-group fancy-fe-mig \
--global
gcloud compute backend-services add-backend fancy-be-orders \
--instance-group-zone=$ZONE \
--instance-group fancy-be-mig \
--global
gcloud compute backend-services add-backend fancy-be-products \
--instance-group-zone=$ZONE \
--instance-group fancy-be-mig \
--global
# Create a URL map. 악!
gcloud compute url-maps create fancy-map \
--default-service fancy-fe-frontend
# 아... 이건 Nginx에서 라우팅 하는 것 처럼 보인다.
#Create a path matcher to allow the /api/orders and /api/products paths to route to their respective services:
gcloud compute url-maps add-path-matcher fancy-map \
--default-service fancy-fe-frontend \
--path-matcher-name orders \
--path-rules "/api/orders=fancy-be-orders,/api/products=fancy-be-products"
# 맵을 만들고... 용어가 달라서 그렇군.
# Create the proxy which ties to the URL map:
gcloud compute target-http-proxies create fancy-proxy \
--url-map fancy-map
# 포워딩
# Create a global forwarding rule that ties a public IP address and port to the proxy:
gcloud compute forwarding-rules create fancy-http-rule \
--global \
--target-http-proxy fancy-proxy \
--ports 80
# Find the IP address for the Load Balancer:
gcloud compute forwarding-rules list --global
# ip가 바뀌었을테네.. .env 파일 바꿔준다. 음.. 이건 좀.
# 다시 빌드하고 다시 배포 한다.... 음.. .env를 안쓰면 되나? 거참.
cd ~/monolith-to-microservices/react-app
npm install && npm run-script build
cd ~
rm -rf monolith-to-microservices/*/node_modules
gsutil -m cp -r monolith-to-microservices gs://fancy-store-$DEVSHELL_PROJECT_ID/
gcloud compute instance-groups managed rolling-action replace fancy-fe-mig \
--zone=$ZONE \
--max-unavailable 100%
# 체크
watch -n 2 gcloud compute backend-services get-health fancy-fe-frontend --global
# 스케일 변경
gcloud compute instance-groups managed set-autoscaling \
fancy-fe-mig \
--zone=$ZONE \
--max-num-replicas 2 \
--target-load-balancing-utilization 0.60
gcloud compute instance-groups managed set-autoscaling \
fancy-be-mig \
--zone=$ZONE \
--max-num-replicas 2 \
--target-load-balancing-utilization 0.60
# CDN...은 어떻게 설정되는지?
# Enable content delivery network
gcloud compute backend-services update fancy-fe-frontend \
--enable-cdn --global
# 인스턴스 사이즈 변경
gcloud compute instances set-machine-type frontend \
--zone=$ZONE \
--machine-type e2-small
gcloud compute instance-templates create fancy-fe-new \
--region=$REGION \
--source-instance=frontend \
--source-instance-zone=$ZONE
gcloud compute instance-groups managed rolling-action start-update fancy-fe-mig \
--zone=$ZONE \
--version template=fancy-fe-new
# 와치? 3분 정도 걸린다고 함.
watch -n 2 gcloud compute instance-groups managed list-instances fancy-fe-mig \
--zone=$ZONE
gcloud compute instances describe [VM_NAME] --zone=$ZONE | grep machineType
# ssh
gcloud compute instance-groups list-instances fancy-fe-mig --zone=$ZONE
gcloud compute ssh [INSTANCE_NAME] --zone=$ZONE
console + data
gcloud config set project qwiklabs-gcp-02-806cc13914e8
gcloud config list project
bq show bigquery-public-data:samples.shakespeare
bq query --use_legacy_sql=false \
'SELECT
word,
SUM(word_count) AS count
FROM
`bigquery-public-data`.samples.shakespeare
WHERE
word LIKE "%raisin%"
GROUP BY
word'
Use the bq ls command to list any existing datasets in your project:
# 현재 내 dataset
bq ls
# 오픈 데이터셋
bq ls bigquery-public-data:
# make dataset
bq mk babynames
curl -LO http://www.ssa.gov/OACT/babynames/names.zip
unzip names.zip
# 스키마 지정해서 업로드
bq load babynames.names2010 yob2010.txt name:string,gender:string,count:integer
# 확인
bq show babynames.names2010
bq query "SELECT name,count FROM babynames.names2010 WHERE gender = 'F' ORDER BY count DESC LIMIT 5"
# 지우는 것도 가능
bq rm -r babynames
CVID-19 오픈 데이터 세트
울티마
좋아요! 🎮 울티마(Ultima) 시리즈는 총 9개의 메인 넘버링 게임과 외전/온라인 시리즈로 구성되어 있어요. 아래에 시리즈별 간단 요약표로 정리해드릴게요:
🗂 울티마 시리즈 요약표 (메인 넘버링 기준)
| 번호 | 제목 (연도) | 주요 특징 / 이야기 요약 |
|---|---|---|
| I | Ultima I: The First Age of Darkness (1981) | 악당 몬다인(Mondain)을 물리치는 SF+판타지 혼합 세계 |
| II | Ultima II: The Revenge of the Enchantress (1982) | 시간여행 시스템 도입, 몬다인의 연인 미나엑스(Minax) 등장 |
| III | Ultima III: Exodus (1983) | 파티 시스템 도입, 전투와 탐험 구분. ‘정통 RPG’ 시스템 완성 |
| IV | Ultima IV: Quest of the Avatar (1985) | 미덕(Virtue) 시스템 도입, 도덕적 영웅 ‘아바타’ 탄생. 전설의 시작 |
| V | Ultima V: Warriors of Destiny (1988) | 미덕이 왜곡된 사회. 폭군 로드 블랙쏜(Blackthorn)과의 대립 |
| VI | Ultima VI: The False Prophet (1990) | 외계종족 Gargoyle와의 갈등 → 오해를 풀고 평화 추구 |
| VII | Ultima VII: The Black Gate (1992) | 극찬받은 그래픽 & 스토리. 컬트 조직 ‘가디언’의 등장 |
| Ultima VII Part Two: Serpent Isle (1993) | 다른 대륙에서 펼쳐지는 후속 이야기. 세계관 확장 | |
| VIII | Ultima VIII: Pagan (1994) | 어두운 세계관, 아바타가 새로운 세계 Pagan에 갇힘. 액션 중심 |
| IX | Ultima IX: Ascension (1999) | 시리즈의 결말. 아바타 vs 가디언의 마지막 대결. 그래픽은 좋았지만 평가 갈림 |
🌐 외전 및 온라인
| 제목 | 설명 |
|---|---|
| Ultima Online (1997) | 세계 최초의 MMORPG 중 하나. 자유도 높은 오픈월드 온라인 세계 |
| Ultima Underworld I & II | 1인칭 던전 크롤러 스타일, 울티마 세계관 기반의 혁신적 외전 |
| Ultima: Runes of Virtue | 게임보이/콘솔용 외전. 가벼운 퍼즐과 액션 중심 |
| Ultima Forever (2013, 모바일) | EA에서 만든 모바일 게임, 서비스 종료됨 |
📌 참고 사항
- Ultima IV~VII는 가장 많은 팬과 평가를 받는 시리즈입니다.
- Ultima Online은 오늘날 MMORPG의 조상 같은 존재입니다.
- Ultima 시리즈는 항상 기술적 혁신과 철학적 깊이를 함께 추구했어요.
더 궁금하신 시리즈가 있으면 그 편만 깊게 소개해드릴 수도 있어요! 어느 쪽이 더 끌리세요? 😊
Visualize Data
무엇보다도 디지털 소비는 클라우드 데이터 팀이 데이터와 상호 작용하는 매체를 이해하는 것. 다음으로, 데이터 시각화를 공유할 대상 고객이 누구인지 아는것이 중요. 하지만 디지털 매체의 경우, 청중이 데이터와 어떻게 상호작용하는지, 그리고 상호작용을 통해 무엇을 기대하는지도 고려해야 함. 클라우드 데이터 분석가로서 귀하의 대상 고객은 여러 곳에서 얻은 정보를 사용합니다. 그리고 사용자들은 정보가 최신이고 대화형기를 기대합니다. 또한 그들은 중요한 콘텐츠만 표시하기 위해 데이터를 필터링하고 싶어할 것입니다.
디지털 사용자는 직관적이고 사용하기 쉬우며, 지침이나 설명이 거의 없거나 전혀 없는 사용자 경험을 기대합니다.
GCP console 명령
gcloud config set project qwiklabs-gcp-00-acf9d7b837de
export GOOGLE_CLOUD_PROJECT=$(gcloud config get-value core/project)
gcloud iam service-accounts create my-natlang-sa \
--display-name "my natural language service account"
gcloud iam service-accounts keys create ~/key.json \
--iam-account my-natlang-sa@${GOOGLE_CLOUD_PROJECT}.iam.gserviceaccount.com
gcloud compute ssh [INSTANCE_NAME] --zone=[ZONE]
gcloud compute ssh linux-instance --zone=us-east4-b
gcloud ml language analyze-entities --content="Michelangelo Caravaggio, Italian painter, is known for 'The Calling of Saint Matthew'." > result.json
export API_KEY=<YOUR_API_KEY>
export API_KEY=AIzaSyCO4c7jJCH-ZaMGAld9KLbLUBbrVgpsauI
touch request.json
nano request.json
{
"config": {
"encoding":"FLAC",
"languageCode": "en-US"
},
"audio": {
"uri":"gs://cloud-samples-tests/speech/brooklyn.flac"
}
}
curl -s -X POST -H "Content-Type: application/json" --data-binary @request.json \
"https://speech.googleapis.com/v1/speech:recognize?key=${API_KEY}"
curl -s -X POST -H "Content-Type: application/json" --data-binary @request.json \
"https://speech.googleapis.com/v1/speech:recognize?key=${API_KEY}" > result.json
ML
브로드케스팅 주소
좋은 질문이에요!
**브로드캐스트 주소(Broadcast Address)**는 네트워크에서 모든 호스트에게 메시지를 보낼 때 사용하는 특수한 IP 주소입니다.
📢 브로드캐스트 주소란?
✅ 같은 네트워크(서브넷) 내의 모든 장비에게 데이터를 보내는 데 사용하는 IP 주소
예를 들어 누군가 네트워크에 연결되었을 때, DHCP 서버를 찾기 위해 “여기 있는 모든 사람들(DHCP 서버 포함), 나 좀 도와줘!” 하는 방송을 보낼 때 이 브로드캐스트 주소를 사용해요.
🧮 어떻게 구하나요?
브로드캐스트 주소는 서브넷의 마지막 IP 주소입니다.
예: 192.168.1.0/24
- 전체 IP 범위:
192.168.1.0~192.168.1.255 - 브로드캐스트 주소:
192.168.1.255 - 네트워크 주소:
192.168.1.0 - 사용 가능한 IP:
192.168.1.1~192.168.1.254
🛠️ 실제로는 어떻게 쓰일까?
| 예시 상황 | 브로드캐스트 역할 |
|---|---|
| DHCP 요청 | 클라이언트가 IP가 없을 때 DHCP 서버에게 “누구든 IP 줄 수 있나요?” 요청 |
| ARP (주소 해석 프로토콜) | “이 IP 가진 사람 누구야?“를 전체에게 질문 |
| Wake-on-LAN | 네트워크 상의 모든 장비를 깨울 때 |
🔒 보안 및 클라우드에서는?
- 클라우드(GCP, AWS 등) 환경에서는 브로드캐스트 트래픽을 막는 경우가 많아요, 보안과 성능 때문입니다.
- 대신 멀티캐스트나 유니캐스트로 대체
🎯 요약
| 항목 | 설명 |
|---|---|
| 브로드캐스트 주소 | 네트워크 내 모든 장비에 패킷을 보내는 IP |
| 위치 | 서브넷의 가장 마지막 IP |
| 사용 예시 | DHCP, ARP, Wake-on-LAN |
| 클라우드 환경 | 대부분 제한되거나 사용 불가 |
더 알고 싶은 거 있으신가요? 예: 브로드캐스트가 멀티캐스트/유니캐스트와 어떻게 다른지 비교해볼까요? 😊