commit
9306275bc2
@ -0,0 +1,171 @@
|
||||
# Definiendo la ciencia de datos
|
||||
|
||||
|  ](../../sketchnotes/01-Definitions.png) |
|
||||
| :----------------------------------------------------------------------------------------------------: |
|
||||
| Definiendo la ciencia de datos - Boceto por [@nitya](https://twitter.com/nitya)_ |
|
||||
|
||||
---
|
||||
|
||||
[](https://youtu.be/beZ7Mb_oz9I)
|
||||
|
||||
## [Cuestionario antes de la lección](https://red-water-0103e7a0f.azurestaticapps.net/quiz/0)
|
||||
|
||||
## ¿Qué son los datos?
|
||||
En nuestra vida cotidiana estamos rodeados de datos. El texto que estás leyendo ahora mismo son datos. La lista de tus contactos en tu teléfono móvil son datos, como lo es la hora que muestra tu reloj. Como seres humanos, operamos naturalmente condatos como por ejemplo contando el dinero que tenemos o escribiendo cartas a nuestros amigos.
|
||||
|
||||
Sin embargo, los datos se volvieron mucho más importantes con la creación de los ordenadores. La función principal de los ordenadores es realizar cálculos, pero necesitan datos para operar. Por ello, debemos entender cómo los ordenadores almacenan y procesan estos datos.
|
||||
|
||||
Con la aparición de Internet, aumentó el papel de los ordenadores como dispositivos de tratamiento de datos. Si lo pensamos bien, ahora utilizamos los ordenadores cada vez más para el procesamiento de datos y la comunicación, incluso más que para los cálculos propiamente dichos. Cuando escribimos un correo electrónico a un amigo o buscamos información en Internet, estamos creando, almacenando, transmitiendo y manipulando datos.
|
||||
|
||||
> Te acuerdas de la última vez que utilizaste un ordenador sólo para hacer un cálculo?
|
||||
|
||||
## ¿Qué es la ciencia de datos?
|
||||
|
||||
En [Wikipedia](https://en.wikipedia.org/wiki/Data_science), **la ciencia de datos** se define como *un campo científico que utiliza métodos científicos para extraer conocimientos y percepciones de datos estructurados y no estructurados, y aplicar conocimientos procesables de los datos en una amplia gama de dominios de aplicación*.
|
||||
|
||||
Esta definición destaca los siguientes aspectos importantes de la ciencia de datos:
|
||||
|
||||
* El objetivo principal de la ciencia de datos es **extraer conocimiento** de los datos, es decir, **comprender** los datos, encontrar algunas relaciones ocultas entre ellos y construir un **modelo**.
|
||||
|
||||
* La ciencia de los datos utiliza **métodos científicos**, como la probabilidad y la estadística. De hecho, cuando se introdujo por primera vez el término *ciencia de los datos*, hubo quiens argumentó que la ciencia de los datos no era más que un nuevo nombre elegante para la estadística. Hoy en día es evidente que el campo es mucho más amplio.
|
||||
|
||||
* Los conocimientos obtenidos deben aplicarse para producir algunas **perspectivas aplicables**, es decir, percepciones prácticas que puedan ser aplicadas a situaciones empresariales reales.
|
||||
|
||||
* Deberíamos ser capaces de operar tanto con datos **estructurados** como con datos **no estructurados**. Volveremos a hablar de los diferentes tipos de datos más adelante en el curso.
|
||||
|
||||
* **El dominio de aplicación** es un concepto importante, y los científicos de datos suelen necesitar al menos cierto grado de experiencia en el dominio del problema, por ejemplo: finanzas, medicina, marketing, etc.
|
||||
|
||||
> Otro aspecto importante de la ciencia de los datos es que estudia cómo se pueden recopilar, almacenar y utilizar los datos mediante ordenadores. Mientras que la estadística nos proporciona fundamentos matemáticos, la ciencia de los datos aplica conceptos matemáticos para extraer realmente información de los datos.
|
||||
|
||||
Una de las formas (atribuida a [Jim Gray](https://en.wikipedia.org/wiki/Jim_Gray_(computer_scientist))) de ver la ciencia de los datos es considerarla como un paradigma nuevo de la ciencia:
|
||||
* **Empírico**, en el que nos basamos principalmente en las observaciones y los resultados de los experimentos
|
||||
* **Teórico**, donde los nuevos conceptos surgen de los conocimientos científicos existentes
|
||||
* **Computacional**, donde descubrimos nuevos principios basados en algunos experimentos computacionales
|
||||
* **Controlado por los datos**, basado en el descubrimiento de relaciones y patrones en los datos
|
||||
|
||||
## Otros campos relacionados
|
||||
|
||||
Dado que los datos son omnipresentes, la propia ciencia de los datos es también un campo muy amplio, que toca muchas otras disciplinas.
|
||||
|
||||
<dl>
|
||||
<dt>Bases de datos</dt>
|
||||
<dd>
|
||||
Una consideración crítica es **cómo almacenar** los datos, es decir, cómo estructurarlos de forma que permitan un procesamiento más rápido. Hay diferentes tipos de bases de datos que almacenan datos estructurados y no estructurados, que <a href="../../2-Working-With-Data/README.md">consideraremos en nuestro curso</a>.
|
||||
</dd>
|
||||
<dt>Big Data</dt>
|
||||
<dd>
|
||||
A menudo necesitamos almacenar y procesar cantidades muy grandes de datos con una estructura relativamente sencilla. Existen enfoques y herramientas especiales para almacenar esos datos de forma distribuida en un núcleo de ordenadores, y procesarlos de forma eficiente.
|
||||
</dd>
|
||||
<dt>Machine Learning o Aprendizaje automático</dt>
|
||||
<dd>
|
||||
Una forma de entender los datos es **construir un modelo** que sea capaz de predecir un resultado deseado. El desarrollo de modelos a partir de los datos se denomina **aprendizaje automático**. Quizá quieras echar un vistazo a nuestro curso <a href="https://aka.ms/ml-beginners">Machine Learning for Beginners</a> para aprender más sobre el tema.
|
||||
</dd>
|
||||
<dt>Inteligencia artificial</dt>
|
||||
<dd>
|
||||
Un área del Machine learning llamada inteligencia artificial (IA o AI, por sus siglas en inglés) también está basada en datos, e involucra construir modelos muy complejos que imitan los procesos de pensamiento humanos. Métodos de inteligencia artificial a menudo permiten transformar datos no estructurados (como el lenguaje natural) en descubrimientos estructurados sobre ellos.
|
||||
</dd>
|
||||
<dt>Visualización</dt>
|
||||
<dd>
|
||||
Cantidades muy grandes de datos son incomprensibles para un ser humano, pero una vez que creamos visualizaciones útiles con esos datos, podemos darles más sentido y sacar algunas conclusiones. Por ello, es importante conocer muchas formas de visualizar la información, algo que trataremos en <a href="../../3-Data-Visualization/README.md">la sección 3</a> de nuestro curso. Campos relacionados también incluyen la **Infografía**, y la **Interacción Persona-Ordenador** en general.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
## Tipos de datos
|
||||
|
||||
Como ya hemos dicho, los datos están en todas partes. Sólo hay que obtenerlos de la forma adecuada. Es útil distinguir entre **datos estructurados** y **datos no estructurados**. Los primeros suelen estar representados de alguna forma bien estructurada, a menudo como una tabla o un número de tablas, mientras que los segundos son simplemente una colección de archivos. A veces también podemos hablar de **datos semiestructurados**, que tienen algún tipo de estructura que puede variar mucho.
|
||||
|
||||
|
||||
| Structured | Semi-structured | Unstructured |
|
||||
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | --------------------------------------- |
|
||||
| List of people with their phone numbers | Wikipedia pages with links | Text of Encyclopaedia Britannica |
|
||||
| Temperature in all rooms of a building at every minute for the last 20 years | Collection of scientific papers in JSON format with authors, data of publication, and abstract | File share with corporate documents |
|
||||
| Data for age and gender of all people entering the building | Internet pages | Raw video feed from surveillance camera |
|
||||
|
||||
## Dónde conseguir datos
|
||||
|
||||
Hay muchas fuentes de datos posibles, y será imposible enumerarlas todas. Sin embargo, vamos a mencionar algunos de los lugares típicos donde se pueden obtener datos:
|
||||
|
||||
* **Estructurados**
|
||||
- **Internet de las cosas** (IoT), que incluye datos de diferentes sensores, como los de temperatura o presión, proporciona muchos datos útiles. Por ejemplo, si un edificio de oficinas está equipado con sensores IoT, podemos controlar automáticamente la calefacción y la iluminación para minimizar los costes.
|
||||
- **Encuestas** que pedimos a los usuarios que completen después de una compra, o después de visitar un sitio web.
|
||||
- **El análisis del comportamiento** puede, por ejemplo, ayudarnos a entender hasta qué punto se adentra un usuario en un sitio, y cuál es el motivo típico por el que lo abandonan.
|
||||
* **No estructurado**
|
||||
- Los textos pueden ser una rica fuente de información, como la puntuación general del sentimiento, o la extracción de palabras clave y el significado semántico.
|
||||
- Imágenes o vídeos. Un vídeo de una cámara de vigilancia puede utilizarse para estimar el tráfico en la carretera e informar a la gente sobre posibles atascos.
|
||||
- Los **registros** del servidor web pueden utilizarse para entender qué páginas de nuestro sitio son las más visitadas, y durante cuánto tiempo.
|
||||
* **Semiestructurados**
|
||||
- Los gráficos de las redes sociales pueden ser una gran fuente de datos sobre la personalidad de los usuarios y su eficacia para difundir información.
|
||||
- Cuando tenemos un montón de fotografías de una fiesta, podemos intentar extraer datos de **dinámica de grupos** construyendo un gráfico de las personas que se hacen fotos entre sí.
|
||||
|
||||
Al conocer las distintas fuentes posibles de datos, se puede intentar pensar en diferentes escenarios en los que se pueden aplicar técnicas de ciencia de datos para conocer mejor la situación y mejorar los procesos empresariales.
|
||||
|
||||
## Qué puedes hacer con los datos
|
||||
|
||||
En Data Science, nos centramos en los siguientes pasos del camino de los datos:
|
||||
|
||||
<dl>
|
||||
<dt>1) Adquisición de datos</dt>
|
||||
<dd>
|
||||
El primer paso es recoger los datos. Aunque en muchos casos puede ser un proceso sencillo, como los datos que llegan a una base de datos desde una aplicación web, a veces necesitamos utilizar técnicas especiales. Por ejemplo, los datos de los sensores de IoT pueden ser abrumadores, y es una buena práctica utilizar puntos finales de almacenamiento en búfer, como IoT Hub, para recoger todos los datos antes de su posterior procesamiento.
|
||||
</dd>
|
||||
<dt>2) Almacenamiento de los datos</dt>
|
||||
<dd>
|
||||
El almacenamiento de datos puede ser un reto, especialmente si hablamos de big data. A la hora de decidir cómo almacenar los datos, tiene sentido anticiparse a la forma en que se consultarán los datos en el futuro. Hay varias formas de almacenar los datos:
|
||||
<ul>
|
||||
<li>Una base de datos relacional almacena una colección de tablas y utiliza un lenguaje especial llamado SQL para consultarlas. Normalmente, las tablas se organizan en diferentes grupos llamados esquemas. En muchos casos hay que convertir los datos de la forma original para que se ajusten al esquema.</li>
|
||||
<li><a href="https://en.wikipedia.org/wiki/NoSQL">una base de datos no SQL</a>, como <a href="https://azure.microsoft.com/services/cosmos-db/?WT.mc_id=academic-31812-dmitryso">CosmosDB</a>, no impone esquemas a los datos y permite almacenar datos más complejos, por ejemplo, documentos JSON jerárquicos o gráficos. Sin embargo, las bases de datos NoSQL no tienen las ricas capacidades de consulta de SQL, y no pueden asegurar la integridad referencial, i.e. reglas sobre cómo se estructuran los datos en las tablas y que rigen las relaciones entre ellas.</li>
|
||||
<li><a href="https://en.wikipedia.org/wiki/Data_lake">Los lagos de datos</a> se utilizan para grandes colecciones de datos en bruto y sin estructurar. Los lagos de datos se utilizan a menudo con big data, donde los datos no caben en una sola máquina, y tienen que ser almacenados y procesados por un clúster de servidores. <a href="https://en.wikipedia.org/wiki/Apache_Parquet">Parquet</a> es el formato de datos que se suele utilizar junto con big data.</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt>3) Procesamiento de los datos</dt>
|
||||
<dd>
|
||||
Esta es la parte más emocionante del viaje de los datos, que consiste en convertir los datos de su forma original a una forma que pueda utilizarse para la visualización/entrenamiento de modelos. Cuando se trata de datos no estructurados, como texto o imágenes, es posible que tengamos que utilizar algunas técnicas de IA para extraer **características** de los datos, convirtiéndolos así en formato estructurado.
|
||||
</dd>
|
||||
<dt>4) Visualización / Descubrimientos humanos</dt>
|
||||
<dd>
|
||||
A menudo, para entender los datos, necesitamos visualizarlos. Al contar con muchas técnicas de visualización diferentes en nuestra caja de herramientas, podemos encontrar la vista adecuada para hacer una percepción. A menudo, un científico de datos necesita "jugar con los datos", visualizándolos muchas veces y buscando algunas relaciones. También podemos utilizar técnicas estadísticas para probar una hipótesis o demostrar una correlación entre diferentes datos.
|
||||
</dd>
|
||||
<dt>5) Entrenar un modelo predictivo</dt>
|
||||
<dd>
|
||||
Dado que el objetivo final de la ciencia de datos es poder tomar decisiones basadas en los datos, es posible que queramos utilizar las técnicas de <a href="http://github.com/microsoft/ml-for-beginners">Machine Learning</a> para construir un modelo predictivo. A continuación, podemos utilizarlo para hacer predicciones utilizando nuevos conjuntos de datos con estructuras similares.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
Por supuesto, dependiendo de los datos reales, algunos pasos podrían faltar (por ejemplo, cuando ya tenemos los datos en la base de datos, o cuando no necesitamos el entrenamiento del modelo), o algunos pasos podrían repetirse varias veces (como el procesamiento de datos).
|
||||
|
||||
## Digitalización y transformación digital
|
||||
|
||||
En la última década, muchas empresas han empezado a comprender la importancia de los datos a la hora de tomar decisiones empresariales. Para aplicar los principios de la ciencia de los datos a la gestión de una empresa, primero hay que recopilar algunos datos, es decir, traducir los procesos empresariales a formato digital. Esto se conoce como **digitalización**. La aplicación de técnicas de ciencia de datos a estos datos para orientar las decisiones puede conducir a un aumento significativo de la productividad (o incluso al pivote del negocio), lo que se denomina **transformación digital**.
|
||||
|
||||
Veamos un ejemplo. Supongamos que tenemos un curso de ciencia de datos (como éste) que impartimos en línea a los estudiantes, y queremos utilizar la ciencia de datos para mejorarlo. ¿Cómo podemos hacerlo?
|
||||
|
||||
Podemos empezar preguntándonos "¿Qué se puede digitalizar?". La forma más sencilla sería medir el tiempo que tarda cada alumno en completar cada módulo, y medir los conocimientos obtenidos haciendo un examen de opción múltiple al final de cada módulo. Haciendo una media del tiempo que tardan en completarlo todos los alumnos, podemos averiguar qué módulos causan más dificultades a los estudiantes, y trabajar en su simplificación.
|
||||
|
||||
> Se puede argumentar que este enfoque no es ideal, ya que los módulos pueden tener diferentes longitudes. Probablemente sea más justo dividir el tiempo por la longitud del módulo (en número de caracteres), y comparar esos valores en su lugar.
|
||||
|
||||
Cuando empezamos a analizar los resultados de los exámenes de opción múltiple, podemos intentar determinar qué conceptos les cuesta entender a los alumnos y utilizar esa información para mejorar el contenido. Para ello, tenemos que diseñar los exámenes de forma que cada pregunta se corresponda con un determinado concepto o trozo de conocimiento.
|
||||
|
||||
Si queremos complicarnos aún más, podemos representar el tiempo que se tarda en cada módulo en función de la categoría de edad de los alumnos. Podríamos descubrir que para algunas categorías de edad se tarda un tiempo inadecuado en completar el módulo, o que los estudiantes abandonan antes de completarlo. Esto puede ayudarnos a proporcionar recomendaciones de edad para el módulo, y minimizar la insatisfacción de la gente por expectativas erróneas.
|
||||
|
||||
## 🚀 Challenge
|
||||
|
||||
En este reto, trataremos de encontrar conceptos relevantes para el campo de la Ciencia de los Datos a través de textos. Tomaremos un artículo de Wikipedia sobre la Ciencia de los Datos, descargaremos y procesaremos el texto, y luego construiremos una nube de palabras como esta:
|
||||
|
||||

|
||||
|
||||
Visite [`notebook.ipynb`](notebook.ipynb) para leer el código. También puedes ejecutar el código y ver cómo realiza todas las transformaciones de datos en tiempo real.
|
||||
|
||||
> Si no sabe cómo ejecutar código en un "jupyter notebook", eche un vistazo a [este artículo](https://soshnikov.com/education/how-to-execute-notebooks-from-github/).
|
||||
|
||||
|
||||
|
||||
## [Cuestionario después de la lección](https://red-water-0103e7a0f.azurestaticapps.net/quiz/1)
|
||||
|
||||
## Tareas
|
||||
|
||||
* **Tarea 1**: Modifica el código anterior para encontrar conceptos relacionados para los campos de **Big Data** y **Machine Learning**.
|
||||
* **Tarea 2**: [Piensa sobre escenarios de la ciencia de datos](assignment.md)
|
||||
|
||||
## Créditos
|
||||
|
||||
Esta lección ha sido escrita con ♥️ por [Dmitry Soshnikov](http://soshnikov.com)
|
||||
@ -0,0 +1,32 @@
|
||||
# Tarea: Escenarios de la ciencia de datos
|
||||
|
||||
En esta primera tarea, os pedimos pensar sobre algún problema o proceso de la vida real en distintos contextos, y como se podrían solucionar o mejorar utilizando procesos de ciencia de datos. Piensa en lo siguiente:
|
||||
|
||||
1. ¿Qué datos puedes obtener?
|
||||
1. ¿Cómo los obtendrías?
|
||||
1. ¿Cómo los almacenarías? ¿Qué tamaño es podemos esperar que tengan los datos?
|
||||
1. ¿Qué información podrías ser capaz de extraer de estos datos? ¿qué decisiones podríamos tomar basándonos en ellos?
|
||||
|
||||
Intenta pensar en 3 diferentes problemas/procesos y describe cada uno de los puntos de arriba para el contexto de cada problema.
|
||||
|
||||
Estos son algunos problemas o contextos que pueden ayudarte a empezar a pensar:
|
||||
|
||||
1. ¿Cómo se pueden usar los datos para mejorar el proceso de educación de niños en los colegios?
|
||||
1. ¿Cómo podemos usar los datos para controlar la vacunación durante la pandemia?
|
||||
1. ¿Cómo se pueden usar los datos para asegurarnos de que somos productivos en nuestro trabajo?
|
||||
|
||||
## Instrucciones
|
||||
|
||||
Rellena la siguiente table (sustituye los problemas sugeridos por los propuestos por tí si es necesario):
|
||||
|
||||
| Contexto del problema | Problema | Qué datos obtener | Cómo almacenar los datos | Qué información/decisiones podemos tomar |
|
||||
|----------------|---------|-----------------------|-----------------------|--------------------------------------|
|
||||
| Educación | | | | |
|
||||
| Vacunación | | | | |
|
||||
| Productividad | | | | |
|
||||
|
||||
## Rúbrica
|
||||
|
||||
Ejemplar | Adecuada | Necesita mejorar
|
||||
--- | --- | -- |
|
||||
Es capaz de indentificar fuentes de datos razonables, formas de almacenarlos y posibles decisiones/información para todos los contextos | Algunos aspectos de la solución no están detallados, no se habla sobre el almacenamiento de los datos, al menos se describen dos contextos distintos | Solo se describen partes de la solución, solo se considera un contexto.
|
||||
@ -0,0 +1,17 @@
|
||||
# Inleiding tot datawetenschap
|
||||
|
||||

|
||||
> Beeld door <a href="https://unsplash.com/@dawson2406?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Stephen Dawson</a> op <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
|
||||
|
||||
In deze lessen ontdek je hoe Data Science wordt gedefinieerd en leer je over ethische overwegingen waarmee een datawetenschapper rekening moet houden. Je leert ook hoe gegevens worden gedefinieerd en leert over statistiek en waarschijnlijkheid, de academische kerndomeinen van Data Science.
|
||||
|
||||
### Onderwerpen
|
||||
|
||||
1. [Data Science definiëren](01-defining-data-science/README.md)
|
||||
2. [Ethiek in Data Science](02-ethics/README.md)
|
||||
3. [Data definiëren](03-defining-data/README.md)
|
||||
4. [Inleiding tot statistiek en kansrekening](04-stats-and-probability/README.md)
|
||||
|
||||
### Credits
|
||||
|
||||
Dit lesmateriaal is met liefde ❤️ geschreven door [Nitya Narasimhan](https://twitter.com/nitya) en [Dmitry Soshnikov](https://twitter.com/shwars).
|
||||
@ -0,0 +1,16 @@
|
||||
# Werken met gegevens
|
||||
|
||||

|
||||
> Beeld door <a href="https://unsplash.com/@swimstaralex?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Alexander Sinn</a> op <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
|
||||
|
||||
Leer over de manieren waarop gegevens kunnen worden beheerd, gemanipuleerd en gebruikt in applicaties. Leer meer over relationele en niet-relationele databases en hoe gegevens daarin kunnen worden opgeslagen. Lees over de basisprincipes van het werken met Python om gegevens te beheren, en ontdek enkele van de vele manieren waarop je met Python kunt werken om gegevens te beheren en te ontginnen.
|
||||
### Onderwerpen
|
||||
|
||||
1. [Relationele databases](05-relational-databases/README.md)
|
||||
2. [Niet-relationale databases](06-non-relational/README.md)
|
||||
3. [Aan de slag met Python](07-python/README.md)
|
||||
4. [Data voorbereiden](08-data-preparation/README.md)
|
||||
|
||||
### Credits
|
||||
|
||||
Dit materiaal is met ❤️ geschreven door [Christopher Harrison](https://twitter.com/geektrainer), [Dmitry Soshnikov](https://twitter.com/shwars) en [Jasmine Greenaway](https://twitter.com/paladique)
|
||||
@ -0,0 +1,203 @@
|
||||
# 수량 시각화
|
||||
|
||||
| ](../../../sketchnotes/09-Visualizing-Quantities.png)|
|
||||
|:---:|
|
||||
| 수량 시각화 - _제작자 : [@nitya](https://twitter.com/nitya)_ |
|
||||
|
||||
이 강의에서는 사용할 수 있는 많은 파이썬 라이브러리 중에 하나를 사용하여 수량 개념과 관련된 흥미로운 시각화를 만드는 방법을 알아봅니다. 여러분은 미네소타의 새들에 대한 정리된 데이터 세트를 사용하여, 지역 야생동물에 대한 많은 흥미로운 사실들을 배울 수 있습니다.
|
||||
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/16)
|
||||
|
||||
## Matplotlib으로 날개 길이 관찰하기
|
||||
|
||||
다양한 종류의 간단하고 정교한 플롯과 차트를 모두 생성할 수 있는 훌륭한 라이브러리는 [Matplotlib](https://matplotlib.org/stable/index.html) 입니다. 일반적으로 이러한 라이브러리를 사용하여 데이터를 그리는 프로세스에는 대상으로 지정하려는 데이터 프레임 부분 식별, 필요한 해당 데이터에 대한 변환 수행, x 및 y축 값 할당, 표시할 플롯 종류를 결정한 다음 그림을 표시하는 작업이 포함됩니다. Matplotlib은 다양한 시각화를 제공하지만, 이 강의에서는 수량 시각화에 가장 적합한 선형 차트, 산점도 및 막대그래프에 중점을 두겠습니다.
|
||||
|
||||
> ✅ 데이터 구조와 전달하려는 내용에 가장 적합한 차트를 사용하세요.
|
||||
> - 시간 경과에 따른 추세 분석: 선
|
||||
> - 값을 비교하기: 막대, 세로 막대형, 파이, 산점도
|
||||
> - 부분이 전체와 어떻게 관련되어 있는지 보여주기: 파이
|
||||
> - 데이터 분포 표시: 산점도, 막대
|
||||
> - 추세 표시: 선, 세로 막대형
|
||||
> - 값 사이의 관계 표시: 선, 산점도, 버블
|
||||
|
||||
데이터 세트가 있고 주어진 항목이 얼마나 포함되어 있는지 확인해야 하는 경우에, 가장 먼저 처리해야 하는 작업 중 하나는 해당 값을 검사하는 것입니다.
|
||||
|
||||
✅ Matplotlib에 사용할 수 있는 매우 좋은 '치트 시트'가 있습니다. [here](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-1.png) and [here](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-2.png).
|
||||
|
||||
## 새 날개 길이 값에 대한 선 그래프 작성하기
|
||||
|
||||
이 강의 폴더의 루트에 있는 `notebook.ipynb` 파일을 열고 셀을 추가합니다.
|
||||
|
||||
> 참고: 데이터는 '/데이터'폴더의 이 repo 루트에 저장됩니다.
|
||||
|
||||
```python
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
birds = pd.read_csv('../../data/birds.csv')
|
||||
birds.head()
|
||||
```
|
||||
이 데이터는 텍스트와 숫자의 혼합으로 이루어져있습니다:
|
||||
|
||||
|
||||
| | Name | ScientificName | Category | Order | Family | Genus | ConservationStatus | MinLength | MaxLength | MinBodyMass | MaxBodyMass | MinWingspan | MaxWingspan |
|
||||
| ---: | :--------------------------- | :--------------------- | :-------------------- | :----------- | :------- | :---------- | :----------------- | --------: | --------: | ----------: | ----------: | ----------: | ----------: |
|
||||
| 0 | Black-bellied whistling-duck | Dendrocygna autumnalis | Ducks/Geese/Waterfowl | Anseriformes | Anatidae | Dendrocygna | LC | 47 | 56 | 652 | 1020 | 76 | 94 |
|
||||
| 1 | Fulvous whistling-duck | Dendrocygna bicolor | Ducks/Geese/Waterfowl | Anseriformes | Anatidae | Dendrocygna | LC | 45 | 53 | 712 | 1050 | 85 | 93 |
|
||||
| 2 | Snow goose | Anser caerulescens | Ducks/Geese/Waterfowl | Anseriformes | Anatidae | Anser | LC | 64 | 79 | 2050 | 4050 | 135 | 165 |
|
||||
| 3 | Ross's goose | Anser rossii | Ducks/Geese/Waterfowl | Anseriformes | Anatidae | Anser | LC | 57.3 | 64 | 1066 | 1567 | 113 | 116 |
|
||||
| 4 | Greater white-fronted goose | Anser albifrons | Ducks/Geese/Waterfowl | Anseriformes | Anatidae | Anser | LC | 64 | 81 | 1930 | 3310 | 130 | 165 |
|
||||
|
||||
먼저 기본 선 그래프을 사용하여 숫자 데이터 중 일부를 표시해 보겠습니다. 여러분이 이 흥미로운 새들의 최대 날개 길이를 보고싶다고 가정해 보겠습니다.
|
||||
|
||||
```python
|
||||
wingspan = birds['MaxWingspan']
|
||||
wingspan.plot()
|
||||
```
|
||||

|
||||
|
||||
여러분은 바로 무언가를 알아차리셨나요? 적어도 하나의 이상값이 있는 것 같은데, 날개 폭이 꽤 넓군요! 2300센티미터의 날개 폭은 23미터와 같습니다. 미네소타를 배회하는 익룡이 있는 걸까요? 조사해 봅시다.
|
||||
|
||||
Excel에서 빠른 정렬을 수행하여 오타일 가능성이 있는 이상값을 찾을 수 있지만, 플롯 내에서 작업하여 시각화 프로세스를 계속합니다.
|
||||
|
||||
x축에 label을 추가하여 문제의 새 종류를 표시합니다.
|
||||
|
||||
```
|
||||
plt.title('Max Wingspan in Centimeters')
|
||||
plt.ylabel('Wingspan (CM)')
|
||||
plt.xlabel('Birds')
|
||||
plt.xticks(rotation=45)
|
||||
x = birds['Name']
|
||||
y = birds['MaxWingspan']
|
||||
|
||||
plt.plot(x, y)
|
||||
|
||||
plt.show()
|
||||
```
|
||||

|
||||
|
||||
label의 회전을 45도로 설정해도 읽기에는 너무 많습니다. 다른 전략을 시도해 보겠습니다. 해당 이상값에만 label을 지정하고 차트 내에 label을 설정합니다. 분산형 차트를 사용하여 labeling을 위한 더 많은 공간을 만들 수 있습니다.
|
||||
|
||||
```python
|
||||
plt.title('Max Wingspan in Centimeters')
|
||||
plt.ylabel('Wingspan (CM)')
|
||||
plt.tick_params(axis='both',which='both',labelbottom=False,bottom=False)
|
||||
|
||||
for i in range(len(birds)):
|
||||
x = birds['Name'][i]
|
||||
y = birds['MaxWingspan'][i]
|
||||
plt.plot(x, y, 'bo')
|
||||
if birds['MaxWingspan'][i] > 500:
|
||||
plt.text(x, y * (1 - 0.05), birds['Name'][i], fontsize=12)
|
||||
|
||||
plt.show()
|
||||
```
|
||||
무슨 일이 일어나고 있는 거죠? `tick_params`를 사용하여 하단 레이블을 숨긴 다음 새 데이터(bird data) 에 루프를 만들었습니다. 'bo'를 이용해 작고 동그란 파란 점으로 차트를 표시하면 최대 날개 길이가 500을 초과하는 새가 있는지 확인하고 점 옆에 label을 표시했습니다. label을 y축에서 약간 오프셋(`y * (1 - 0.05)`)하고 새 이름을 레이블로 사용했습니다.
|
||||
What did you discover?
|
||||
|
||||

|
||||
## 데이터 필터링
|
||||
|
||||
대머리 독수리(Bald eagle)와 대머리 매(Prairie falcon)은 아마도 매우 큰 새일 것이지만, 이들의 최대 날개 길이에 '0'이 추가되어 잘못 표기된 것으로 보입니다. 여러분이 25미터의 날개폭을 가진 흰머리 독수리를 만날 것 같지는 않지만, 만약 만난다면 우리에게 알려주세요! 이제 이 두 가지 이상치를 제외하고 새 데이터 프레임을 생성해 보겠습니다.
|
||||
|
||||
```python
|
||||
plt.title('Max Wingspan in Centimeters')
|
||||
plt.ylabel('Wingspan (CM)')
|
||||
plt.xlabel('Birds')
|
||||
plt.tick_params(axis='both',which='both',labelbottom=False,bottom=False)
|
||||
for i in range(len(birds)):
|
||||
x = birds['Name'][i]
|
||||
y = birds['MaxWingspan'][i]
|
||||
if birds['Name'][i] not in ['Bald eagle', 'Prairie falcon']:
|
||||
plt.plot(x, y, 'bo')
|
||||
plt.show()
|
||||
```
|
||||
|
||||
이상치를 필터링함으로써 이제 데이터의 응집력이 높아지고 이해하기 쉬워졌습니다.
|
||||
|
||||

|
||||
|
||||
이제 우리는 적어도 날개 길이 측면에서 더 깨끗한 데이터 셋를 얻었으므로 이 새들에 대해 더 자세히 알아보겠습니다.
|
||||
|
||||
선 그래프 및 산점도 그래프는 데이터 값과 그 분포에 대한 정보를 표시할 수 있지만, 이 데이터 셋에 내재된 값에 대해 고려하려고 합니다. 수량에 대한 다음 질문에 답하기 위해 시각화를 만들 수 있습니다.
|
||||
|
||||
> 새의 종류는 몇 가지이며 그 수는 얼마인가요?
|
||||
> 얼마나 많은 새들이 멸종했고, 멸종위기에 처해있고, 희귀하거나 흔할까요?
|
||||
> Linnaeus의 용어에는 얼마나 많은 다양한 속과 목들이 있나요?
|
||||
## 막대 차트 탐색
|
||||
|
||||
막대형 차트는 데이터 그룹화를 보여줘야 할 때 유용합니다. 이 데이터셋에 있는 새들의 를 탐색하여 숫자로 가장 흔한 새가 무엇인지 알아보겠습니다.
|
||||
|
||||
노트북 파일에서 기본 막대 차트를 만듭니다.
|
||||
|
||||
✅ 참고, 앞 섹션에서 식별한 두 개의 이상값 새를 필터링하거나, 날개 폭의 오타를 편집하거나, 날개 폭 값에 의존하지 않는 연습에 사용할 수 있습니다.
|
||||
|
||||
막대 차트를 만들고 싶다면 초점을 맞출 데이터를 선택하면 됩니다. 원시 데이터로 막대 차트를 만들 수 있습니다.
|
||||
|
||||
```python
|
||||
birds.plot(x='Category',
|
||||
kind='bar',
|
||||
stacked=True,
|
||||
title='Birds of Minnesota')
|
||||
|
||||
```
|
||||

|
||||
|
||||
그러나 그룹화되지 않은 데이터가 너무 많기 때문에 이 막대 차트를 읽을 수 없습니다. 표시할 데이터만 선택해야 하므로 카테고리를 기준으로 새의 길이를 살펴보겠습니다.
|
||||
|
||||
새 카테고리만 포함하도록 데이터를 필터링합니다.
|
||||
|
||||
✅ Pandas를 사용하여 데이터를 관리한 다음 Matplotlib으로 차트 작성을 합니다.
|
||||
|
||||
카테고리가 많으므로 이 차트를 세로로 표시하고 모든 데이터를 설명하도록 높이를 조정할 수 있습니다.
|
||||
|
||||
```python
|
||||
category_count = birds.value_counts(birds['Category'].values, sort=True)
|
||||
plt.rcParams['figure.figsize'] = [6, 12]
|
||||
category_count.plot.barh()
|
||||
```
|
||||

|
||||
|
||||
이 막대 차트는 각 카테고리의 새의 수를 잘 보여줍니다. 눈 깜짝할 사이에 이 지역에서 가장 많은 수의 새가 오리(Ducks)/거위(Geese)/물새(Waterfowl) 카테고리에 있음을 알 수 있습니다. 미네소타는 '10,000개의 호수의 땅'이므로 이것은 놀라운 일이 아닙니다!
|
||||
|
||||
✅ 이 데이터 세트에서 다른 수를 시도하세요. 여러분을 놀라게 하는 것이 있나요?
|
||||
|
||||
## 데이터 비교
|
||||
|
||||
새로운 축을 만들어 그룹화된 데이터의 다양한 비교를 시도할 수 있습니다. 카테고리에 따라 새의 MaxLength를 비교하세요.
|
||||
|
||||
```python
|
||||
maxlength = birds['MaxLength']
|
||||
plt.barh(y=birds['Category'], width=maxlength)
|
||||
plt.rcParams['figure.figsize'] = [6, 12]
|
||||
plt.show()
|
||||
```
|
||||

|
||||
|
||||
여기서 놀라운 것은 없습니다. 벌새(hummingbirds)는 펠리컨(Pelicans)이나 기러기(Geese)에 비해 MaxLength가 가장 짧습니다. 데이터가 논리적으로 타당할 때 좋습니다!
|
||||
|
||||
데이터를 중첩하여 막대 차트에 대한 더 흥미로운 시각화를 만들 수 있습니다. 주어진 새 카테고리에 최소 및 최대 길이를 중첩해 보겠습니다.
|
||||
|
||||
```python
|
||||
minLength = birds['MinLength']
|
||||
maxLength = birds['MaxLength']
|
||||
category = birds['Category']
|
||||
|
||||
plt.barh(category, maxLength)
|
||||
plt.barh(category, minLength)
|
||||
|
||||
plt.show()
|
||||
```
|
||||
이 플롯에서는 최소 길이 및 최대 길이의 새 카테고리당 범위를 볼 수 있습니다. 이 데이터를 고려할 때, 새의 몸길이가 클수록 새의 몸길이는 더 넓어진다고 해도 무방할 것입니다. 신기하지 않나요!
|
||||
|
||||

|
||||
|
||||
## 🚀 도전
|
||||
|
||||
이 새 데이터 셋은 특정 생태계 내의 다양한 종류의 새에 대한 풍부한 정보를 제공합니다. 인터넷을 검색하여 다른 조류 지향 데이터 셋을 찾을 수 있는지 확인해 보세요. 여러분이 깨닫지 못한 사실을 발견하기 위해 이 새들에 대한 차트와 그래프를 만드는 연습을 하세요.
|
||||
## [이전 강의 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/17)
|
||||
|
||||
## 복습 & 자기주도학습
|
||||
|
||||
이번 첫번째 강의에서는 Matplotlib을 사용하여 수량을 시각화하는 방법에 대한 몇 가지 정보를 배웠습니다. 시각화를 위해 데이터셋으로 작업할 수 있는 다른 방법에 대해 알아보세요. [Plotly](https://github.com/plotly/plotly.py) 는 이 강의에서 다루지 않을 내용입니다. 어떤 기능을 제공하는지 살펴보세요.
|
||||
## 과제
|
||||
|
||||
[선, 산점도, 막대 그래프](assignment.md)
|
||||
@ -0,0 +1,11 @@
|
||||
# 선, 산점도, 막대 그래프
|
||||
|
||||
## 지침
|
||||
|
||||
이 강의에서는 선형 차트, 산점도 및 막대형 차트를 사용하여 이 데이터 셋에 대한 흥미로운 사실을 보여 주었습니다. 이 과제에서는 데이터셋을 자세히 조사하여 특정 유형의 새에 대한 사실을 발견하는 과정을 진행합니다. 예를 들어, 흰기러기(Snoew Geese)에 대한 모든 흥미로운 데이터를 시각화하는 노트북을 만드는 것이 있습니다. 위에서 언급한 세 가지의 플롯을 사용하여 여러분의 노트북을 만들어보세요.
|
||||
|
||||
## 기준표
|
||||
|
||||
모범적인 | 적당한 | 개선 필요
|
||||
--- | --- | -- |
|
||||
좋은 주석처리, 탄탄한 내용, 매력적인 그래프로 노트북 작성 | 노트북에 다음 요소 중 하나가 없습니다. | 노트북에 요소 중에 두 가지가 없습니다.
|
||||
@ -0,0 +1,193 @@
|
||||
# 분포 시각화하기
|
||||
|
||||
| ](../../sketchnotes/10-Visualizing-Distributions.png)|
|
||||
|:---:|
|
||||
| 분포 시각화 - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
|
||||
|
||||
이전 수업에서, 미네소타의 새에 대한 데이터셋에 대해서 몇몇 흥미로운 사실들을 배웠습니다. 이상치를 시각화하면서 잘못된 데이터들을 발견하고 새들의 최대 길이에 따라 새 카테고리들의 차이를 살펴보았습니다.
|
||||
|
||||
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/18)
|
||||
## 새 데이터셋 탐색하기
|
||||
|
||||
데이터를 자세히 조사하는 또 다른 방법은 데이터의 분포, 또는 데이터가 축에 따라 구성되는 방식을 살펴보는 것입니다. 예를 들어, 미네소타 새들의 최대 날개 길이나 최대 체중의 일반적인 분포에 대해 알고 싶을 수도 있습니다.
|
||||
|
||||
이 데이터셋의 데이터 분포에 대한 몇 가지 사실들을 알아보겠습니다. 이 수업 폴더의 루트에 있는 _notebook.ipynb_파일에서 Pandas, Matplotlib 및 데이터를 import합니다:
|
||||
|
||||
```python
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
birds = pd.read_csv('../../data/birds.csv')
|
||||
birds.head()
|
||||
```
|
||||
|
||||
일반적으로, 이전 수업에서와 같이 산점도를 사용하면 데이터가 분포되는 방식을 빠르게 확인할 수 있습니다:
|
||||
|
||||
```python
|
||||
birds.plot(kind='scatter',x='MaxLength',y='Order',figsize=(12,8))
|
||||
|
||||
plt.title('Max Length per Order')
|
||||
plt.ylabel('Order')
|
||||
plt.xlabel('Max Length')
|
||||
|
||||
plt.show()
|
||||
```
|
||||
이렇게 하면 새 한 마리당 몸길이의 일반적인 분포에 대한 개요를 제공하지만 실제 분포를 표시하는 최적의 방법은 아닙니다. 이 작업은 보통 히스토그램을 생성하여 처리됩니다.
|
||||
## 히스토그램으로 작업하기
|
||||
|
||||
Matplotlib는 히스토그램을 사용하여 데이터 분포를 시각화하는 매우 좋은 방법을 제공합니다. 이 유형의 차트는 막대의 상승 및 하락을 통해 분포를 확인할 수 있는 막대 차트와 같습니다. 히스토그램을 작성하려면 숫자 데이터가 필요합니다. 히스토그램을 작성하기 위해, 히스토그램의 종류를 'hist'로 정의하는 차트를 표시할 수 있습니다. 이 차트는 전체 데이터셋의 숫자 데이터 범위에 대한 MaxBodyMass 분포를 보여 줍니다. 주어진 데이터의 배열을 더 작은 폭(bins)으로 나누어 데이터 값의 분포를 표시할 수 있습니다:
|
||||
|
||||
```python
|
||||
birds['MaxBodyMass'].plot(kind = 'hist', bins = 10, figsize = (12,12))
|
||||
plt.show()
|
||||
```
|
||||

|
||||
|
||||
보시다시피, 이 데이터셋에 있는 400마리 이상의 새들의 대부분은 최대 체질량에서 2000 미만의 범위에 속합니다. 매개 변수 `bins`를 30과 같이 더 높은 숫자로 변경하여 데이터에 대한 더 깊이 이해하세요:
|
||||
|
||||
```python
|
||||
birds['MaxBodyMass'].plot(kind = 'hist', bins = 30, figsize = (12,12))
|
||||
plt.show()
|
||||
```
|
||||

|
||||
|
||||
이 차트는 좀 더 세분화된 방식으로 분포를 보여줍니다. 주어진 범위 내에서만 데이터를 선택하여 왼쪽으로 치우치지 않은 차트를 만들 수 있습니다:
|
||||
|
||||
데이터를 필터링하여 체중이 60 미만인 새들만 골라서 40개의 `bins`을 표시합니다:
|
||||
|
||||
```python
|
||||
filteredBirds = birds[(birds['MaxBodyMass'] > 1) & (birds['MaxBodyMass'] < 60)]
|
||||
filteredBirds['MaxBodyMass'].plot(kind = 'hist',bins = 40,figsize = (12,12))
|
||||
plt.show()
|
||||
```
|
||||

|
||||
|
||||
✅ 다른 필터와 데이터 포인트를 사용해보세요. 데이터의 전체 분포를 보려면, 라벨링된 분포를 표시하도록 `['MaxBodyMass']` 필터를 제거하세요.
|
||||
|
||||
히스토그램에서는 다음과 같은 몇 가지 색상 및 레이블 향상 기능도 제공합니다:
|
||||
|
||||
2D 히스토그램을 생성하여 두 분포 간의 관계를 비교합니다. `MaxBodyMass`와 `MaxLength`를 비교해보겠습니다. Matplotlib은 더 밝은 색상을 사용하여 수렴을 보여주는 기본 제공 방법을 제공합니다:
|
||||
|
||||
```python
|
||||
x = filteredBirds['MaxBodyMass']
|
||||
y = filteredBirds['MaxLength']
|
||||
|
||||
fig, ax = plt.subplots(tight_layout=True)
|
||||
hist = ax.hist2d(x, y)
|
||||
```
|
||||
예상되는 축을 따라 이 두 요소 사이에는 다음과 같은 특별한 수렴이 있는 것으로 보입니다:
|
||||
|
||||

|
||||
|
||||
히스토그램은 숫자 데이터에 대해 기본적으로 잘 작동합니다. 텍스트 데이터에 따라 분포를 확인하려면 어떻게 해야 합니까?
|
||||
|
||||
## 텍스트 데이터를 사용하여 분포에 대한 데이터셋 탐색하기
|
||||
|
||||
이 데이터셋에는 새 카테고리와 속, 종, 과에 대한 좋은 정보와 보존 상태도 포함되어 있습니다. 이 보존 정보를 자세히 살펴봅시다. 새들의 보존 상태에 따라 분포는 어떻게 되나요?
|
||||
|
||||
> ✅ 데이터셋에서 보존 상태를 설명하기 위해 여러 약어가 사용됩니다. 이 약어는 종의 상태를 분류하는 기관인 [세계자연보전연맹 멸종위기생물목록 카테고리](https://www.iucnredlist.org/)에서 가져왔습니다.
|
||||
>
|
||||
> - CR: 심각한 멸종 위기
|
||||
> - EN: 멸종 위기에 처한
|
||||
> - EX: 멸종
|
||||
> - LC: 관심대상
|
||||
> - NT: 거의 위협
|
||||
> - VU: 취약
|
||||
|
||||
텍스트 기반 값이므로 히스토그램을 생성하려면 변환을 수행해야 합니다. filteredBirds 데이터프레임을 사용하여 최소 날개 길이과 함께 보존 상태를 표시합니다. 무엇을 볼 수 있습니까?
|
||||
|
||||
```python
|
||||
x1 = filteredBirds.loc[filteredBirds.ConservationStatus=='EX', 'MinWingspan']
|
||||
x2 = filteredBirds.loc[filteredBirds.ConservationStatus=='CR', 'MinWingspan']
|
||||
x3 = filteredBirds.loc[filteredBirds.ConservationStatus=='EN', 'MinWingspan']
|
||||
x4 = filteredBirds.loc[filteredBirds.ConservationStatus=='NT', 'MinWingspan']
|
||||
x5 = filteredBirds.loc[filteredBirds.ConservationStatus=='VU', 'MinWingspan']
|
||||
x6 = filteredBirds.loc[filteredBirds.ConservationStatus=='LC', 'MinWingspan']
|
||||
|
||||
kwargs = dict(alpha=0.5, bins=20)
|
||||
|
||||
plt.hist(x1, **kwargs, color='red', label='Extinct')
|
||||
plt.hist(x2, **kwargs, color='orange', label='Critically Endangered')
|
||||
plt.hist(x3, **kwargs, color='yellow', label='Endangered')
|
||||
plt.hist(x4, **kwargs, color='green', label='Near Threatened')
|
||||
plt.hist(x5, **kwargs, color='blue', label='Vulnerable')
|
||||
plt.hist(x6, **kwargs, color='gray', label='Least Concern')
|
||||
|
||||
plt.gca().set(title='Conservation Status', ylabel='Max Body Mass')
|
||||
plt.legend();
|
||||
```
|
||||
|
||||

|
||||
|
||||
최소 날개 길이와 보존 상태 사이에는 좋은 상관 관계가 없어 보입니다. 이 방법을 사용하여 데이터셋의 다른 요소를 테스트합니다. 다른 필터를 시도해 볼 수도 있습니다. 상관관계가 있습니까?
|
||||
|
||||
## 밀도분포 그래프
|
||||
|
||||
지금까지 살펴본 히스토그램이 '계단형'이며 호를 따라 부드럽게 흐르지 않는다는 것을 눈치채셨을 수도 있습니다. 더 부드러운 밀도 차트를 표시하려면 밀도분포 그래프를 시도할 수 있습니다.
|
||||
|
||||
밀도분포 그래프를 사용하려면 새로운 플롯 라이브러리 [Seaborn](https://seaborn.pydata.org/generated/seaborn.kdeplot.html)에 익숙해지세요.
|
||||
|
||||
Seaborn을 로드하고 기본 밀도분포 그래프를 시도하기:
|
||||
|
||||
```python
|
||||
import seaborn as sns
|
||||
import matplotlib.pyplot as plt
|
||||
sns.kdeplot(filteredBirds['MinWingspan'])
|
||||
plt.show()
|
||||
```
|
||||

|
||||
|
||||
최소 날개 길이 데이터에 대해 이전 그림이 어떻게 반영되는지 확인할 수 있습니다; 조금 더 부드워졌습니다. Seaborn의 문서에 따르면 "히스토그램에 비해 KDE는 특히 다중 분포를 그릴 때 덜 복잡하고 더 해석하기 쉬운 플롯을 생성할 수 있습니다. 그러나 기본 분포가 한정되어 있거나 매끄럽지 않은 경우 왜곡이 있을 가능성이 있습니다. 히스토그램과 마찬가지로 표현의 품질도 좋은 평활화 매개변수(smoothing parameters)의 선택에 따라 달라집니다." [출처](https://seaborn.pydata.org/generated/seaborn.kdeplot.html) 다시 말해, 이상치는 차트를 잘못 작동하게 만듭니다.
|
||||
|
||||
두 번째 차트에서 들쭉날쭉한 MaxBodyMass 선을 다시 보고 싶다면, 다음 방법을 사용하여 다시 만들면 매우 부드럽게 만들 수 있습니다:
|
||||
|
||||
```python
|
||||
sns.kdeplot(filteredBirds['MaxBodyMass'])
|
||||
plt.show()
|
||||
```
|
||||

|
||||
|
||||
부드럽지만 너무 부드럽지 않은 선을 원하는 경우 `bw_adjust` 매개변수를 편집하세요:
|
||||
|
||||
```python
|
||||
sns.kdeplot(filteredBirds['MaxBodyMass'], bw_adjust=.2)
|
||||
plt.show()
|
||||
```
|
||||

|
||||
|
||||
✅ 이러한 유형의 그림 및 실험에 사용할 수 있는 매개변수에 대해 읽어보세요!
|
||||
|
||||
이러한 유형의 차트는 아름답게 설명되는 시각화를 제공합니다. 예를 들어 코드 몇 줄을 사용하여 새 한마리당 최대 체질량 밀도를 표시할 수 있습니다:
|
||||
|
||||
```python
|
||||
sns.kdeplot(
|
||||
data=filteredBirds, x="MaxBodyMass", hue="Order",
|
||||
fill=True, common_norm=False, palette="crest",
|
||||
alpha=.5, linewidth=0,
|
||||
)
|
||||
```
|
||||
|
||||

|
||||
|
||||
여러 변수의 밀도를 하나의 차트에서 보여줄 수도 있습니다. 새의 보존 상태와 비교하여 새의 MaxLength 및 MinLength 텍스트 입력하세요:
|
||||
|
||||
```python
|
||||
sns.kdeplot(data=filteredBirds, x="MinLength", y="MaxLength", hue="ConservationStatus")
|
||||
```
|
||||
|
||||

|
||||
|
||||
아마도 이러한 길이에 따른 '취약한' 새들의 무리가 의미가 있는지 없는지 연구해볼 가치가 있을 것입니다.
|
||||
|
||||
## 🚀 도전
|
||||
|
||||
히스토그램은 기본 산점도, 막대 차트 또는 꺾은선형 차트보다 더 정교한 유형의 차트입니다. 히스토그램 사용의 좋은 예를 찾으려면 인터넷에서 검색해보세요. 어떻게 사용되고, 무엇을 입증하며, 어떤 분야나 조사 분야에서 사용되는 경향이 있습니까?
|
||||
|
||||
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/19)
|
||||
|
||||
## 복습 & 자기주도학습
|
||||
|
||||
이 수업에서는 Matplotlib를 사용하고 보다 정교한 차트를 보여주기 위해 Seaborn으로 작업을 시작했습니다. "하나 이상의 차원에서 연속 확률 밀도 곡선"인 Seaborn의 `kdeplot`에 대한 연구를 수행하세요. 작동 방식을 이해하려면 [문서](https://seaborn.pydata.org/generated/seaborn.kdeplot.html)를 읽어보세요.
|
||||
|
||||
## 과제
|
||||
|
||||
[기술 적용해보기](assignment.md)
|
||||
@ -0,0 +1,10 @@
|
||||
# 기술 적용해보기
|
||||
|
||||
## 지시사항
|
||||
|
||||
지금까지 새의 양과 개체 밀도에 대한 정보를 찾기 위해서 미네소타 새 데이터셋으로 작업하였습니다. [Kaggle](https://www.kaggle.com/)에서 제공하는 다른 데이터셋을 사용하여 이러한 기술 적용을 연습해보세요. 이 데이터셋에 대해서 알려줄 수 있는 노트북을 만들고, 논의할 때 히스토그램을 사용하세요.
|
||||
## 채점기준표
|
||||
|
||||
모범 | 충분 | 개선 필요
|
||||
--- | --- | -- |
|
||||
노트북은 출처를 포함하여 이 데이터셋에 대한 주석이 제공되며, 데이터에 대한 사실을 발견하기 위해서 최소 5개의 히스토그램을 사용합니다. | 노트북은 불완전한 주석이나 버그가 표시됩니다. | 노트북은 주석 없이 표시되며 버그가 포함되어 있습니다.
|
||||
@ -0,0 +1,18 @@
|
||||
# Try it in Excel
|
||||
# 엑셀로 해보세요.
|
||||
|
||||
## Instructions
|
||||
## 지시사항
|
||||
|
||||
Did you know you can create donut, pie, and waffle charts in Excel? Using a dataset of your choice, create these three charts right in an Excel spreadsheet.
|
||||
엑셀에서 도넛, 파이, 와플 차트를 만들 수 있다는 것을 알고 있었나요? 선택한 데이터셋을 사용하여 Excel 스프레드시트에 세 개의 차트를 직접 만드십시오.
|
||||
|
||||
## Rubric
|
||||
## 루브릭
|
||||
|
||||
| Exemplary | Adequate | Needs Improvement |
|
||||
| ------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------ |
|
||||
| An Excel spreadsheet is presented with all three charts | An Excel spreadsheet is presented with two charts | An Excel spreadsheet is presented with only one chart |
|
||||
| 모범 | 충분 | 개선 필요 |
|
||||
| ------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------ |
|
||||
| 엑셀 스프레드시트는 세 차트와 함께 제시됩니다 | 엑셀 스프레드시트는 두 차트와 함께 제시됩니다 | 엑셀 스프레드시트는 오직 하나의 차트와 함께 제시됩니다 |
|
||||
@ -0,0 +1,227 @@
|
||||
# Visualizing Proportions
|
||||
# 비율 시각화
|
||||
|
||||
| ](../../sketchnotes/11-Visualizing-Proportions.png)|
|
||||
|:---:|
|
||||
|Visualizing Proportions - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
|
||||
|비율 시각화 - _제작자 : [@nitya](https://twitter.com/nitya)_ |
|
||||
|
||||
In this lesson, you will use a different nature-focused dataset to visualize proportions, such as how many different types of fungi populate a given dataset about mushrooms. Let's explore these fascinating fungi using a dataset sourced from Audubon listing details about 23 species of gilled mushrooms in the Agaricus and Lepiota families. You will experiment with tasty visualizations such as:
|
||||
이 과정에서는 버섯에 대해 주어진 데이터셋에 얼마나 많은 종류의 곰팡이가 채워져 있는지와 같은 다른 자연에 초점을 맞춘 데이터셋을 사용하여 비율을 시각화합니다. Agaricus와 Lepiota과에 속하는 23종의 구이버섯에 대한 세부 정보를 나열한 Audubon의 데이터셋을 이용하여 이 매력적인 곰팡이를 탐험해 봅시다. 다음과 같은 맛있는 시각화를 실험하게 됩니다.
|
||||
|
||||
- Pie charts 🥧
|
||||
- Donut charts 🍩
|
||||
- Waffle charts 🧇
|
||||
- 원형 차트 🥧
|
||||
- 도넛 차트 🍩
|
||||
- 와플 차트 🧇
|
||||
|
||||
> 💡 A very interesting project called [Charticulator](https://charticulator.com) by Microsoft Research offers a free drag and drop interface for data visualizations. In one of their tutorials they also use this mushroom dataset! So you can explore the data and learn the library at the same time: [Charticulator tutorial](https://charticulator.com/tutorials/tutorial4.html).
|
||||
> 💡 Microsoft Research의 [Charticulator](https://charticulator.com)라는 매우 흥미로운 프로젝트는 데이터 시각화를 위한 무료 끌어 놓기(드래그 앤 드랍) 인터페이스를 제공합니다. 튜토리얼 중 하나에서는 버섯 데이터 세트도 사용합니다! 따라서 데이터를 탐색하면서 라이브러리를 동시에 학습할 수 있습니다. [Charticulator tutorial](https://charticulator.com/tutorials/tutorial4.html).
|
||||
|
||||
## [Pre-lecture quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/20)
|
||||
## [사전 강의 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/20)
|
||||
|
||||
## Get to know your mushrooms 🍄
|
||||
## 버섯을 알아가세요 🍄
|
||||
|
||||
Mushrooms are very interesting. Let's import a dataset to study them:
|
||||
버섯은 매우 흥미롭습니다. 데이터셋을 가져와 연구해 보겠습니다.
|
||||
|
||||
```python
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
mushrooms = pd.read_csv('../../data/mushrooms.csv')
|
||||
mushrooms.head()
|
||||
```
|
||||
A table is printed out with some great data for analysis:
|
||||
분석을 위한 몇 가지 훌륭한 데이터가 포함된 표가 인쇄됩니다:
|
||||
|
||||
|
||||
| class | cap-shape | cap-surface | cap-color | bruises | odor | gill-attachment | gill-spacing | gill-size | gill-color | stalk-shape | stalk-root | stalk-surface-above-ring | stalk-surface-below-ring | stalk-color-above-ring | stalk-color-below-ring | veil-type | veil-color | ring-number | ring-type | spore-print-color | population | habitat |
|
||||
| --------- | --------- | ----------- | --------- | ------- | ------- | --------------- | ------------ | --------- | ---------- | ----------- | ---------- | ------------------------ | ------------------------ | ---------------------- | ---------------------- | --------- | ---------- | ----------- | --------- | ----------------- | ---------- | ------- |
|
||||
| Poisonous | Convex | Smooth | Brown | Bruises | Pungent | Free | Close | Narrow | Black | Enlarging | Equal | Smooth | Smooth | White | White | Partial | White | One | Pendant | Black | Scattered | Urban |
|
||||
| Edible | Convex | Smooth | Yellow | Bruises | Almond | Free | Close | Broad | Black | Enlarging | Club | Smooth | Smooth | White | White | Partial | White | One | Pendant | Brown | Numerous | Grasses |
|
||||
| Edible | Bell | Smooth | White | Bruises | Anise | Free | Close | Broad | Brown | Enlarging | Club | Smooth | Smooth | White | White | Partial | White | One | Pendant | Brown | Numerous | Meadows |
|
||||
| Poisonous | Convex | Scaly | White | Bruises | Pungent | Free | Close | Narrow | Brown | Enlarging | Equal | Smooth | Smooth | White | White | Partial | White | One | Pendant | Black | Scattered | Urban |
|
||||
|
||||
Right away, you notice that all the data is textual. You will have to convert this data to be able to use it in a chart. Most of the data, in fact, is represented as an object:
|
||||
바로, 모든 데이터가 텍스트임을 알 수 있습니다. 이 데이터를 차트에서 사용하려면 데이터를 변환해야 합니다. 실제로 대부분의 데이터는 개체로 표현됩니다:
|
||||
|
||||
```python
|
||||
print(mushrooms.select_dtypes(["object"]).columns)
|
||||
```
|
||||
|
||||
The output is:
|
||||
출력은 다음과 같습니다:
|
||||
|
||||
```output
|
||||
Index(['class', 'cap-shape', 'cap-surface', 'cap-color', 'bruises', 'odor',
|
||||
'gill-attachment', 'gill-spacing', 'gill-size', 'gill-color',
|
||||
'stalk-shape', 'stalk-root', 'stalk-surface-above-ring',
|
||||
'stalk-surface-below-ring', 'stalk-color-above-ring',
|
||||
'stalk-color-below-ring', 'veil-type', 'veil-color', 'ring-number',
|
||||
'ring-type', 'spore-print-color', 'population', 'habitat'],
|
||||
dtype='object')
|
||||
```
|
||||
Take this data and convert the 'class' column to a category:
|
||||
이 데이터를 가져와서 '클래스' 열을 범주로 변환합니다:
|
||||
|
||||
```python
|
||||
cols = mushrooms.select_dtypes(["object"]).columns
|
||||
mushrooms[cols] = mushrooms[cols].astype('category')
|
||||
```
|
||||
Now, if you print out the mushrooms data, you can see that it has been grouped into categories according to the poisonous/edible class:
|
||||
이제 버섯 데이터를 인쇄하면 poisonous/editable 클래스에 따라 범주로 분류되었음을 알 수 있습니다:
|
||||
|
||||
|
||||
| | cap-shape | cap-surface | cap-color | bruises | odor | gill-attachment | gill-spacing | gill-size | gill-color | stalk-shape | ... | stalk-surface-below-ring | stalk-color-above-ring | stalk-color-below-ring | veil-type | veil-color | ring-number | ring-type | spore-print-color | population | habitat |
|
||||
| --------- | --------- | ----------- | --------- | ------- | ---- | --------------- | ------------ | --------- | ---------- | ----------- | --- | ------------------------ | ---------------------- | ---------------------- | --------- | ---------- | ----------- | --------- | ----------------- | ---------- | ------- |
|
||||
| class | | | | | | | | | | | | | | | | | | | | | |
|
||||
| Edible | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 | ... | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 | 4208 |
|
||||
| Poisonous | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 | ... | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 | 3916 |
|
||||
|
||||
If you follow the order presented in this table to create your class category labels, you can build a pie chart:
|
||||
이 표에 나와 있는 순서에 따라 클래스 범주 레이블을 만들면 파이 차트를 작성할 수 있습니다:
|
||||
|
||||
## Pie!
|
||||
## 파이!
|
||||
|
||||
```python
|
||||
labels=['Edible','Poisonous']
|
||||
plt.pie(edibleclass['population'],labels=labels,autopct='%.1f %%')
|
||||
plt.title('Edible?')
|
||||
plt.show()
|
||||
```
|
||||
Voila, a pie chart showing the proportions of this data according to these two classes of mushrooms. It's quite important to get the order of the labels correct, especially here, so be sure to verify the order with which the label array is built!
|
||||
|
||||

|
||||

|
||||
|
||||
## Donuts!
|
||||
## 도넛!
|
||||
|
||||
A somewhat more visually interesting pie chart is a donut chart, which is a pie chart with a hole in the middle. Let's look at our data using this method.
|
||||
좀 더 시각적으로 흥미로운 파이 차트는 도넛 차트입니다. 이것은 가운데에 구멍이 있는 파이 차트입니다. 이 방법을 사용하여 우리의 데이터를 살펴봅시다.
|
||||
|
||||
Take a look at the various habitats where mushrooms grow:
|
||||
버섯이 자라는 다양한 서식지를 살펴보세요:
|
||||
|
||||
```python
|
||||
habitat=mushrooms.groupby(['habitat']).count()
|
||||
habitat
|
||||
```
|
||||
Here, you are grouping your data by habitat. There are 7 listed, so use those as labels for your donut chart:
|
||||
여기서는 서식지에 따라 데이터를 그룹화합니다. 7개가 나열되어 있으므로 도넛 차트의 레이블로 사용합니다:
|
||||
|
||||
```python
|
||||
labels=['Grasses','Leaves','Meadows','Paths','Urban','Waste','Wood']
|
||||
|
||||
plt.pie(habitat['class'], labels=labels,
|
||||
autopct='%1.1f%%', pctdistance=0.85)
|
||||
|
||||
center_circle = plt.Circle((0, 0), 0.40, fc='white')
|
||||
fig = plt.gcf()
|
||||
|
||||
fig.gca().add_artist(center_circle)
|
||||
|
||||
plt.title('Mushroom Habitats')
|
||||
|
||||
plt.show()
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
This code draws a chart and a center circle, then adds that center circle in the chart. Edit the width of the center circle by changing `0.40` to another value.
|
||||
이 코드는 차트와 중심 원을 그리고, 차트에 해당 중심 원을 추가합니다. 0.40을 다른 값으로 변경하여 중심 원의 너비를 편집합니다.
|
||||
|
||||
Donut charts can be tweaked in several ways to change the labels. The labels in particular can be highlighted for readability. Learn more in the [docs](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html?highlight=donut).
|
||||
도넛 차트는 레이블을 변경하기 위해 여러 가지 방법으로 수정할 수 있습니다. 특히 라벨은 가독성을 위해 강조 표시할 수 있습니다. 자세한 내용은 [https](https://matplotlib.org/stable/gallery/pie_and_polar_charts/pie_and_donut_labels.html?highlight=donut))에서 확인하십시오.
|
||||
|
||||
Now that you know how to group your data and then display it as a pie or donut, you can explore other types of charts. Try a waffle chart, which is just a different way of exploring quantity.
|
||||
## Waffles!
|
||||
이제 데이터를 그룹화한 다음 파이 또는 도넛으로 표시하는 방법을 알았으므로 다른 유형의 차트를 살펴볼 수 있습니다. 양을 탐구하는 다른 방법인 와플 차트를 시도해 보세요.
|
||||
## 와플!
|
||||
|
||||
A 'waffle' type chart is a different way to visualize quantities as a 2D array of squares. Try visualizing the different quantities of mushroom cap colors in this dataset. To do this, you need to install a helper library called [PyWaffle](https://pypi.org/project/pywaffle/) and use Matplotlib:
|
||||
'와플' 유형 차트는 양을 2D 정사각형 배열로 시각화하는 다른 방법입니다. 이 데이터셋에 있는 버섯 머리 색상의 다양한 양을 시각화해 보십시오. 이렇게 하려면 [PyWaffle](https://pypi.org/project/pywaffle/)이라는 도우미 라이브러리를 설치하고 Matplotlib을 사용해야 합니다:
|
||||
|
||||
```python
|
||||
pip install pywaffle
|
||||
```
|
||||
|
||||
Select a segment of your data to group:
|
||||
그룹화할 데이터의 부분 선택:
|
||||
|
||||
```python
|
||||
capcolor=mushrooms.groupby(['cap-color']).count()
|
||||
capcolor
|
||||
```
|
||||
|
||||
Create a waffle chart by creating labels and then grouping your data:
|
||||
레이블을 만든 다음 데이터를 그룹화하여 와플 차트를 만듭니다:
|
||||
|
||||
```python
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
from pywaffle import Waffle
|
||||
|
||||
data ={'color': ['brown', 'buff', 'cinnamon', 'green', 'pink', 'purple', 'red', 'white', 'yellow'],
|
||||
'amount': capcolor['class']
|
||||
}
|
||||
|
||||
df = pd.DataFrame(data)
|
||||
|
||||
fig = plt.figure(
|
||||
FigureClass = Waffle,
|
||||
rows = 100,
|
||||
values = df.amount,
|
||||
labels = list(df.color),
|
||||
figsize = (30,30),
|
||||
colors=["brown", "tan", "maroon", "green", "pink", "purple", "red", "whitesmoke", "yellow"],
|
||||
)
|
||||
```
|
||||
|
||||
Using a waffle chart, you can plainly see the proportions of cap colors of this mushrooms dataset. Interestingly, there are many green-capped mushrooms!
|
||||
와플 차트를 사용하면 이 버섯 데이터셋의 머리 색상 비율을 쉽게 알 수 있습니다. 흥미롭게도, 녹색 머리가 있는 버섯이 많이 있답니다!
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
✅ Pywaffle supports icons within the charts that use any icon available in [Font Awesome](https://fontawesome.com/). Do some experiments to create an even more interesting waffle chart using icons instead of squares.
|
||||
✅ Pywaffle은 차트 내에서 [Font Awesome](https://fontawesome.com/))에서 사용할 수 있는 아이콘을 지원합니다. 정사각형 대신 아이콘을 사용하여 훨씬 더 흥미로운 와플 차트를 만들기 위해 몇 가지 실험을 해보세요.
|
||||
|
||||
In this lesson, you learned three ways to visualize proportions. First, you need to group your data into categories and then decide which is the best way to display the data - pie, donut, or waffle. All are delicious and gratify the user with an instant snapshot of a dataset.
|
||||
이 과정에서는 비율을 시각화하는 세 가지 방법을 배웠습니다. 먼저 데이터를 범주로 분류한 다음 파이, 도넛 또는 와플 중 어떤 것이 데이터를 표시하는 가장 좋은 방법인지 결정해야 합니다. 이 모든 것이 맛있고 데이터셋의 즉각적인 스냅샷으로 사용자를 만족시킵니다.
|
||||
|
||||
## 🚀 Challenge
|
||||
## 🚀 도전
|
||||
|
||||
Try recreating these tasty charts in [Charticulator](https://charticulator.com).
|
||||
## [Post-lecture quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/21)
|
||||
[Charticulator](https://charticulator.com)에서 맛있는 차트를 다시 만들어 보십시오.
|
||||
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/21)
|
||||
|
||||
## Review & Self Study
|
||||
## 리뷰 & 셀프 학습
|
||||
|
||||
Sometimes it's not obvious when to use a pie, donut, or waffle chart. Here are some articles to read on this topic:
|
||||
때때로 언제 파이, 도넛, 와플 차트를 사용해야 하는지 명확하지 않다. 다음은 이 주제에 대해 읽을 몇 가지 기사입니다:
|
||||
|
||||
https://www.beautiful.ai/blog/battle-of-the-charts-pie-chart-vs-donut-chart
|
||||
|
||||
https://medium.com/@hypsypops/pie-chart-vs-donut-chart-showdown-in-the-ring-5d24fd86a9ce
|
||||
|
||||
https://www.mit.edu/~mbarker/formula1/f1help/11-ch-c6.htm
|
||||
|
||||
https://medium.datadriveninvestor.com/data-visualization-done-the-right-way-with-tableau-waffle-chart-fdf2a19be402
|
||||
|
||||
Do some research to find more information on this sticky decision.
|
||||
## Assignment
|
||||
이 까다로운 결정에 대한 더 많은 정보를 찾기 위해 조사를 하세요.
|
||||
## 과제
|
||||
|
||||
[Try it in Excel](assignment.md)
|
||||
[엑셀로 도전해보세요](assignment.md)
|
||||
@ -0,0 +1,174 @@
|
||||
# 관계 시각화: 꿀의 모든 것 🍯
|
||||
|
||||
| ](../../../sketchnotes/12-Visualizing-Relationships.png)|
|
||||
|:---:|
|
||||
|관계 시각화 - _제작자 : [@nitya](https://twitter.com/nitya)_ |
|
||||
|
||||
계속해서 우리 연구의 본질에 초점을 맞춰 [미국 농무부](https://www.nass.usda.gov/About_NASS/index.php)에서 도출된 데이터 셋에 따라 다양한 꿀 유형 간의 관계를 보여주는 흥미로운 시각화를 발견해 보겠습니다.
|
||||
|
||||
약 600개 항목으로 구성된 이 데이터셋은 미국의 여러 주에서의 꿀 생산량을 보여줍니다. 예를 들어, 1998년부터 2012년까지 각 주에 대해 연간 한 행씩 군집의 수, 군집 당 수확량, 총 생산량, 재고, 파운드당 가격 및 특정 주에서 생산된 꿀의 가치를 볼 수 있습니다.
|
||||
|
||||
예를 들어 해당 주의 연간 생산량과 해당 주의 꿀 가격 간의 관계를 시각화하는 것은 흥미로울 것입니다. 또는 각 주의 군집 당 꿀 생산량 간의 관계를 시각화할 수 있습니다. 올해에는 2006년(http://npic.orst.edu/envir/ccd.html)에 처음 발견된 파괴적인 'CCD' 또는 '봉군붕괴증후군'을 다루는데, 이것은 연구하기에 가슴 아픈 데이터 셋입니다. 🐝
|
||||
|
||||
## [이전 강의 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/22)
|
||||
|
||||
이 강의에서는 변수 간의 관계를 시각화하는 좋은 라이브러리로, 전에 사용했던 Seaborn을 사용할 수 있습니다. 특히 흥미로운 점은 산점도와 선 플롯이 '[통계적 관계](https://seaborn.pydata.org/tutorial/relational.html?highlight=relationships)'를 빠르게 시각화할 수 있도록 해주는 Seaborn의 'relplot' 기능입니다. 'replot'은 데이터 과학자가 변수들이 서로 어떻게 관련되어 있는지 더 잘 이해할 수 있도록 합니다.
|
||||
|
||||
## 산점도
|
||||
|
||||
산점도를 사용하여 해마다 주별로 꿀 가격이 어떻게 변해왔는지 확인할 수 있습니다. Seaborn은 'replot'을 사용하여 상태 데이터를 편리하게 그룹화하고 범주형 데이터와 수치형 데이터 모두에 대한 데이터를 점으로 표시합니다.
|
||||
|
||||
먼저 데이터와 Seaborn을 가져오는 것으로 시작하겠습니다:
|
||||
|
||||
```python
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import seaborn as sns
|
||||
honey = pd.read_csv('../../data/honey.csv')
|
||||
honey.head()
|
||||
```
|
||||
꿀 데이터에는 연도 및 파운드 당 가격을 포함하여 몇가지 흥미로운 열들이 있습니다. 미국 주별로 분류된 이 데이터를 살펴보겠습니다:
|
||||
|
||||
| state | numcol | yieldpercol | totalprod | stocks | priceperlb | prodvalue | year |
|
||||
| ----- | ------ | ----------- | --------- | -------- | ---------- | --------- | ---- |
|
||||
| AL | 16000 | 71 | 1136000 | 159000 | 0.72 | 818000 | 1998 |
|
||||
| AZ | 55000 | 60 | 3300000 | 1485000 | 0.64 | 2112000 | 1998 |
|
||||
| AR | 53000 | 65 | 3445000 | 1688000 | 0.59 | 2033000 | 1998 |
|
||||
| CA | 450000 | 83 | 37350000 | 12326000 | 0.62 | 23157000 | 1998 |
|
||||
| CO | 27000 | 72 | 1944000 | 1594000 | 0.7 | 1361000 | 1998 |
|
||||
|
||||
|
||||
꿀 1파운드 당 가격과 미국 원산지 간의 관계를 보여주는 기본 산점도를 생성합니다. 'y'축을 모든 상태를 표시할 수 있을 만큼 높게 만듭니다:
|
||||
|
||||
```python
|
||||
sns.relplot(x="priceperlb", y="state", data=honey, height=15, aspect=.5);
|
||||
```
|
||||

|
||||
|
||||
이제 동일한 데이터를 꿀 색상 구성표로 표시하여 몇 년 동안 가격이 어떻게 변하는지 보여줍니다. 매년 변경 사항을 표시하기 위해 'hue' 매개 변수를 추가하여 이를 수행할 수 있습니다:
|
||||
|
||||
> ✅ [Seaborn에서 사용할 수 있는 색상 팔레트](https://seaborn.pydata.org/tutorial/color_palettes.html) 에 대해 자세히 알아보기 - 아름다운 무지개 색 구성표를 시도하세요!
|
||||
|
||||
```python
|
||||
sns.relplot(x="priceperlb", y="state", hue="year", palette="YlOrBr", data=honey, height=15, aspect=.5);
|
||||
```
|
||||

|
||||
|
||||
이 색상 구성표 변경을 통해, 여러분은 파운드당 꿀의 가격 측면에서 몇 년 동안 분명히 강력한 발전이 있음을 알 수 있습니다. 실제로 검증할 데이터의 표본 셋(예: 아리조나 주를 선택)을 보면 몇 가지 예외를 제외하고 매년 가격이 상승하는 패턴을 볼 수 있습니다:
|
||||
|
||||
| state | numcol | yieldpercol | totalprod | stocks | priceperlb | prodvalue | year |
|
||||
| ----- | ------ | ----------- | --------- | ------- | ---------- | --------- | ---- |
|
||||
| AZ | 55000 | 60 | 3300000 | 1485000 | 0.64 | 2112000 | 1998 |
|
||||
| AZ | 52000 | 62 | 3224000 | 1548000 | 0.62 | 1999000 | 1999 |
|
||||
| AZ | 40000 | 59 | 2360000 | 1322000 | 0.73 | 1723000 | 2000 |
|
||||
| AZ | 43000 | 59 | 2537000 | 1142000 | 0.72 | 1827000 | 2001 |
|
||||
| AZ | 38000 | 63 | 2394000 | 1197000 | 1.08 | 2586000 | 2002 |
|
||||
| AZ | 35000 | 72 | 2520000 | 983000 | 1.34 | 3377000 | 2003 |
|
||||
| AZ | 32000 | 55 | 1760000 | 774000 | 1.11 | 1954000 | 2004 |
|
||||
| AZ | 36000 | 50 | 1800000 | 720000 | 1.04 | 1872000 | 2005 |
|
||||
| AZ | 30000 | 65 | 1950000 | 839000 | 0.91 | 1775000 | 2006 |
|
||||
| AZ | 30000 | 64 | 1920000 | 902000 | 1.26 | 2419000 | 2007 |
|
||||
| AZ | 25000 | 64 | 1600000 | 336000 | 1.26 | 2016000 | 2008 |
|
||||
| AZ | 20000 | 52 | 1040000 | 562000 | 1.45 | 1508000 | 2009 |
|
||||
| AZ | 24000 | 77 | 1848000 | 665000 | 1.52 | 2809000 | 2010 |
|
||||
| AZ | 23000 | 53 | 1219000 | 427000 | 1.55 | 1889000 | 2011 |
|
||||
| AZ | 22000 | 46 | 1012000 | 253000 | 1.79 | 1811000 | 2012 |
|
||||
|
||||
|
||||
이 진행 상황을 시각화하는 또 다른 방법은 색상이 아닌 크기를 사용하는 것입니다. 색맹 사용자의 경우 이것이 더 나은 옵션일 수 있습니다. 점 둘레의 증가에 따른 가격 인상을 표시하도록 시각화를 편집합니다:
|
||||
|
||||
```python
|
||||
sns.relplot(x="priceperlb", y="state", size="year", data=honey, height=15, aspect=.5);
|
||||
```
|
||||
점들의 크기가 점점 커지는 것을 볼 수 있습니다.
|
||||
|
||||

|
||||
|
||||
이것은 단순한 수요와 공급의 경우인가요? 기후 변화 및 봉군 붕괴와 같은 요인으로 인해, 매년 구매할 수 있는 꿀이 줄어들어 가격이 상승하나요?
|
||||
|
||||
이 데이터 셋의 일부 변수 간의 상관 관계를 발견하기 위해 몇 가지 꺾은선 그래프를 살펴보겠습니다.
|
||||
|
||||
## 꺾은선 그래프
|
||||
|
||||
질문: 매년 파운드 당 꿀값이 상승하고 있습니까? 여러분은 단일 꺾은선 그래프를 만들어 가장 쉽게 확인할 수 있습니다:
|
||||
|
||||
```python
|
||||
sns.relplot(x="year", y="priceperlb", kind="line", data=honey);
|
||||
```
|
||||
답변: 네, 2003년 경의 일부 예외를 제외하고 그렇습니다:
|
||||
|
||||

|
||||
|
||||
✅ Seaborn은 한 선으로 데이터를 집계하기 때문에 "평균을 중심으로 95% 신뢰 구간과 평균을 표시하여 각 x 값에 대한 다중 측정"을 표시합니다. [출처](https://seaborn.pydata.org/tutorial/relational.html). 이 시간 소모적인 동작은 `ci=None`을 추가하여 비활성화할 수 있습니다.
|
||||
|
||||
질문: 2003년에도 꿀 공급이 급증하는 것을 볼 수 있습니까? 연간 총 생산량을 보면 어떨까요?
|
||||
|
||||
```python
|
||||
sns.relplot(x="year", y="totalprod", kind="line", data=honey);
|
||||
```
|
||||
|
||||

|
||||
|
||||
답변: 그렇지 않습니다. 총 생산량을 보면 그 해에 실제로 증가한 것으로 보이지만 일반적으로 이 기간 동안 생산되는 꿀의 양은 감소하고 있습니다.
|
||||
|
||||
질문: 그렇다면 2003년경 꿀 가격이 급등하게 된 원인은 무엇이었습니까?
|
||||
|
||||
이를 발견하기 위해 facet grid를 탐색할 수 있습니다.
|
||||
|
||||
## Facet grids
|
||||
|
||||
Facet grid는 데이터셋의 한 면을 차지합니다(우리의 경우 너무 많은 면을 생산하지 않도록 '연도'를 선택할 수 있습니다). 그런 다음 Seaborn은 보다 쉬운 시각적 비교를 위해 선택한 x 좌표와 y 좌표의 각 면에 대한 플롯을 만들 수 있습니다. 2003년은 이런 유형의 비교에서 두드러집니까?
|
||||
|
||||
[Seaborn의 문서](https://seaborn.pydata.org/generated/seaborn.FacetGrid.html?highlight=facetgrid#seaborn.FacetGrid)에서 권장하는 대로 'relplot'을 계속 사용하여 facet grid를 만듭니다.
|
||||
|
||||
```python
|
||||
sns.relplot(
|
||||
data=honey,
|
||||
x="yieldpercol", y="numcol",
|
||||
col="year",
|
||||
col_wrap=3,
|
||||
kind="line"
|
||||
```
|
||||
이 시각화에서는 군집 당 수확량과 연간 군집 수를 3개로 감싸진 열로 나란히 비교할 수 있습니다:
|
||||
|
||||

|
||||
|
||||
이 데이터셋의 경우, 매년 주별로 군집 수와 수확량과 관련하여 특별히 눈에 띄는 것은 없습니다. 이 두 변수 사이의 상관 관계를 찾는 다른 방법이 있습니까?
|
||||
|
||||
## 이중 꺾은선 그래프
|
||||
|
||||
Seaborn의 'despine'을 사용하여 상단 및 오른쪽 가시를 제거하고, `ax.twinx` [Matplotlib에서 파생된](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.twinx.html)을 사용하여 두 개의 꺾은 선 그래프를 서로 겹쳐서 여러 개의 꺾은 선 그래프를 시도합니다. Twinx를 사용하면 차트가 x축을 공유하고 두 개의 y축을 표시할 수 있습니다. 따라서 군집 당 수확량과 군집 수를 겹쳐서 표시합니다:
|
||||
|
||||
```python
|
||||
fig, ax = plt.subplots(figsize=(12,6))
|
||||
lineplot = sns.lineplot(x=honey['year'], y=honey['numcol'], data=honey,
|
||||
label = 'Number of bee colonies', legend=False)
|
||||
sns.despine()
|
||||
plt.ylabel('# colonies')
|
||||
plt.title('Honey Production Year over Year');
|
||||
|
||||
ax2 = ax.twinx()
|
||||
lineplot2 = sns.lineplot(x=honey['year'], y=honey['yieldpercol'], ax=ax2, color="r",
|
||||
label ='Yield per colony', legend=False)
|
||||
sns.despine(right=False)
|
||||
plt.ylabel('colony yield')
|
||||
ax.figure.legend();
|
||||
```
|
||||

|
||||
|
||||
2003년경에 눈에 띄는 것은 아무것도 없지만, 이것은 우리에게 이 강의을 조금 더 행복하게 마무리 할 수 있게 합니다. 전반적으로 군집의 수는 감소하는 반면, 군집당 수확량은 감소하고 있다고 해도 군집의 수는 안정되고 있습니다.
|
||||
|
||||
벌들아, 고고!
|
||||
|
||||
🐝❤️
|
||||
## 🚀 도전
|
||||
|
||||
이번 강의에서는 facet grid를 비롯한 산점도 및 꺾은선 그래프의 다른 용도에 대해 조금 더 알아봤습니다. 다른 데이터 셋(이 교육 전에 사용했을 수도 있습니다.)을 사용하여 facet grid를 만드는 데 도전해보세요. 이러한 기술을 사용하여 그리드를 만드는 데 걸리는 시간과 그리드를 몇 개 그려야 하는지 주의할 필요가 있습니다.
|
||||
## [이전 강의 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/23)
|
||||
|
||||
## 복습 & 자기 주도 학습
|
||||
|
||||
꺾은선 그래프는 단순하거나 매우 복잡할 수 있습니다. [Seaborn 문서](https://seaborn.pydata.org/generated/seaborn.lineplot.html)에서 빌드할 수 있는 다양한 방법을 읽어 보세요. 문서에 나열된 다른 방법을 사용하여 이 강의에서 만든 꺾은선그래프를 향상시키세요.
|
||||
## 과제
|
||||
|
||||
[벌집 속으로 뛰어들어라](assignment.md)
|
||||
@ -0,0 +1,11 @@
|
||||
# 벌집 탐구하기
|
||||
|
||||
## 지시사항
|
||||
|
||||
이 수업에서는 벌 군집 개체수가 전반적으로 감소한 기간 동안의 벌과 벌들의 꿀 생산량에 대한 데이터셋을 살펴보기 시작했습니다. 이 데이터셋을 자세히 살펴보고 주별, 연도별 벌 개체군의 건강에 대해서 알려줄 수 있는 노트북을 만드세요.
|
||||
|
||||
## 채점기준표
|
||||
|
||||
| 모범 | 충분 | 개선 필요 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| 노트북은 데이터셋의 양상, 주별 상태 및 연도별을 보여주는 최소 3개의 다른 차트로 주석이 달린 프로그램을 제공됩니다. | 노트북에는 이러한 요소 중 하나가 없습니다. | 노트북에는 이러한 요소 중 두 가지가 없습니다. |
|
||||
@ -0,0 +1,17 @@
|
||||
# Build your own custom vis
|
||||
# 나만의 사용자 정의 보기 구축
|
||||
|
||||
## Instructions
|
||||
## 지시사항
|
||||
|
||||
Using the code sample in this project to create a social network, mock up data of your own social interactions. You could map your usage of social media or make a diagram of your family members. Create an interesting web app that shows a unique visualization of a social network.
|
||||
이 프로젝트의 코드 샘플을 사용하여 소셜 네트워크를 만들고, 소셜 상호 작용의 데이터를 모조해 보십시오. 소셜 미디어 사용을 지도화하거나 가족 구성원의 도표를 작성할 수 있습니다. 소셜 네트워크의 고유한 시각화를 보여주는 흥미로운 웹 앱을 만듭니다.
|
||||
## Rubric
|
||||
## 루브릭
|
||||
|
||||
Exemplary | Adequate | Needs Improvement
|
||||
--- | --- | -- |
|
||||
A GitHub repo is presented with code that runs properly (try deploying it as a static web app) and has an annotated README explaining the project | The repo does not run properly or is not documented well | The repo does not run properly and is not documented well
|
||||
모범 | 충분 | 개선 필요
|
||||
--- | --- | -- |
|
||||
GitHub repo는 적절하게 실행되는 코드와 함께 제시되며(정적 웹 앱으로 배포해 보십시오) 프로젝트를 설명하는 주석이 달린 README를 가지고 있습니다. | repo는 제대로 실행되지 않거나 잘 문서화되지 않았습니다. | repo는 제대로 실행되지 않으며 잘 문서화되지 않습니다.
|
||||
@ -0,0 +1,232 @@
|
||||
# Making Meaningful Visualizations
|
||||
# 의미 있는 시각화 만들기
|
||||
|
||||
| ](../../sketchnotes/13-MeaningfulViz.png)|
|
||||
|:---:|
|
||||
| Meaningful Visualizations - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
|
||||
| 의미 있는 시각화 -_제작자: [@nitya](https://twitter.com/nitya)_ |
|
||||
|
||||
> "If you torture the data long enough, it will confess to anything" -- [Ronald Coase](https://en.wikiquote.org/wiki/Ronald_Coase)
|
||||
> "데이터를 충분히 오래 고문하면, 그것은 무엇이든 자백할 것입니다." [Ronald Coase] (https://en.wikiquote.org/wiki/Ronald_Coase)
|
||||
|
||||
One of the basic skills of a data scientist is the ability to create a meaningful data visualization that helps answer questions you might have. Prior to visualizing your data, you need to ensure that it has been cleaned and prepared, as you did in prior lessons. After that, you can start deciding how best to present the data.
|
||||
데이터 과학자의 기본 기술 중 하나는 사용자가 가질 수 있는 질문에 대답하는 데 도움이 되는 의미 있는 데이터 시각화를 만드는 능력입니다. 데이터를 시각화하기 전에 이전 학습에서와 같이 데이터를 정리하고 준비해야 합니다. 그런 다음 데이터를 가장 잘 표시할 방법을 결정할 수 있습니다.
|
||||
|
||||
In this lesson, you will review:
|
||||
이 과정에서는 다음을 복습합니다:
|
||||
|
||||
1. How to choose the right chart type
|
||||
2. How to avoid deceptive charting
|
||||
3. How to work with color
|
||||
4. How to style your charts for readability
|
||||
5. How to build animated or 3D charting solutions
|
||||
6. How to build a creative visualization
|
||||
1. 올바른 차트 유형을 선택하는 방법
|
||||
2. 기만적인 차트 작성을 피하는 방법
|
||||
3. 컬러로 작업하는 방법
|
||||
4. 가독성을 위해 차트를 스타일링하는 방법
|
||||
5. 애니메이션 또는 3D 차트 작성 솔루션을 구축하는 방법
|
||||
6. 창의적 시각화를 만드는 방법
|
||||
|
||||
## [Pre-Lecture Quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/24)
|
||||
## [사전 강의 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/24)
|
||||
|
||||
## Choose the right chart type
|
||||
## 올바른 차트 유형 선택
|
||||
|
||||
In previous lessons, you experimented with building all kinds of interesting data visualizations using Matplotlib and Seaborn for charting. In general, you can select the [right kind of chart](https://chartio.com/learn/charts/how-to-select-a-data-vizualization/) for the question you are asking using this table:
|
||||
이전 과정에서는 차트 작성을 위해 Matplotlib와 Seaborn을 사용하여 모든 종류의 흥미로운 데이터 시각화를 구축하는 실험을 했습니다. 일반적으로 다음 표를 사용하여 [적절한 유형의 차트](https://chartio.com/learn/charts/how-to-select-a-data-vizualization/)를 선택할 수 있습니다:
|
||||
|
||||
| You need to: | You should use: |
|
||||
| -------------------------- | ------------------------------- |
|
||||
| Show data trends over time | Line |
|
||||
| Compare categories | Bar, Pie |
|
||||
| Compare totals | Pie, Stacked Bar |
|
||||
| Show relationships | Scatter, Line, Facet, Dual Line |
|
||||
| Show distributions | Scatter, Histogram, Box |
|
||||
| Show proportions | Pie, Donut, Waffle |
|
||||
|
||||
> ✅ Depending on the makeup of your data, you might need to convert it from text to numeric to get a given chart to support it.
|
||||
> ✅ 데이터의 구성에 따라 텍스트에서 숫자로 변환해야 데이터를 지원할 수 있는 차트를 얻을 수 있습니다.
|
||||
|
||||
## Avoid deception
|
||||
## 속임수를 피하라
|
||||
|
||||
Even if a data scientist is careful to choose the right chart for the right data, there are plenty of ways that data can be displayed in a way to prove a point, often at the cost of undermining the data itself. There are many examples of deceptive charts and infographics!
|
||||
데이터 과학자가 올바른 데이터에 대한 올바른 차트를 선택하기 위해 주의를 기울인다고 해도, 데이터 자체를 손상시키는 대가를 치르고라도, 요점을 입증하는 방법으로 데이터를 표시할 수 있는 방법은 얼마든지 있습니다. 기만적인 차트와 인포그래픽의 예는 많습니다!
|
||||
|
||||
[](https://www.youtube.com/watch?v=oX74Nge8Wkw "How charts lie")
|
||||
[](https://www.youtube.com/watch?v=oX74Nge8Wkw "차트 눕기"
|
||||
|
||||
> 🎥 Click the image above for a conference talk about deceptive charts
|
||||
> 🎥 위 이미지를 클릭하면 기만적인 차트에 대한 컨퍼런스 토크가 나옵니다.
|
||||
|
||||
This chart reverses the X axis to show the opposite of the truth, based on date:
|
||||
이 차트는 날짜를 기준으로 X축을 반전시켜 진실의 반대 방향을 보여줍니다:
|
||||
|
||||

|
||||

|
||||
|
||||
[This chart](https://media.firstcoastnews.com/assets/WTLV/images/170ae16f-4643-438f-b689-50d66ca6a8d8/170ae16f-4643-438f-b689-50d66ca6a8d8_1140x641.jpg) is even more deceptive, as the eye is drawn to the right to conclude that, over time, COVID cases have declined in the various counties. In fact, if you look closely at the dates, you find that they have been rearranged to give that deceptive downward trend.
|
||||
[이 차트](https://media.firstcoastnews.com/assets/WTLV/images/170ae16f-4643-438f-b689-50d66ca6a8d8/170ae16f-4643-438f-b689-50d66ca6a8d8_1140x641.jpg)는 시간이 지남에 따라 다양한 카운티에서 COVID 사례가 감소했다고 결론을 내릴 수 있는 권리에 주목하기 때문에 훨씬 더 기만적이다. 사실, 만약 여러분이 날짜를 자세히 본다면, 여러분은 그것들이 기만적인 하향 추세를 주기 위해 재배열되었다는 것을 발견할 것입니다.
|
||||
|
||||

|
||||

|
||||
|
||||
This notorious example uses color AND a flipped Y axis to deceive: instead of concluding that gun deaths spiked after the passage of gun-friendly legislation, in fact the eye is fooled to think that the opposite is true:
|
||||
이 악명 높은 예는 색깔과 뒤집힌 Y축을 사용하여 속인다: 총기 친화적인 법안이 통과된 후 총기 사망률이 급증했다고 결론짓는 대신, 사실 그 반대라고 생각하는 것은 눈을 속인다:
|
||||
|
||||

|
||||

|
||||
|
||||
This strange chart shows how proportion can be manipulated, to hilarious effect:
|
||||
이 이상한 차트는 비율을 조작하여 우스꽝스러운 효과를 얻을 수 있습니다:
|
||||
|
||||

|
||||

|
||||
|
||||
Comparing the incomparable is yet another shady trick. There is a [wonderful web site](https://tylervigen.com/spurious-correlations) all about 'spurious correlations' displaying 'facts' correlating things like the divorce rate in Maine and the consumption of margarine. A Reddit group also collects the [ugly uses](https://www.reddit.com/r/dataisugly/top/?t=all) of data.
|
||||
비교할 수 없는 것을 비교하는 것은 또 다른 음흉한 속임수이다. 메인주의 이혼율과 마가린 소비와 같은 '비교적 상관관계'를 보여주는 [정보 웹사이트](https://tylervigen.com/spurious-correlations)가 있다. Reddit 그룹은 또한 데이터의 [사용량](https://www.reddit.com/r/dataisugly/top/?t=all)을 수집합니다.
|
||||
|
||||
It's important to understand how easily the eye can be fooled by deceptive charts. Even if the data scientist's intention is good, the choice of a bad type of chart, such as a pie chart showing too many categories, can be deceptive.
|
||||
눈이 얼마나 쉽게 기만적인 도표에 속아 넘어갈 수 있는지 이해하는 것이 중요하다. 데이터 과학자의 의도가 좋더라도 너무 많은 범주를 보여주는 파이 차트와 같은 잘못된 유형의 차트를 선택하는 것은 기만적일 수 있습니다.
|
||||
|
||||
## Color
|
||||
## 색상
|
||||
|
||||
You saw in the 'Florida gun violence' chart above how color can provide an additional layer of meaning to charts, especially ones not designed using libraries such as Matplotlib and Seaborn which come with various vetted color libraries and palettes. If you are making a chart by hand, do a little study of [color theory](https://colormatters.com/color-and-design/basic-color-theory)
|
||||
당신은 '플로리다 총기 폭력' 차트에서 색상이 차트에 어떻게 추가적인 의미 층을 제공할 수 있는지 보았으며, 특히 다양한 컬러 라이브러리와 팔레트가 제공되는 Matplotlib과 Seaborn과 같은 도서관을 사용하여 설계되지 않은 것을 보았습니다. 만약 여러분이 손으로 차트를 만들고 있다면, [색깔 이론]을 조금 연구해 보세요. https://colormatters.com/color-and-design/basic-color-theory)
|
||||
|
||||
> ✅ Be aware, when designing charts, that accessibility is an important aspect of visualization. Some of your users might be color blind - does your chart display well for users with visual impairments?
|
||||
> ✅ 차트를 설계할 때 접근성은 시각화의 중요한 측면임을 유의해야 한다. 일부 사용자는 색맹일 수 있습니다. 당신의 차트는 시각 장애가 있는 사용자들에게 잘 표시됩니까?
|
||||
|
||||
Be careful when choosing colors for your chart, as color can convey meaning you might not intend. The 'pink ladies' in the 'height' chart above convey a distinctly 'feminine' ascribed meaning that adds to the bizarreness of the chart itself.
|
||||
색상은 의도하지 않은 의미를 전달할 수 있으므로 차트에 사용할 색상을 선택할 때 주의하십시오. 위의 'height' 차트에 있는 'pink ladies'는 차트 자체의 기괴함을 더하는 뚜렷하게 '여성적인' 의미를 전달한다.
|
||||
|
||||
While [color meaning](https://colormatters.com/color-symbolism/the-meanings-of-colors) might be different in different parts of the world, and tend to change in meaning according to their shade. Generally speaking, color meanings include:
|
||||
그러나 [color languation](https://colormatters.com/color-symbolism/the-meanings-of-colors)은 세계 각지에서 다를 수 있으며 색조에 따라 의미가 변하는 경향이 있다. 일반적으로 색상의 의미는 다음과 같다.
|
||||
|
||||
| Color | Meaning |
|
||||
| ------ | ------------------- |
|
||||
| red | power |
|
||||
| blue | trust, loyalty |
|
||||
| yellow | happiness, caution |
|
||||
| green | ecology, luck, envy |
|
||||
| purple | happiness |
|
||||
| orange | vibrance |
|
||||
|
||||
If you are tasked with building a chart with custom colors, ensure that your charts are both accessible and the color you choose coincides with the meaning you are trying to convey.
|
||||
사용자 지정 색을 사용하여 차트를 작성해야 하는 경우 차트에 액세스할 수 있고 선택한 색상이 전달하려는 의미와 일치하는지 확인하십시오.
|
||||
|
||||
## Styling your charts for readability
|
||||
## 가독성을 위한 차트 스타일링
|
||||
|
||||
Charts are not meaningful if they are not readable! Take a moment to consider styling the width and height of your chart to scale well with your data. If one variable (such as all 50 states) need to be displayed, show them vertically on the Y axis if possible so as to avoid a horizontally-scrolling chart.
|
||||
차트를 읽을 수 없으면 의미가 없습니다! 데이터에 맞게 잘 확장되도록 차트의 너비와 높이를 스타일링하는 것을 고려해 보십시오. 하나의 변수(예: 50개 상태 모두)를 표시해야 하는 경우 가로 스크롤 차트를 피하기 위해 가능하면 Y축에 세로로 표시합니다.
|
||||
|
||||
Label your axes, provide a legend if necessary, and offer tooltips for better comprehension of data.
|
||||
축에 레이블을 지정하고 필요한 경우 범례를 제공하며 데이터를 더 잘 이해할 수 있도록 툴팁을 제공합니다.
|
||||
|
||||
If your data is textual and verbose on the X axis, you can angle the text for better readability. [Matplotlib](https://matplotlib.org/stable/tutorials/toolkits/mplot3d.html) offers 3d plotting, if you data supports it. Sophisticated data visualizations can be produced using `mpl_toolkits.mplot3d`.
|
||||
데이터가 텍스트이고 X축에 상세할 경우 텍스트를 더 잘 읽을 수 있도록 각도를 지정할 수 있습니다. [Matplotlib](https://matplotlib.org/stable/tutorials/toolkits/mplot3d.html)은 데이터가 지원하는 경우 3D 플로팅을 제공합니다. 'mpl_toolkits.mplot3d'를 사용하여 정교한 데이터 시각화를 생성할 수 있습니다.
|
||||
|
||||

|
||||
|
||||
## Animation and 3D chart display
|
||||
## 애니메이션 및 3D 차트 표시
|
||||
|
||||
Some of the best data visualizations today are animated. Shirley Wu has amazing ones done with D3, such as '[film flowers](http://bl.ocks.org/sxywu/raw/d612c6c653fb8b4d7ff3d422be164a5d/)', where each flower is a visualization of a movie. Another example for the Guardian is 'bussed out', an interactive experience combining visualizations with Greensock and D3 plus a scrollytelling article format to show how NYC handles its homeless problem by bussing people out of the city.
|
||||
오늘날 최고의 데이터 시각화 중 일부는 애니메이션입니다. Shirley Wu는 D3로 놀라운 작업을 했습니다.
|
||||
예를 들어 '[필름 플라워](http://bl.ocks.org/sxywu/raw/d612c6c653fb8b4d7ff3d422be164a5d/)',에서는 각각의 꽃이 영화의 시각화이다. 가디언의 또 다른 예는 '버스드 아웃'으로, Greensock 및 D3와 시각화를 결합한 대화형 체험과 NYC가 사람들을 도시 밖으로 내쫓아 노숙자 문제를 어떻게 처리하는지 보여주는 기사 형식을 포함한다.
|
||||
|
||||

|
||||

|
||||
|
||||
> "Bussed Out: How America Moves its Homeless" from [the Guardian](https://www.theguardian.com/us-news/ng-interactive/2017/dec/20/bussed-out-america-moves-homeless-people-country-study). Visualizations by Nadieh Bremer & Shirley Wu
|
||||
> [가디언](https://www.theguardian.com/us-news/ng-interactive/2017/dec/20/bussed-out-america-moves-homeless-people-country-study))의 "버스드 아웃: 미국의 노숙자 이동 방법" Nadieh Bremer & Shirley Wu의 시각화
|
||||
|
||||
While this lesson is insufficient to go into depth to teach these powerful visualization libraries, try your hand at D3 in a Vue.js app using a library to display a visualization of the book "Dangerous Liaisons" as an animated social network.
|
||||
이 교훈은 이러한 강력한 시각화 라이브러리를 가르치기에 충분하지 않지만, 애니메이션 소셜 네트워크로서 "위험한 관계"라는 책의 시각화를 표시하기 위해 라이브러리를 사용하여 Vue.js 앱의 D3에서 여러분의 손을 사용해 보십시오.
|
||||
|
||||
> "Les Liaisons Dangereuses" is an epistolary novel, or a novel presented as a series of letters. Written in 1782 by Choderlos de Laclos, it tells the story of the vicious, morally-bankrupt social maneuvers of two dueling protagonists of the French aristocracy in the late 18th century, the Vicomte de Valmont and the Marquise de Merteuil. Both meet their demise in the end but not without inflicting a great deal of social damage. The novel unfolds as a series of letters written to various people in their circles, plotting for revenge or simply to make trouble. Create a visualization of these letters to discover the major kingpins of the narrative, visually.
|
||||
> "Les Liaisons Dangereuses"는 편지 소설 또는 일련의 편지로 표현된 소설이다. 1782년 Choderlos de Laclos에 의해 쓰여진 이 책은 18세기 후반 프랑스 귀족의 결투적인 두 주인공인 Vicomte de Valmont와 Marquise de Merteuil의 잔인하고 도덕적으로 타락한 사회적 책략에 대한 이야기를 들려준다. 둘 다 결국 그들의 죽음을 맞이하지만 큰 사회적 피해를 입히지 않고는 아니다. 이 소설은 복수의 음모를 꾸미거나 단순히 문제를 일으키기 위해 서클에 있는 다양한 사람들에게 쓴 일련의 편지들로 전개된다. 이 글자들을 시각화해서 이야기의 주요 킹핀을 시각적으로 발견하세요.
|
||||
|
||||
You will complete a web app that will display an animated view of this social network. It uses a library that was built to create a [visual of a network](https://github.com/emiliorizzo/vue-d3-network) using Vue.js and D3. When the app is running, you can pull the nodes around on the screen to shuffle the data around.
|
||||
이 소셜 네트워크의 애니메이션 보기를 표시하는 웹 앱을 완료합니다. Vue.js 및 D3를 사용하여 [네트워크의 시각](https://github.com/emiliorizzo/vue-d3-network))을 만들기 위해 구축된 라이브러리를 사용합니다. 앱이 실행 중일 때 화면에서 노드를 당겨 데이터를 이리저리 섞을 수 있습니다.
|
||||
|
||||

|
||||

|
||||
|
||||
## Project: Build a chart to show a network using D3.js
|
||||
## 프로젝트: D3.js를 사용하여 네트워크를 표시할 차트 작성
|
||||
|
||||
> This lesson folder includes a `solution` folder where you can find the completed project, for your reference.
|
||||
> 이 과정 폴더에는 완료된 프로젝트를 참조할 수 있는 '솔루션' 폴더가 포함되어 있습니다.
|
||||
|
||||
1. Follow the instructions in the README.md file in the starter folder's root. Make sure you have NPM and Node.js running on your machine before installing your project's dependencies.
|
||||
1. 스타터 폴더의 루트에 있는 README.md 파일의 지침을 따릅니다. 프로젝트의 종속성을 설치하기 전에 시스템에서 NPM 및 Node.js가 실행 중인지 확인하십시오.
|
||||
|
||||
2. Open the `starter/src` folder. You'll discover an `assets` folder where you can find a .json file with all the letters from the novel, numbered, with a 'to' and 'from' annotation.
|
||||
2. 'starter/src' 폴더를 엽니다. 당신은 소설의 모든 글자와 번호가 매겨진 .json 파일을 찾을 수 있는 assets 폴더를 발견할 것이다.
|
||||
|
||||
3. Complete the code in `components/Nodes.vue` to enable the visualization. Look for the method called `createLinks()` and add the following nested loop.
|
||||
3. `components/Nodes.vue`를 사용하여 시각화를 활성화합니다. createLinks()라는 메서드를 찾아 다음과 같은 중첩 루프를 추가합니다.
|
||||
|
||||
Loop through the .json object to capture the 'to' and 'from' data for the letters and build up the `links` object so that the visualization library can consume it:
|
||||
.json 객체를 루프하여 문자에 대한 'to' 및 'from' 데이터를 캡처하고 시각화 라이브러리가 사용할 수 있도록 'links' 객체를 구축합니다.
|
||||
|
||||
```javascript
|
||||
//loop through letters
|
||||
let f = 0;
|
||||
let t = 0;
|
||||
for (var i = 0; i < letters.length; i++) {
|
||||
for (var j = 0; j < characters.length; j++) {
|
||||
|
||||
if (characters[j] == letters[i].from) {
|
||||
f = j;
|
||||
}
|
||||
if (characters[j] == letters[i].to) {
|
||||
t = j;
|
||||
}
|
||||
}
|
||||
this.links.push({ sid: f, tid: t });
|
||||
}
|
||||
```
|
||||
|
||||
Run your app from the terminal (npm run serve) and enjoy the visualization!
|
||||
터미널(npm run serve)에서 앱을 실행하고 시각화를 즐기십시오!
|
||||
|
||||
## 🚀 Challenge
|
||||
## 🚀 도전
|
||||
|
||||
Take a tour of the internet to discover deceptive visualizations. How does the author fool the user, and is it intentional? Try correcting the visualizations to show how they should look.
|
||||
인터넷을 둘러보고 기만적인 시각화를 찾아보세요. 저자는 어떻게 사용자를 속이고, 의도적인가? 시각화를 수정하여 어떻게 보여야 하는지 표시해 보십시오.
|
||||
|
||||
## [Post-lecture quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/25)
|
||||
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/25)
|
||||
|
||||
## Review & Self Study
|
||||
## 리뷰 & 셀프 학습
|
||||
|
||||
Here are some articles to read about deceptive data visualization:
|
||||
다음은 기만적인 데이터 시각화에 대한 몇 가지 기사입니다:
|
||||
|
||||
https://gizmodo.com/how-to-lie-with-data-visualization-1563576606
|
||||
|
||||
http://ixd.prattsi.org/2017/12/visual-lies-usability-in-deceptive-data-visualizations/
|
||||
|
||||
Take a look at these interest visualizations for historical assets and artifacts:
|
||||
과거 자산 및 인공물에 대한 다음과 같은 관심 시각화를 살펴 보십시오.
|
||||
|
||||
https://handbook.pubpub.org/
|
||||
|
||||
Look through this article on how animation can enhance your visualizations:
|
||||
이 기사를 통해 애니메이션이 시각화를 향상시키는 방법에 대해 알아보십시오:
|
||||
|
||||
https://medium.com/@EvanSinar/use-animation-to-supercharge-data-visualization-cd905a882ad4
|
||||
|
||||
## Assignment
|
||||
## 과제
|
||||
|
||||
[Build your own custom visualization](assignment.md)
|
||||
[맞춤형 시각화 구축](assignment.md)
|
||||
@ -0,0 +1,27 @@
|
||||
# Visualisaties
|
||||
|
||||

|
||||
> Beeld door <a href="https://unsplash.com/@jenna2980?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Jenna Lee</a> op <a href="https://unsplash.com/s/photos/bees-in-a-meadow?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
|
||||
|
||||
Het visualiseren van data is een van de belangrijkste taken van een data scientist. Afbeeldingen zeggen meer dan 1000 woorden, en een visualisatie kan helpen allerlei interessante delen van uw gegevens te identificeren, zoals pieken, uitbijters, groeperingen, tendensen en meer, die kunnen helpen het verhaal te begrijpen dat de data probeert te vertellen.
|
||||
|
||||
In deze vijf lessen verkennen we gegevens uit de natuur en maken we interessante en mooie visualisaties met behulp van verschillende technieken.
|
||||
### Onderwerpen
|
||||
|
||||
1. [Hoeveelheden visualiseren](09-visualization-quantities/README.md)
|
||||
1. [Distributie visualiseren](10-visualization-distributions/README.md)
|
||||
1. [Proporties visualiseren](11-visualization-proportions/README.md)
|
||||
1. [Relaties visualiseren](12-visualization-relationships/README.md)
|
||||
1. [Betekenisvolle visualisaties maken](13-meaningful-visualizations/README.md)
|
||||
|
||||
### Credits
|
||||
|
||||
🌸 Deze lessen in visualisatie zijn geschreven door [Jen Looper](https://twitter.com/jenlooper)
|
||||
|
||||
🍯 De US Honey Production data is gebruikt uit Jessica Li's project op [Kaggle](https://www.kaggle.com/jessicali9530/honey-production). De [data](https://usda.library.cornell.edu/concern/publications/rn301137d) is afgeleid van de [United States Department of Agriculture](https://www.nass.usda.gov/About_NASS/index.php).
|
||||
|
||||
🍄 De gegevens voor paddenstoelen zijn ook afkomstig van [Kaggle](https://www.kaggle.com/hatterasdunton/mushroom-classification-updated-dataset), herzien door Hatteras Dunton. Deze dataset bevat beschrijvingen van hypothetische monsters die overeenkomen met 23 soorten kieuwen van paddenstoelen in de Agaricus- en Lepiota-familie. Paddestoel getekend uit The Audubon Society Field Guide to North American Mushrooms (1981). Deze dataset werd in 1987 geschonken aan UCI ML 27.
|
||||
|
||||
🦆 Gegevens voor Minnesota Birds komen eveneens van [Kaggle](https://www.kaggle.com/hannahcollins/minnesota-birds) gescraped van [Wikipedia](https://en.wikipedia.org/wiki/List_of_birds_of_Minnesota) door Hannah Collins.
|
||||
|
||||
Al deze datasets zijn gelicentieerd als [CC0: Creative Commons](https://creativecommons.org/publicdomain/zero/1.0/).
|
||||
@ -0,0 +1,28 @@
|
||||
# 可视化
|
||||
|
||||

|
||||
> 拍摄者 <a href="https://unsplash.com/@jenna2980?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Jenna Lee</a> 上传于 <a href="https://unsplash.com/s/photos/bees-in-a-meadow?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
|
||||
|
||||
数据可视化是数据科学家最重要的任务之一。在有的时候,一图可以胜千言。除此之外,可视化还可以帮助你指出你的数据中包含的各种有趣的特征,例如峰值、异常值、分组、趋势等等,这可以帮助你更好的了解你的数据。
|
||||
|
||||
在这五节课当中,你将接触到来源于大自然的数据,并使用各种不同的技术来完成有趣且漂亮的可视化。
|
||||
|
||||
### 主题
|
||||
|
||||
1. [可视化数据](../09-visualization-quantities/README.md)
|
||||
1. [可视化数据分布](../10-visualization-distributions/README.md)
|
||||
1. [可视化数据占比](../11-visualization-proportions/README.md)
|
||||
1. [可视化数据间的关系](../12-visualization-relationships/README.md)
|
||||
1. [做有意义的可视化](../13-meaningful-visualizations/README.md)
|
||||
|
||||
### 致谢
|
||||
|
||||
这些可视化课程是由 [Jen Looper](https://twitter.com/jenlooper) 用 🌸 编写的
|
||||
|
||||
🍯 US Honey Production 所使用的数据来自 Jessica Li 在 [Kaggle](https://www.kaggle.com/jessicali9530/honey-production) 上的项目。事实上,该 [数据集](https://usda.library.cornell.edu/concern/publications/rn301137d) 来自 [美国农业部](https://www.nass.usda.gov/About_NASS/index.php)。
|
||||
|
||||
🍄 mushrooms 所使用的数据集也是来自于 [Kaggle](https://www.kaggle.com/hatterasdunton/mushroom-classification-updated-dataset),该数据集经历过 Hatteras Dunton 的一些小修订. 该数据集包括对与姬松茸和环柄菇属中 23 种金针菇相对应的假设样本的描述。蘑菇取自于奥杜邦协会北美蘑菇野外指南 (1981)。该数据集于 1987 年捐赠给了 UCI ML 27 (机器学习数据集仓库)
|
||||
|
||||
🦆 Minnesota Birds 的数据也来自于 [Kaggle](https://www.kaggle.com/hannahcollins/minnesota-birds),是由 Hannah Collins 从 [Wikipedia](https://en.wikipedia.org/wiki/List_of_birds_of_Minnesota) 中获取的。
|
||||
|
||||
以上这些数据集都遵循 [CC0: Creative Commons](https://creativecommons.org/publicdomain/zero/1.0/) 条款。
|
||||
@ -0,0 +1,23 @@
|
||||
# 데이터셋 평가
|
||||
|
||||
한 고객이 뉴욕에서 택시 고객의 계절별 소비 습관을 조사하는 데 도움을 청하기 위해 귀하의 팀에 연락했습니다.
|
||||
|
||||
그들은 알고 싶어한다: **뉴욕의 노란 택시 승객들은 겨울이나 여름에 기사들에게 팁을 더 많이 주는가?**
|
||||
|
||||
귀하의 팀은 데이터과학 라이프사이클 [캡처링](Readme.md#Capturing) 단계에 있으며, 귀하는 데이터 셋을 처리하는 임무를 맡고 있습니다. 노트북과 가공할 [데이터](../../data/taxi.csv)를 제공받으셨습니다.
|
||||
|
||||
이 디렉토리에서는 파이썬을 사용하여 [NYC택시 & 리무진 위원회](https://docs.microsoft.com/en-us/azure/open-datasets/dataset-taxi-yellow?tabs=azureml-opendatasets)로부터 노란색 택시 트립 데이터를 로드하는 [노트북](notebook.ipynb)이 있습니다.
|
||||
엑셀과 같은 텍스트 편집기나 스프레드시트 소프트웨어에서 택시 데이터 파일을 열 수도 있습니다.
|
||||
|
||||
## 지시사항
|
||||
|
||||
- 이 데이터 세트의 데이터가 질문에 대답하는 데 도움이 될 수 있는지 여부를 평가합니다.
|
||||
- [NYC Open Data 카탈로그](https://data.cityofnewyork.us/browse?sortBy=most_accessed&utf8=%E2%9C%93)를 살펴보십시오. 고객의 질문에 대답하는 데 잠재적으로 도움이 될 수 있는 추가 데이터 세트를 식별합니다.
|
||||
- 고객에게 문제에 대한 보다 명확한 설명과 이해를 위해 물어볼 질문 3개를 작성합니다.
|
||||
|
||||
데이터에 대한 자세한 내용은 [정보 사전](https://www1.nyc.gov/assets/tlc/downloads/pdf/data_dictionary_trip_records_yellow.pdf) 및 [사용자 가이드](https://www1.nyc.gov/assets/tlc/downloads/pdf/trip_record_user_guide.pdf)을 참조하십시오.
|
||||
|
||||
## 표제
|
||||
|
||||
모범 | 충분 | 개선 필요
|
||||
--- | --- | -- |
|
||||
@ -1,23 +0,0 @@
|
||||
# Assessing a Dataset
|
||||
|
||||
A client has approached your team for help in investigating a taxi customer's seasonal spending habits in New York City.
|
||||
|
||||
They want to know: **Do yellow taxi passengers in New York City tip drivers more in the winter or summer?**
|
||||
|
||||
Your team is in the [Capturing](Readme.md#Capturing) stage of the Data Science Lifecycle and you are in charge of handling the the dataset. You have been provided a notebook and [data](../../data/taxi.csv) to explore.
|
||||
|
||||
In this directory is a [notebook](notebook.ipynb) that uses Python to load yellow taxi trip data from the [NYC Taxi & Limousine Commission](https://docs.microsoft.com/en-us/azure/open-datasets/dataset-taxi-yellow?tabs=azureml-opendatasets).
|
||||
You can also open the taxi data file in text editor or spreadsheet software like Excel.
|
||||
|
||||
## Instructions
|
||||
|
||||
- Assess whether or not the data in this dataset can help answer the question.
|
||||
- Explore the [NYC Open Data catalog](https://data.cityofnewyork.us/browse?sortBy=most_accessed&utf8=%E2%9C%93). Identify an additional dataset that could potentially be helpful in answering the client's question.
|
||||
- Write 3 questions that you would ask the client for more clarification and better understanding of the problem.
|
||||
|
||||
Refer to the [dataset's dictionary](https://www1.nyc.gov/assets/tlc/downloads/pdf/data_dictionary_trip_records_yellow.pdf) and [user guide](https://www1.nyc.gov/assets/tlc/downloads/pdf/trip_record_user_guide.pdf) for more information about the data.
|
||||
|
||||
## Rubric
|
||||
|
||||
Exemplary | Adequate | Needs Improvement
|
||||
--- | --- | -- |
|
||||
@ -0,0 +1,211 @@
|
||||
<<<<<<< HEAD
|
||||
# 데이터 과학의 생애주기 소개
|
||||
|
||||
| ](../../sketchnotes/14-DataScience-Lifecycle.png)|
|
||||
|:---:|
|
||||
| 데이터 과학의 생애주기 소개 - [@nitya](https://twitter.com/nitya)의 이미지 |
|
||||
|
||||
## [강의 시작 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/26)
|
||||
|
||||
이 시점에서 여러분은 아마 데이터 과학이 하나의 프로세스라는 것을 깨달았을 것입니다. 이 프로세스는 다음과 같이 5단계로 나눌 수 있습니다:
|
||||
|
||||
- 데이터 포획
|
||||
- 데이터 처리
|
||||
- 데이터 분석
|
||||
- 소통
|
||||
- 유지보수
|
||||
|
||||
|
||||
이번 강의에서는 생애 주기의 세 부분 : 데이터 포획, 데이터 처리 그리고 유지에 집중합니다.
|
||||
|
||||

|
||||
> [Berkeley School of Information](https://ischoolonline.berkeley.edu/data-science/what-is-data-science/) 의 이미지
|
||||
|
||||
## 데이터 포획
|
||||
|
||||
생애 주기의 첫 번째 단계는 다음 단계의 의존도가 높기 때문에 아주 중요합니다. 이것은 사실상 두 단계가 합해진 것이라고 볼 수 있습니다 : 데이터 수집과 해결해야 하는 문제들 및 목적 정의.
|
||||
프로젝트의 목표를 정의하려면 문제나 질문에 대해서 더 깊은 맥락을 필요로 할 것입니다. 첫째, 우리는 문제 해결이 필요한 사람들을 찾아내고 영입해야 한다. 그들은 사업의 이해관계자이거나 프로젝트의 후원자일 수도 있으며, 그들은 누가 이 프로젝트를 통해 이익을 얻을 수 있는지, 무엇을 왜 필요로 하는지를 식별하는데에 도움을 줄 수 있습니다. 잘 정의된 목표는 납득할만한 결과를 정의하기 위해 계량(측정)과 수량화가 가능해야만 한다.
|
||||
|
||||
데이터 과학자가 할 수도 있는 질문들 :
|
||||
- 이 문제에 접근한 적이 있습니까? 무엇이 발견되었습니까?
|
||||
- 관련되어 있는 모든 사람들이 목적과 목표를 이해하고 있습니까?
|
||||
- 모호성은 어디에서 확인할 수 있으며 어떻게 줄일 수 있겠습니까?
|
||||
- 제약이 되는 것들은 무엇입니까?
|
||||
- 최종 결과는 잠재적으로 어떻게 될 것 같습니까?
|
||||
- 사용 가능한 자원들 (시간, 인력, 컴퓨터 이용) 이 얼마나 됩니까?
|
||||
|
||||
다음은 이 정의된 목표들을 달성하는 데 필요한 데이터를 식별하고, 수집하고, 마지막으로 탐색하는 것입니다. 이 획득 단계에서, 데이터 과학자들은 데이터의 양과 질또한 평가해야만 합니다. 얻은 것이 원하는 결과에 도달하는데 도움이 될 지 확인하기 위해서는 약간의 데이터 탐색이 요구됩니다.
|
||||
|
||||
데이터 과학자가 데이터에 대해 물어볼 수 있는 질문들 :
|
||||
- 어떤 데이터가 이미 제가 사용이 가능합니까?
|
||||
- 이 데이터의 소유자는 누구입니까?
|
||||
- 개인 정보 보호 문제는 무엇입니까?
|
||||
- 내가 이 문제를 해결할만큼 충분합니까?
|
||||
- 이 문제에 대해 허용 가능한 품질의 데이터 입니까?
|
||||
- 만약 내가 이 데이터를 통해 추가적인 정보를 발견한다면, 목표를 바꾸거나 정의를 다시 내려야 합니까?
|
||||
|
||||
## 데이터 처리
|
||||
|
||||
생애 주기의 데이터 처리단계는 모델링뿐만 아니라 데이터에서 패턴을 발견하는 데 초점을 맞춥니다. 데이터 처리 단계에서 사용되는 몇몇 기술들은 패턴을 파악하기 위한 통계정 방식을 필요로 합니다. 일반적으로, 이것이 사람에게는 대규모 데이터 세트로 수행하는 지루한 작업일것이고, 데이터 처리의 속도를 높이기 위해 무거운 작업을 컴퓨터들에게 시키며 의존하게 됩니다. 이 단계는 또한 데이터 과학과 기계학습이 교차하는 단계입니다. 첫 번째 수업에서 배웠듯이, 기계학습은 데이터를 이해하기 위한 모델을 구축하는 과정입니다. 모델은 데이터 내 변수간의 관계를 나타내는 것으로 결과들을 예측하는 데 도움이 됩니다.
|
||||
|
||||
일반적으로 이 단계에서 이요되는 기술들은 ML for Beginners 커리큘럼에서 다룹니다. 링크를 따라가 그것들에 대해 더 알아보십시오 :
|
||||
|
||||
- [분류](https://github.com/microsoft/ML-For-Beginners/tree/main/4-Classification): 보다 효율적인 사용을 위하여 데이터를 범주화 합니다.
|
||||
- [군집](https://github.com/microsoft/ML-For-Beginners/tree/main/5-Clustering): 데이터를 비슷한 군집들로 군집화 합니다.
|
||||
- [회귀](https://github.com/microsoft/ML-For-Beginners/tree/main/2-Regression): 값을 예측하거나 예측할 변수 간의 관계를 결정합니다.
|
||||
|
||||
## 유지보수
|
||||
생애주기 다이어그램에서, 유지보수는 데이터 포획단계와 데이터 처리단계의 사이에 있다는 것을 알 수 있습니다. 유지보수는 프로젝트 과정 전체에 걸쳐 데이터를 관리, 저장 및 보호하는 지속적인 과정이며 프로젝트 전체에 걸쳐 고려해야만 합니다.
|
||||
|
||||
### 데이터 저장
|
||||
데이터가 어떻게, 어디로 저장되는지에 대한 고려사항들은 저장소 비용뿐만 아니라 데이터의 접근 속도에 영향을 미칠 수 있습니다. 이와 같은 결정들은 데이터 과학자가 단독으로 내리는 것은 아니지만, 데이터 저장 방식에 따라 데이터를 처리하는 방식을 스스로 선택할 수 있습니다.
|
||||
|
||||
이러한 선택들에 영향을 미칠 수 있는 최신 데이터 저장소 시스템의 몇 가지 측면들입니다:
|
||||
|
||||
**전제 있음 vs 전제 없음 vs 공용 혹은 개인(자체) 클라우드**
|
||||
전제 있음은 데이터를 저장하는 하드 드라이브가 있는 서버를 소유하는 것과 같이 자체 장비에서 데이터를 관리하는 호스팅을 의미하는 반면, 전제 없음은 데이터 센터와 같이 소유하지 않은 장비에 의존합니다. 공용 클라우드는 데이터가 정확이 어디에 어떻게 저장되는지에 대한 지식이 필요하지 않은 데이터 저장에 인기있는 선택입니다. 여기서 공용이란 클라우드를 사용하는 모든 사용자가 공유하는 통합 기반 인프라를 의미합니다. 일부 조직들은 데이터가 호스팅되는 장비에 대하여 완전한 접근 권한을 요구하는 엄격한 보안정책이 있으며, 자체 클라우드 서비스를 제공하는 사설 클라우드에 의존합니다. 클라우드의 데이터에 대한 자세한 내용은 [다음 강의](5-Data-Science-In-Cloud) 에서 더 배우게 될 것입니다.
|
||||
|
||||
**Cold vs hot 데이터**
|
||||
모델을 훈련할 때, 더 많은 훈련데이터가 필요할 수 있습니다. 만약 당신이 당신의 모델에 만족을 한다면, 모델이 목적을 달성하도록 더 많은 데이터들이 제공될 것입니다. 어떠한 경우에도 데이터를 더 많이 축적할수록 데이터 저장 및 접근 비용은 증가합니다. 자주 접근하는 hot 데이터로부터, cold 데이터로 알려져 있는 자주 접근하지 않는 데이터를 분리하는 것은 하드웨어 혹은 소프트웨어 서비스를 통해 더 저렴한 데이터 저장 선택지가 될 수 있습니다. 만약 cold 데이터에 접근해야 하는 경우, hot 데이터에 비하여 검색하는데 시간이 좀 더 소요될 수 있습니다.
|
||||
|
||||
### 데이터 관리
|
||||
데이터를 작업 하다보면 정확한 모델을 구축하기 위해 [데이터 준비](2-Working-With-Data\08-data-preparation)에 중점을 둔 강의에서 다룬 일부 기술을 사용하여 일부 데이터를 정리해야 한다는 것을 알 수 있습니다. 새로운 데이터가 제공되면, 품질의 일관성을 유지하기 위해서 동일한 애플리케이션의 일부를 필요로 합니다. 일부 프로젝트들에서는 데이터를 최종 위치로 이동하기 전에 정리, 집계 및 압축 작업을 위한 자동화된 도구의 사용이 포합됩니다. Azure Data Factory는 이러한 도구 중 하나의 예입니다.
|
||||
|
||||
### 데이터 보안
|
||||
데이터 보안의 주요 목표 중 하나는 데이터를 작업하는 사람들이 수집 대상과 데이터가 사용되는 맥락을 제어할 수 있도록 하는 것입니다. 데이터 보안을 유지하려면 데이터를 필요로 하는 사람만 접근할 수 있도록 제한하고, 현지 법률 및 규정을 준수하며, [윤리 강의](1-Introduction\02-ethics)에서 다루는 윤리적 표준을 유지해야 합니다.
|
||||
|
||||
다음은 보안을 염두에 두고 팀에서 수행할 수 있는 몇 가지 사항입니다:
|
||||
- 모든 데이터가 암호화 되는지 확인합니다.
|
||||
- 그들의 데이터가 어떻게 이용되는지 고객들에게 정보를 제공합니다.
|
||||
- 프로젝트에서 떠난 사람들의 데이터 접근을 금지합니다.
|
||||
- 특정 프로젝트 구성원들만이 데이터를 변경할 수 있도록 허용합니다.
|
||||
|
||||
|
||||
## 🚀 도전
|
||||
|
||||
데이터 과학의 생애주기에는 여러가지 버전이 있습니다. 여기서 각 단계는 이름과 단계 수가 다를 수 있지만 이 강의에서 언급한 것과 동일한 과정을 포합합니다.
|
||||
|
||||
[Team Data Science Process lifecycle](https://docs.microsoft.com/en-us/azure/architecture/data-science-process/lifecycle) 와 [Cross-industry standard process for data mining](https://www.datascience-pm.com/crisp-dm-2/)를 탐구 해보십시오. 이 둘 사이의 3가지 유사점과 차이점을 대보시오.
|
||||
|
||||
|Team Data Science Process (TDSP)|Cross-industry standard process for data mining (CRISP-DM)|
|
||||
|--|--|
|
||||
| |  |
|
||||
| [Microsoft](https://docs.microsoft.comazure/architecture/data-science-process/lifecycle)의 이미지 | [Data Science Process Alliance](https://www.datascience-pm.com/crisp-dm-2/)의 이미지 |
|
||||
|
||||
## [이전 강의 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/27)
|
||||
|
||||
## 복습 & 자기주도학습
|
||||
|
||||
데이터 과학의 생애주기를 적용하는 데는 여러 역할과 작업이 포함되며, 일부는 각 단계의 특정 부분에 집중할 수 있습니다. 팀 데이터 과학 프로세스는 프로젝트에서 누군가가 가질 수 있는 역할 및 작업 유형을 설명하는 몇 가지 리소스를 제공합니다.
|
||||
|
||||
* [팀 데이터 과학 프로세스 역할 및 작업](https://docs.microsoft.com/en-us/azure/architecture/data-science-process/roles-tasks)
|
||||
* [데이터 과학 작업 실행: 탐색, 모델링 및 배치](https://docs.microsoft.com/en-us/azure/architecture/data-science-process/execute-data-science-tasks)
|
||||
|
||||
## 과제
|
||||
[데이터 세트 ](assignment.md)
|
||||
=======
|
||||
# 데이터 과학의 생애주기 소개
|
||||
|
||||
| ](../../../sketchnotes/14-DataScience-Lifecycle.png)|
|
||||
|:---:|
|
||||
| 데이터 과학의 생애주기 소개 - [@nitya](https://twitter.com/nitya)의 이미지 |
|
||||
|
||||
## [강의 시작 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/26)
|
||||
|
||||
이 시점에서 여러분은 아마 데이터 과학이 하나의 프로세스라는 것을 깨달았을 것입니다. 이 프로세스는 다음과 같이 5단계로 나눌 수 있습니다:
|
||||
|
||||
- 데이터 포획
|
||||
- 데이터 처리
|
||||
- 데이터 분석
|
||||
- 소통
|
||||
- 유지보수
|
||||
|
||||
|
||||
이번 강의에서는 생애 주기의 세 부분 : 데이터 포획, 데이터 처리 그리고 유지에 집중합니다.
|
||||
|
||||

|
||||
> [Berkeley School of Information](https://ischoolonline.berkeley.edu/data-science/what-is-data-science/) 의 이미지
|
||||
|
||||
## 데이터 포획
|
||||
|
||||
생애 주기의 첫 번째 단계는 다음 단계의 의존도가 높기 때문에 아주 중요합니다. 이것은 사실상 두 단계가 합해진 것이라고 볼 수 있습니다 : 데이터 수집과 해결해야 하는 문제들 및 목적 정의.
|
||||
프로젝트의 목표를 정의하려면 문제나 질문에 대해서 더 깊은 맥락을 필요로 할 것입니다. 첫째, 우리는 문제 해결이 필요한 사람들을 찾아내고 영입해야 한다. 그들은 사업의 이해관계자이거나 프로젝트의 후원자일 수도 있으며, 그들은 누가 이 프로젝트를 통해 이익을 얻을 수 있는지, 무엇을 왜 필요로 하는지를 식별하는데에 도움을 줄 수 있습니다. 잘 정의된 목표는 납득할만한 결과를 정의하기 위해 계량(측정)과 수량화가 가능해야만 한다.
|
||||
|
||||
데이터 과학자가 할 수도 있는 질문들 :
|
||||
- 이 문제에 접근한 적이 있습니까? 무엇이 발견되었습니까?
|
||||
- 관련되어 있는 모든 사람들이 목적과 목표를 이해하고 있습니까?
|
||||
- 모호성은 어디에서 확인할 수 있으며 어떻게 줄일 수 있겠습니까?
|
||||
- 제약이 되는 것들은 무엇입니까?
|
||||
- 최종 결과는 잠재적으로 어떻게 될 것 같습니까?
|
||||
- 사용 가능한 자원들 (시간, 인력, 컴퓨터 이용) 이 얼마나 됩니까?
|
||||
|
||||
다음은 이 정의된 목표들을 달성하는 데 필요한 데이터를 식별하고, 수집하고, 마지막으로 탐색하는 것입니다. 이 획득 단계에서, 데이터 과학자들은 데이터의 양과 질또한 평가해야만 합니다. 얻은 것이 원하는 결과에 도달하는데 도움이 될 지 확인하기 위해서는 약간의 데이터 탐색이 요구됩니다.
|
||||
|
||||
데이터 과학자가 데이터에 대해 물어볼 수 있는 질문들 :
|
||||
- 어떤 데이터가 이미 제가 사용이 가능합니까?
|
||||
- 이 데이터의 소유자는 누구입니까?
|
||||
- 개인 정보 보호 문제는 무엇입니까?
|
||||
- 내가 이 문제를 해결할만큼 충분합니까?
|
||||
- 이 문제에 대해 허용 가능한 품질의 데이터 입니까?
|
||||
- 만약 내가 이 데이터를 통해 추가적인 정보를 발견한다면, 목표를 바꾸거나 정의를 다시 내려야 합니까?
|
||||
|
||||
## 데이터 처리
|
||||
|
||||
생애 주기의 데이터 처리단계는 모델링뿐만 아니라 데이터에서 패턴을 발견하는 데 초점을 맞춥니다. 데이터 처리 단계에서 사용되는 몇몇 기술들은 패턴을 파악하기 위한 통계정 방식을 필요로 합니다. 일반적으로, 이것이 사람에게는 대규모 데이터 세트로 수행하는 지루한 작업일것이고, 데이터 처리의 속도를 높이기 위해 무거운 작업을 컴퓨터들에게 시키며 의존하게 됩니다. 이 단계는 또한 데이터 과학과 기계학습이 교차하는 단계입니다. 첫 번째 수업에서 배웠듯이, 기계학습은 데이터를 이해하기 위한 모델을 구축하는 과정입니다. 모델은 데이터 내 변수간의 관계를 나타내는 것으로 결과들을 예측하는 데 도움이 됩니다.
|
||||
|
||||
일반적으로 이 단계에서 이요되는 기술들은 ML for Beginners 커리큘럼에서 다룹니다. 링크를 따라가 그것들에 대해 더 알아보십시오 :
|
||||
|
||||
- [분류](https://github.com/microsoft/ML-For-Beginners/tree/main/4-Classification): 보다 효율적인 사용을 위하여 데이터를 범주화 합니다.
|
||||
- [군집](https://github.com/microsoft/ML-For-Beginners/tree/main/5-Clustering): 데이터를 비슷한 군집들로 군집화 합니다.
|
||||
- [회귀](https://github.com/microsoft/ML-For-Beginners/tree/main/2-Regression): 값을 예측하거나 예측할 변수 간의 관계를 결정합니다.
|
||||
|
||||
## 유지보수
|
||||
생애주기 다이어그램에서, 유지보수는 데이터 포획단계와 데이터 처리단계의 사이에 있다는 것을 알 수 있습니다. 유지보수는 프로젝트 과정 전체에 걸쳐 데이터를 관리, 저장 및 보호하는 지속적인 과정이며 프로젝트 전체에 걸쳐 고려해야만 합니다.
|
||||
|
||||
### 데이터 저장
|
||||
데이터가 어떻게, 어디로 저장되는지에 대한 고려사항들은 저장소 비용뿐만 아니라 데이터의 접근 속도에 영향을 미칠 수 있습니다. 이와 같은 결정들은 데이터 과학자가 단독으로 내리는 것은 아니지만, 데이터 저장 방식에 따라 데이터를 처리하는 방식을 스스로 선택할 수 있습니다.
|
||||
|
||||
이러한 선택들에 영향을 미칠 수 있는 최신 데이터 저장소 시스템의 몇 가지 측면들입니다:
|
||||
|
||||
**전제 있음 vs 전제 없음 vs 공용 혹은 개인(자체) 클라우드**
|
||||
전제 있음은 데이터를 저장하는 하드 드라이브가 있는 서버를 소유하는 것과 같이 자체 장비에서 데이터를 관리하는 호스팅을 의미하는 반면, 전제 없음은 데이터 센터와 같이 소유하지 않은 장비에 의존합니다. 공용 클라우드는 데이터가 정확이 어디에 어떻게 저장되는지에 대한 지식이 필요하지 않은 데이터 저장에 인기있는 선택입니다. 여기서 공용이란 클라우드를 사용하는 모든 사용자가 공유하는 통합 기반 인프라를 의미합니다. 일부 조직들은 데이터가 호스팅되는 장비에 대하여 완전한 접근 권한을 요구하는 엄격한 보안정책이 있으며, 자체 클라우드 서비스를 제공하는 사설 클라우드에 의존합니다. 클라우드의 데이터에 대한 자세한 내용은 [다음 강의](5-Data-Science-In-Cloud) 에서 더 배우게 될 것입니다.
|
||||
|
||||
**Cold vs hot 데이터**
|
||||
모델을 훈련할 때, 더 많은 훈련데이터가 필요할 수 있습니다. 만약 당신이 당신의 모델에 만족을 한다면, 모델이 목적을 달성하도록 더 많은 데이터들이 제공될 것입니다. 어떠한 경우에도 데이터를 더 많이 축적할수록 데이터 저장 및 접근 비용은 증가합니다. 자주 접근하는 hot 데이터로부터, cold 데이터로 알려져 있는 자주 접근하지 않는 데이터를 분리하는 것은 하드웨어 혹은 소프트웨어 서비스를 통해 더 저렴한 데이터 저장 선택지가 될 수 있습니다. 만약 cold 데이터에 접근해야 하는 경우, hot 데이터에 비하여 검색하는데 시간이 좀 더 소요될 수 있습니다.
|
||||
|
||||
### 데이터 관리
|
||||
데이터를 작업 하다보면 정확한 모델을 구축하기 위해 [데이터 준비](2-Working-With-Data\08-data-preparation)에 중점을 둔 강의에서 다룬 일부 기술을 사용하여 일부 데이터를 정리해야 한다는 것을 알 수 있습니다. 새로운 데이터가 제공되면, 품질의 일관성을 유지하기 위해서 동일한 애플리케이션의 일부를 필요로 합니다. 일부 프로젝트들에서는 데이터를 최종 위치로 이동하기 전에 정리, 집계 및 압축 작업을 위한 자동화된 도구의 사용이 포합됩니다. Azure Data Factory는 이러한 도구 중 하나의 예입니다.
|
||||
|
||||
### 데이터 보안
|
||||
데이터 보안의 주요 목표 중 하나는 데이터를 작업하는 사람들이 수집 대상과 데이터가 사용되는 맥락을 제어할 수 있도록 하는 것입니다. 데이터 보안을 유지하려면 데이터를 필요로 하는 사람만 접근할 수 있도록 제한하고, 현지 법률 및 규정을 준수하며, [윤리 강의](1-Introduction\02-ethics)에서 다루는 윤리적 표준을 유지해야 합니다.
|
||||
|
||||
다음은 보안을 염두에 두고 팀에서 수행할 수 있는 몇 가지 사항입니다:
|
||||
- 모든 데이터가 암호화 되는지 확인합니다.
|
||||
- 그들의 데이터가 어떻게 이용되는지 고객들에게 정보를 제공합니다.
|
||||
- 프로젝트에서 떠난 사람들의 데이터 접근을 금지합니다.
|
||||
- 특정 프로젝트 구성원들만이 데이터를 변경할 수 있도록 허용합니다.
|
||||
|
||||
|
||||
## 🚀 도전
|
||||
|
||||
데이터 과학의 생애주기에는 여러가지 버전이 있습니다. 여기서 각 단계는 이름과 단계 수가 다를 수 있지만 이 강의에서 언급한 것과 동일한 과정을 포합합니다.
|
||||
|
||||
[Team Data Science Process lifecycle](https://docs.microsoft.com/en-us/azure/architecture/data-science-process/lifecycle) 와 [Cross-industry standard process for data mining](https://www.datascience-pm.com/crisp-dm-2/)를 탐구 해보십시오. 이 둘 사이의 3가지 유사점과 차이점을 대보시오.
|
||||
|
||||
|Team Data Science Process (TDSP)|Cross-industry standard process for data mining (CRISP-DM)|
|
||||
|--|--|
|
||||
| |  |
|
||||
| [Microsoft](https://docs.microsoft.comazure/architecture/data-science-process/lifecycle)의 이미지 | [Data Science Process Alliance](https://www.datascience-pm.com/crisp-dm-2/)의 이미지 |
|
||||
|
||||
## [이전 강의 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/27)
|
||||
|
||||
## 복습 & 자기주도학습
|
||||
|
||||
데이터 과학의 생애주기를 적용하는 데는 여러 역할과 작업이 포함되며, 일부는 각 단계의 특정 부분에 집중할 수 있습니다. 팀 데이터 과학 프로세스는 프로젝트에서 누군가가 가질 수 있는 역할 및 작업 유형을 설명하는 몇 가지 리소스를 제공합니다.
|
||||
|
||||
* [팀 데이터 과학 프로세스 역할 및 작업](https://docs.microsoft.com/en-us/azure/architecture/data-science-process/roles-tasks)
|
||||
* [데이터 과학 작업 실행: 탐색, 모델링 및 배치](https://docs.microsoft.com/en-us/azure/architecture/data-science-process/execute-data-science-tasks)
|
||||
|
||||
## 과제
|
||||
[데이터 세트](assignment.md)
|
||||
>>>>>>> f226d9539b580b27eb72c07423c0e0a5fcf4d540
|
||||
@ -0,0 +1,46 @@
|
||||
# 데이터 과학의 라이프 사이클: 분석하기
|
||||
|
||||
| ](../../../sketchnotes/15-Analyzing.png)|
|
||||
|:---:|
|
||||
| 데이터 과학의 라이프 사이클: 분석하기 - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
|
||||
|
||||
## 강의 전 퀴즈
|
||||
|
||||
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/28)
|
||||
|
||||
데이터의 라이프사이클을 분석하면 데이터가 제안된 질문에 답하거나 특정 문제를 해결할 수 있음을 확인할 수 있습니다. 또한 이 단계는 모델이 이러한 질문과 문제를 올바르게 해결하는지 확인하는 데 초점을 맞출 수 있습니다. 이 과정에서는 데이터 내의 특징과 관계를 정의하는 기술이며 모델링을 위한 데이터를 준비하는 데 사용할 수 있는 탐색 데이터 분석(Exploratory Data Analysis) 또는 EDA에 초점을 맞춥니다.
|
||||
|
||||
[Kaggle](https://www.kaggle.com/balaka18/email-spam-classification-dataset-csv/version/1)의 예제 데이터셋을 사용하여 파이썬 및 Pandas 라이브러리에 어떻게 적용할 수 있는지 보여드리겠습니다. 이 데이터셋에는 이메일에서 발견되는 몇 가지 일반적인 단어가 포함되어 있으며 이러한 이메일의 출처는 익명입니다. 이전 디렉터리에 있는 [노트북](../notebook.ipynb)을 사용하여 계속 진행하십시오.
|
||||
|
||||
## 탐색 데이터 분석
|
||||
|
||||
라이프사이클의 캡처 단계는 데이터를 획득하는 단계이며 당면한 문제와 질문입니다. 하지만 데이터가 최종 결과를 지원하는 데 도움이 될 수 있는지 어떻게 알 수 있을까요?
|
||||
데이터 과학자는 데이터를 획득할 때 다음과 같은 질문을 할 수 있습니다.
|
||||
- 이 문제를 해결할 데이터가 충분한가요?
|
||||
- 이 문제에 적합한 품질의 데이터입니까?
|
||||
- 이 데이터를 통해 추가 정보를 발견하게 되면 목표를 바꾸거나 재정의하는 것을 고려해야 하나요?
|
||||
탐색적 데이터 분석은 데이터를 파악하는 프로세스이며, 이러한 질문에 답하는 데 사용할 수 있을 뿐만 아니라 데이터셋으로 작업하는 데 따른 당면 과제를 파악할 수 있습니다. 이를 달성하기 위해 사용되는 몇 가지 기술에 초점을 맞춰보겠습니다.
|
||||
|
||||
## 데이터 프로파일링, 기술 통계 및 Pandas
|
||||
이 문제를 해결하기에 충분한 데이터가 있는지 어떻게 평가합니까? 데이터 프로파일링은 기술 통계 기법을 통해 데이터셋에 대한 일반적인 전체 정보를 요약하고 수집할 수 있습니다. 데이터 프로파일링은 우리가 사용할 수 있는 것을 이해하는 데 도움이 되며 기술 통계는 우리가 사용할 수 있는 것이 얼마나 많은지 이해하는 데 도움이 됩니다.
|
||||
|
||||
이전 강의에서 우리는 Pandas를 사용하여 [`describe()` 함수]와 함께 기술 통계를 제공했습니다. 숫자 데이터에 대한 카운트, 최대값 및 최소값, 평균, 표준 편차 및 분위수를 제공합니다. `describe()` 함수와 같은 기술 통계를 사용하면 얼마나 가지고 있고 더 필요한지를 평가하는 데 도움이 될 수 있습니다.
|
||||
|
||||
## 샘플링 및 쿼리
|
||||
대규모 데이터셋의 모든 것을 탐색하는 것은 매우 많은 시간이 걸릴 수 있으며 일반적으로 컴퓨터가 수행해야 하는 작업입니다. 그러나 샘플링은 데이터를 이해하는 데 유용한 도구이며 데이터 집합에 무엇이 있고 무엇을 나타내는지를 더 잘 이해할 수 있도록 해줍니다. 표본을 사용하여 확률과 통계량을 적용하여 데이터에 대한 일반적인 결론을 내릴 수 있습니다. 표본 추출하는 데이터의 양에 대한 규칙은 정의되어 있지 않지만, 표본 추출하는 데이터의 양이 많을수록 데이터에 대한 일반화의 정확성을 높일 수 있다는 점에 유의해야 합니다.
|
||||
Pandas에는 받거나 사용하려는 임의의 샘플 수에 대한 아규먼트를 전달할 수 있는 [라이브러리 속 함수`sample()`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sample.html)이 있습니다.
|
||||
|
||||
데이터에 대한 일반적인 쿼리는 몇 가지 일반적인 질문과 이론에 답하는 데 도움이 될 수 있습니다. 샘플링과 달리 쿼리를 사용하면 질문이 있는 데이터의 특정 부분을 제어하고 집중할 수 있습니다.
|
||||
Pandas 라이브러리의 [`query()` 함수](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.query.html)를 사용하면 열을 선택하고 간단한 검색된 행을 통해 데이터에 대한 답변을 제공받을 수 있습니다.
|
||||
|
||||
## 시각화를 통한 탐색
|
||||
시각화 생성을 시작하기 위해 데이터가 완전히 정리되고 분석될 때까지 기다릴 필요가 없습니다. 실제로 탐색하는 동안 시각적 표현이 있으면 데이터의 패턴, 관계 및 문제를 식별하는 데 도움이 될 수 있습니다. 또한, 시각화는 데이터 관리에 관여하지 않는 사람들과 의사 소통하는 수단을 제공하고 캡처 단계에서 해결되지 않은 추가 질문을 공유하고 명확히 할 수 있는 기회가 될 수 있습니다. 시각적으로 탐색하는 몇 가지 인기 있는 방법에 대해 자세히 알아보려면 [section on Visualizations](3-Data-Visualization/README.md)을 참조하세요.
|
||||
|
||||
## 불일치 식별을 위한 탐색
|
||||
이 강의의 모든 주제는 누락되거나 일치하지 않는 값을 식별하는 데 도움이 될 수 있지만 Pandas는 이러한 값 중 일부를 확인하는 기능을 제공합니다. [isna() 또는 isnull()](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.isna.html)에서 결측값을 확인할 수 있습니다. 데이터 내에서 이러한 값을 탐구할 때 중요한 한 가지 요소는 처음에 이러한 값이 왜 이렇게 되었는지 이유를 탐구하는 것입니다. 이는 [문제 해결을 위해 취해야 할 조치](2-Working-With-Data\08-data-preparation/notebook.ipynb)를 결정하는 데 도움이 될 수 있습니다.
|
||||
|
||||
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/27)
|
||||
|
||||
## 과제
|
||||
|
||||
[Exploring for answers](assignment.ko.md)
|
||||
@ -0,0 +1,22 @@
|
||||
# 정답 찾기
|
||||
|
||||
이는 지난 강의의 [assignment](..\14-Introduction\assignment.md)와 이어지며, 우리는 잠시 데이터셋을 살펴보았습니다. 이제 데이터를 더욱 자세히 살펴보겠습니다.
|
||||
|
||||
다시 한번, 고객이 알고싶어하는 질문: **뉴욕의 노란 택시 승객들은 겨울이나 여름에 기사들에게 팁을 더 많이 주나요?**
|
||||
|
||||
당신의 팀은 Data Science Lifecycle의 [Analyzing](README.ko.md)단계에 있으며, 이 곳에서 데이터셋에 대한 탐색적 데이터분석을 수행해야합니다. 당신은 2019년 1월부터 7월까지 200건의 택시 거래가 포함된 노트북과 데이터셋을 제공받았습니다.
|
||||
|
||||
## 지시사항
|
||||
|
||||
이 디렉토리에는 [notebook](../assignment.ipynb)와 [Taxi & Limousine Commission](https://docs.microsoft.com/en-us/azure/open-datasets/dataset-taxi-yellow?tabs=azureml-opendatasets)의 데이터가 있습니다. 데이터에 대한 자세한 내용은 [dataset's dictionary](https://www1.nyc.gov/assets/tlc/downloads/pdf/data_dictionary_trip_records_yellow.pdf) 및 [user guide](https://www1.nyc.gov/assets/tlc/downloads/pdf/trip_record_user_guide.pdf)를 참조하세요.
|
||||
|
||||
이번 강의에서 배운 몇 가지 기술을 사용하여 노트북에 있는 EDA를 직접 수행하고(원하는 경우 셀 추가) 다음 질문에 답하십시오.
|
||||
|
||||
- 데이터의 어떤 다른 영향이 팁 금액에 영향을 미칠 수 있습니까?
|
||||
- 클라이언트의 질문에 답하는 데 가장 필요없는 열은 무엇입니까?
|
||||
- 지금까지 제공된 자료에 따르면, 데이터가 계절별 팁에대한 증거를 제공하는 것 같습니까?
|
||||
|
||||
## Rubric
|
||||
|
||||
모범 | 충분 | 개선 필요
|
||||
--- | --- | -- |
|
||||
@ -0,0 +1,16 @@
|
||||
# 数据科学的生命周期
|
||||
|
||||

|
||||
> 拍摄者 <a href="https://unsplash.com/@headwayio?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Headway</a> 上传于 <a href="https://unsplash.com/s/photos/communication?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
|
||||
|
||||
在这些课程中,你将探索到数据科学生命周期的一些方面,包括围绕数据展开的分析和数据之间的沟通。
|
||||
|
||||
### 主题
|
||||
|
||||
1. [简介](../14-Introduction/README.md)
|
||||
2. [数据分析](../15-Analyzing/README.md)
|
||||
3. [数据沟通](../16-communication/README.md)
|
||||
|
||||
### 致谢
|
||||
|
||||
这些课程由 [Jalen McGee](https://twitter.com/JalenMCG) 和 [Jasmine Greenaway](https://twitter.com/paladique) 用 ❤️ 编写
|
||||
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 4.4 KiB |
Loading…
Reference in new issue