범주형 데이터: 특성 교차 연습
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Playground는 머신러닝 모델 학습 및 테스트의 다양한 측면을 조작할 수 있는 대화형 애플리케이션입니다.
플레이그라운드를 사용하면 기능을 선택하고 초매개변수를 조정한 후 선택사항이 모델에 어떤 영향을 미치는지 확인할 수 있습니다.
이 페이지에는 두 가지 플레이그라운드 실습이 포함되어 있습니다.
연습 1: 기본 특성 교차
이 연습에서는 플레이그라운드의 다음 부분에 중점을 둡니다.
사용자 인터페이스:
- 특성 아래에서 세 가지 잠재적인 모델 특성을 확인합니다.
<ph type="x-smartling-placeholder">
- 출력 아래에는 주황색
파란색 점으로 표시됩니다. 주황색 점은 아픈 나무의 위치를, 파란색 점은 건강한 나무의 위치를 표시하는 정사각형 숲을 보고 있다고 가정해 보겠습니다.
- FEATURES와 OUTPUT 사이를 자세히 보면 각 지형지물을 출력에 연결하는 희미한 점선이 세 개 보입니다.
각 점선의 너비는 현재 관련된 가중치를 나타냅니다.
살펴보겠습니다 각 지형지물의 시작 가중치는 0으로 초기화되므로 이러한 선은 매우 희미합니다. 두께가 커지거나 작아지면 선의 두께도 달라집니다.
작업 1: 다음을 수행하여 플레이그라운드를 살펴봅니다.
- 지형지물 x1을 출력에 연결하는 희미한 선을 클릭합니다.
팝업이 표시됩니다.
- 팝업에서 가중치
1.0
를 입력합니다.
- Enter를 누릅니다.
다음 사항에 유의하세요.
- x1의 점선은 가중치가 0에서 1.0으로 증가할수록 더 두꺼워집니다.
- 이제 주황색과 파란색 배경이 표시됩니다.
- 주황색 배경은 모델이 아픈 나무가 있는 위치를 추측한 것입니다.
- 파란색 배경은 모델이 건강한 나무가 있는 위치를 추측한 것입니다.
모델의 성능이 좋지 않습니다. 모델 추측의 약 절반이
오답입니다.
- 가중치는 x1의 경우 1.0이고 다른 특성의 경우 0이므로 모델은 x1의 값과 정확하게 일치합니다.
작업 2: 다음 세 가지 특성 중 일부 또는 전부의 가중치를 변경하여
모델 (배경색)이 아프거나 건강하다고 예측합니다
수 있습니다. 솔루션은 플레이그라운드 바로 아래에 표시됩니다.
작업 2의 솔루션을 보려면 여기를 클릭하세요.
- w1 = 0
- w2 = 0
- x1 x2 = 모든 양수 값
재미를 위해 특성에 음수 값을 입력하면 어떻게 될까요?
교차하나요?
연습 2: 더 정교한 특성 교차
두 번째 연습에서는 주황색 점 (병든 나무)의 배열 살펴보기
출력 모델에서 파란색 점 (건강한 나무)을 살펴보면 다음과 같은 사실을 알 수 있습니다.
- 점들은 대략 구형의 패턴을 형성합니다.
- 점의 배열이 노이즈가 많습니다. 예를 들어 주황색 점의 외부 구체에 파란색 점이 가끔 표시됩니다. 결과적으로 훌륭한 모델이라도
각 점을 정확하게 예측할 가능성이 낮습니다.
작업 1: 다음을 수행하여 플레이그라운드 UI를 살펴봅니다.
- 검은색 상자 안에 있는 흰색 삼각형인 실행/일시중지 버튼을 클릭합니다.
있습니다. 플레이그라운드에서 모델 학습을 시작합니다. 관찰
에포크 카운터가 증가하고 있습니다.
- 시스템이 300세대 이상 학습한 후 동일한 실행/일시중지 버튼을 눌러 학습을 일시중지합니다.
- 모델을 살펴보죠. 모델이 잘 예측하나요? 즉,
파란색 점이 일반적으로 파란색 배경으로 둘러싸여 있고
일반적으로 주황색 배경에 둘러싸여 있는 주황색 점들은 무엇입니까?
- OUTPUT 바로 아래에 표시되는 테스트 손실 값을 검토합니다. 이것은
1.0에 가까운 값 (손실이 높음) 또는 0에 가까울수록 (손실이 더 작음)?
- 실행/일시중지 버튼 왼쪽에 있는 곡선 화살표를 눌러 플레이그라운드를 재설정합니다.
작업 2: 다음을 실행하여 더 나은 모델을 만듭니다.
- 가능한 5가지 기능의 조합을 선택하거나 선택 해제합니다.
- 학습률을 조정합니다.
- 시스템을 500세대 이상 학습시킵니다.
- 테스트 손실 값을 검토합니다. 테스트 손실이 0.2 미만이 될 수 있나요?
솔루션은 플레이그라운드 아래에 표시됩니다.
작업 1의 솔루션을 보려면 여기를 클릭하세요
모델이 최악입니다. 예를 들어 주황색의 상당수는
점들이 푸른 바다 속에서 헤엄치고 있습니다. 또한 테스트 손실이 매우 큽니다.
작업 2 솔루션을 확인하려면 여기를 클릭하세요
다음과 같은 방법으로 모델 성능을 개선할 수 있습니다.
-
두 다항식 변환 모두 선택
(x12 및 x22) 선택 해제
나머지 3개의 특성에 대해 알아보겠습니다.
-
학습률을
0.001
이하로 줄입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-06-03(UTC)
[null,null,["최종 업데이트: 2025-06-03(UTC)"],[[["\u003cp\u003ePlayground is an interactive tool for experimenting with machine learning models by adjusting features and hyperparameters to observe their impact.\u003c/p\u003e\n"],["\u003cp\u003eExercise 1 focuses on feature crosses and manipulating feature weights to achieve accurate model predictions of sick and healthy trees.\u003c/p\u003e\n"],["\u003cp\u003eExercise 2 explores model training, the influence of features and learning rate on model performance, and minimizing test loss for better predictions.\u003c/p\u003e\n"]]],[],null,["# Categorical data: Feature cross exercises\n\n[Playground](https://playground.tensorflow.org/) is an\ninteractive application that lets you manipulate various\naspects of training and testing a machine learning model.\nWith Playground, you can select features and adjust hyperparameters,\nand then discover how your choices influence a model.\n\nThis page contains two Playground exercises.\n\nExercise 1: A basic feature cross\n---------------------------------\n\nFor this exercise, focus on the following parts of the Playground\nuser interface:\n\n- Underneath FEATURES, notice the three potential model features:\n - x~1~\n - x~2~\n - x~1~x~2~\n- Underneath OUTPUT, you'll see a square containing orange and blue dots. Imagine that you're looking at a square forest, where orange dots mark the position of sick trees and blue dots mark the position of healthy trees.\n- Between FEATURES and OUTPUT, if you look very closely, you'll see three faint dashed lines connecting each feature to the output. The width of each dashed line symbolizes the weight currently associated with each feature. These lines are very faint because the starting weight for each feature is initialized to 0. As the weight grows or shrinks, so will the thickness of these lines.\n\n**Task 1:** Explore Playground by doing the following:\n\n1. Click on the faint line that connects feature x~1~ to the output. A popup appears.\n2. In the popup, enter the weight `1.0`.\n3. Press Enter.\n\nNotice the following:\n\n- The dashed line for x~1~ becomes thicker as the weight increases from 0 to 1.0.\n- An orange and blue background now appears.\n - The orange background is the model's guesses as to where the sick trees are.\n - The blue background is the model's guesses as to where the healthy trees are. The model is doing a terrible job; about half of the model's guesses are wrong.\n- Because the weight is 1.0 for x~1~ and 0 for the other features, the model matches x~1~'s values exactly.\n\n**Task 2:** Change the weights of any or all of the three features so that the\nmodel (the background colors) successfully predicts sick and healthy\ntrees. The solution appears just below Playground.\n\n\u003cbr /\u003e\n\n\n*** ** * ** ***\n\n*** ** * ** ***\n\n**Click here for the solution to Task 2** \n- *w~1~* = 0\n- *w~2~* = 0\n- *x~1~* *x~2~* = any positive value\n\nJust for fun, what happens if you input a negative value for the feature\ncross?\n\nExercise 2: A more sophisticated feature cross\n----------------------------------------------\n\nFor the second exercise, look at the arrangement of orange dots (sick trees)\nand blue dots (healthy trees) in the output model, noticing the following:\n\n- The dots form roughly spherical patterns.\n- The arrangement of dots is noisy; for example, notice the occasional blue dots in the outer sphere of orange dots. Consequently, even a great model is unlikely to correctly predict each dot.\n\n**Task 1:** Explore the Playground UI by doing the following:\n\n1. Click the Run/Pause button, which is a white triangle inside a black circle. Playground will begin training the model; observe the Epochs counter increasing.\n2. After the system has trained for at least 300 epochs, press that same Run/Pause button to pause the training.\n3. Look at the model. Is the model making good predictions? In other words, are the blue dots generally surrounded by a blue background, and are the orange dots generally surrounded by an orange background?\n4. Examine the value of Test loss, which appears just below OUTPUT. Is this value closer to 1.0 (higher loss) or closer to 0 (lower loss)?\n5. Reset Playground by pressing the curvy arrow to the left of the Run/Pause button.\n\n**Task 2:** Build a better model by doing the following:\n\n1. Select or deselect any combination of the five possible features.\n2. Adjust the learning rate.\n3. Train the system for at least 500 epochs.\n4. Examine the value of Test loss. Can you get a Test loss less than 0.2?\n\nSolutions appear below Playground.\n\n*** ** * ** ***\n\n*** ** * ** ***\n\n**Click here for the solution to Task 1** \nThe model is terrible. Notice, for example, that many of the orange\ndots are swimming in a sea of blue. Furthermore, Test loss is very high.\n**Click here for the solution to Task 2** \n\nYou can improve model performance by doing the following:\n\n- Select both polynomial transforms (x~1~^2^ and x~2~^2^) and unselect the other three possible features.\n- Reduce the learning rate to `0.001` or lower. \n[Help Center](https://support.google.com/machinelearningeducation)"]]