Merge branch 'pt-PT-Translation' of https://github.com/Midas-sudo/Data-Science-For-Beginners into pt-PT-Translation

pull/327/head
Midas 4 years ago
commit c71638869d

@ -147,7 +147,7 @@ In this challenge, we will try to find concepts relevant to the field of Data Sc
![Word Cloud for Data Science](images/ds_wordcloud.png)
Visit [`notebook.ipynb`](notebook.ipynb) to read through the code. You can also run the code, and see how it performs all data transformations in real time.
Visit [`notebook.ipynb`](/1-Introduction/01-defining-data-science/notebook.ipynb ':ignore') to read through the code. You can also run the code, and see how it performs all data transformations in real time.
> If you do not know how to run code in a Jupyter Notebook, have a look at [this article](https://soshnikov.com/education/how-to-execute-notebooks-from-github/).

@ -70,7 +70,7 @@
"\r\n",
"The next step is to convert the data into the form suitable for processing. In our case, we have downloaded HTML source code from the page, and we need to convert it into plain text.\r\n",
"\r\n",
"There are many ways this can be done. We will use the simplest build-in [HTMLParser](https://docs.python.org/3/library/html.parser.html) object from Python. We need to subclass the `HTMLParser` class and define the code that will collect all text inside HTML tags, except `<script>` and `<style>` tags."
"There are many ways this can be done. We will use the simplest built-in [HTMLParser](https://docs.python.org/3/library/html.parser.html) object from Python. We need to subclass the `HTMLParser` class and define the code that will collect all text inside HTML tags, except `<script>` and `<style>` tags."
],
"metadata": {}
},
@ -115,7 +115,7 @@
"source": [
"## Step 3: Getting Insights\r\n",
"\r\n",
"The most important step is to turn our data into some for from which we can draw insights. In our case, we want to extract keywords from the text, and see which keywords are more meaningful.\r\n",
"The most important step is to turn our data into some form from which we can draw insights. In our case, we want to extract keywords from the text, and see which keywords are more meaningful.\r\n",
"\r\n",
"We will use Python library called [RAKE](https://github.com/aneesha/RAKE) for keyword extraction. First, let's install this library in case it is not present: "
],
@ -416,4 +416,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

@ -0,0 +1,171 @@
# Definiendo la ciencia de datos
| ![ Boceto por [(@sketchthedocs)](https://sketchthedocs.dev) ](../../sketchnotes/01-Definitions.png) |
| :----------------------------------------------------------------------------------------------------: |
| Definiendo la ciencia de datos - Boceto por [@nitya](https://twitter.com/nitya)_ |
---
[![Video definiendo la ciencia de datos](../images/video-def-ds.png)](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:
![Word Cloud para ciencia de datos](images/ds_wordcloud.png)
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,165 @@
# 데이터 과학(Data Science) 정의
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../sketchnotes/01-Definitions.png)|
|:---:|
|데이터 과학(Data Science) 정의 - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
---
[![데이터 과학(Data Science) 정의 영상](../images/video-def-ds.png)](https://youtu.be/pqqsm5reGvs)
## [Pre-lecture quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/0)
## 데이터란 무엇인가?
일상 생활에서 우리는 항상 데이터에 둘러싸여 있습니다. 지금 당신이 읽고 있는 이 글, 당신의 스마트폰 안에 있는 친구들의 전화번호 목록도 데이터이며, 시계에 표시되는 현재 시간 역시 마찬가지입니다. 인간으로서 우리는 가지고 있는 돈을 세거나 친구들에게 편지를 쓰면서 자연스럽게 데이터를 조작합니다.
그러나 데이터는 컴퓨터의 발명과 함께 훨씬 더 중요해졌습니다. 컴퓨터의 주요 역할은 계산을 수행하는 것이지만 컴퓨터에게는 계산할 데이터가 필요합니다. 따라서, 우리는 컴퓨터가 데이터를 저장하고 처리하는 방법을 이해해야 합니다.
인터넷의 등장으로 데이터 처리 장치로서의 컴퓨터 역할이 증가했습니다. 생각해보면, 우리는 점점 더 컴퓨터를 문자 그대로의 계산보다는 데이터 처리와 통신을 위해 사용하고있습니다. 친구에게 이메일을 쓰거나 인터넷에서 정보를 검색할 때, 우리는 본질적으로 데이터를 생성, 저장, 전송 및 조작을 합니다.
> 마지막으로 컴퓨터를 사용하여 실제로 무엇인가를 계산한 적이 언제인지 기억하십니까?
## 데이터 과학(data science)란 무엇인가?
[위키피디아](https://en.wikipedia.org/wiki/Data_science)에서, **데이터 과학**은 *정형 데이터와 비정형 데이터에서 지식과 통찰력을 추출하고 광범위한 어플리케이션 도메인에 걸쳐 데이터에서 지식과 실행가능한 통찰력을 적용하기 위해 과학적 방법을 사용하는 과학 분야*로 정의됩니다.
이 정의는 데이터 과학의 다음과 같은 중요한 측면을 강조합니다:
* 데이터 과학의 주된 목표는 데이터에서 **지식을 추출**하는 것, 즉, 데이터를 **이해**하고, 숨겨진 관계를 찾고 **모델**을 구축하는 것입니다.
* 데이터 과학은 확률 및 통계와 같은 **과학적 방법**을 사용합니다. 사실 *데이터 과학(data science)*라는 용어가 처음 소개되었을 때, 일부 사람들은 데이터 과학이 통계의 새로운 멋진 이름일 뿐이라고 주장했습니다. 오늘날에는 데이터 과학의 분야가 훨씬 더 광범위하다는 것이 분명해졌습니다.
* 추출한 지식을 적용하여 **실행 가능한 통찰력**을 생성해야 합니다.
* **정형** 및 **비정형** 데이터 모두에서 작업할 수 있어야 합니다. 이 과정의 뒷부분에서 다양한 유형의 데이터에 대해 더 논의할 것입니다.
* **어플리케이션 도메인**은 중요한 개념이며, 데이터 과학자는 종종 문제 도메인(problem domain)에서 최소한 어느 정도의 전문 지식을 필요로 합니다.
> 데이터 과학의 또 다른 중요한 측면은 컴퓨터를 사용하여 데이터를 수집, 저장 및 운영하는 방법을 연구한다는 것입니다. 통계는 우리에게 수학적인 기초를 제공하지만, 데이터 과학은 수학적 개념을 적용하여 실제로 데이터에서 통찰력을 이끌어냅니다.
([짐 그레이](https://en.wikipedia.org/wiki/Jim_Gray_(computer_scientist))에 의하면) 데이터 과학을 보는 방법 중 하나는 데이터 과학을 별도의 과학 패러다임으로 간주하는 것입니다:
* **경험적**: 우리는 주로 관찰과 실험 결과에 의존합니다.
* **이론적**: 기존의 과학적 지식에서 새로운 개념이 등장한 것입니다.
* **전산적(Computational)**: 전산적인 실험을 기반으로 새로운 원리를 발견합니다.
* **데이터 기반(Data-Driven)**: 데이터에서 관계와 패턴을 발견하는 것에 기반합니다.
## 기타 관련 분야
데이터는 널리 알려진 개념이기 때문에, 데이터 과학 자체도 다른 많은 관련 분야를 다루는 광범위한 분야입니다.
<dl>
<dt>데이터베이스(Databases)</dt>
<dd>
우리가 반드시 고려해야 할 것은 데이터를 **저장하는 방법**, 즉, 데이터를 더 빠르게 처리하기 위해 데이터를 구조화하는 방법입니다. 정형 데이터와 비정형 데이터를 저장하는 다양한 유형의 데이터베이스가 있으며, [이 과정에서 그러한 점을 고려할 것입니다.] (../../../2-Working-With-Data/translations/README.ko.md).
</dd>
<dt>빅데이터(Big Data)</dt>
<dd>
종종 우리는 비교적 단순한 구조로 정말 많은 양의 데이터를 저장하고 처리해야 합니다. 데이터를 컴퓨터 클러스터에 분산 방식으로 저장하고 효율적으로 처리하기 위한 특별한 접근 방식과 도구가 있습니다.
</dd>
<dt>머신러닝(Machine Learning)</dt>
<dd>
데이터를 이해하는 방법 중 하나는 원하는 결과를 예측할 수 있는 **모델을 구축**하는 것 입니다. 데이터에서 이러한 모델을 학습할 수 있다는 것은 **머신러닝**에서 연구되는 역역입니다. 이 분야에 대해 자세히 알아보고 싶다면, [초보자를 위한 머신러닝](https://github.com/microsoft/ML-For-Beginners/) 과정을 보실 수 있습니다.
</dd>
<dt>인공지능(Artificial Intelligence)</dt>
<dd>
머신러닝과 마찬가지로, 인공지능도 데이터에 의존하며 인간과 유사항 행동을 보이는 복잡한 모델을 구축해야 합니다. 또한 인공지능 방법을 사용하면 일부 인사이트를 추출하여 비정형 데이터(예: 자연어)를 정형 데이터로 전환할 수 있습니다.
</dd>
<dt>시각화(Visualization)</dt>
<dd>
방대한 양의 데이터는 인간이 이해할 수 없지만, 유용한 시각화를 생성하면, 데이터를 더 잘 이해하고 데이터에서 몇 가지 결론을 도출해낼 수 있습니다. 따라서 정보를 시각화하는 여러 가지 방법을 아는 것이 중요합니다. 이는 우리 과정의 [Section 3](../../../3-Data-Visualization/README.md)에서 다룰 것입니다. 관련 분야에는 일반적으로 **인포그래픽(Infographics)** 및 **인간-컴퓨터 상호작용(Human-Computer Interaction)**도 포함됩니다.
</dd>
</dl>
## 데이터 유형
이미 언급했던 것처럼 데이터는 어디에나 있으므로, 우리는 데이터를 올바른 방법으로 수집하기만 하면 됩니다! **정형** 데이터와 **비정형** 데이터를 구별하는 것이 유용합니다. 정형 데이터는 일반적으로 잘 구조화된 형식으로, 종종 테이블 또는 테이블 수로 표시되는 반면 비정형 데이터는 파일 모음일 뿐입니다. 크게 다를 수 있는 구조를 가진 **반정형** 데이터에 대해서도 때때로 다룰 것입니다.
| 정형(Structured) | 반정형(Semi-structured) | 비정형(Unstructured) |
|------------|-----------------|--------------|
| 사람들과 그들의 전화번호 목록 | 위키피디아 페이지와 그 링크 | 브리태니커 백과사전 텍스트 |
| 지난 20년 동안 매 분 마다의 모든 방의 온도 | 저자, 출판 데이터, 초록이 포함된 JSON 형식의 과학 논문 모음 | 기업 문서와 파일 공유 |
| 건물에 출입하는 모든 사람의 연령 및 성별 데이터 | 인터넷 페이지 | 감시 카메라의 원시 비디오 피드 |
## 데이터를 얻을 수 있는 곳
데이터를 얻을 수 있는 소스들은 많고, 모든 소스를 나열하는 것은 불가능합니다! 그러나 데이터를 얻을 수 있는 몇 가지 일반적인 소스들은 이러합니다.
* **정형(Structured)**
- **사물 인터넷(IoT)**: 온도 또는 압력 센서와 같은 다양한 센서의 데이터를 포함하는 사물 인터넷은 많은 유용한 데이터를 제공합니다. 예를 들어, 사무실 건물에 IoT 센서가 장착되어 있으면 난방과 조명을 자동으로 제어하여 비용을 최소화할 수 있습니다.
- **설문조사**: 상품 구매 후 또는 웹사이트 방문 후 사용자에게 묻는 설문조사.
- **행동 분석**: 예를 들어 사용자가 사이트에 얼마나 깊이 들어가고 사이트를 떠나는 일반적인 이유는 무엇인지 이해하는 데 도움이 될 수 있습니다.
* **비정형(Unstructured)**
- **텍스트**: 전반적인 **감정 점수(sentiment score)**에서 시작해서, 키워드 및 의미론적 의미(semantic meaning) 추출에 이르기까지 통찰력을 얻을 수 있는 풍부한 소스가 될 수 있습니다.
- **이미지** 또는 **동영상**: 감시 카메라의 비디오를 사용하여 도로의 교통량을 추정하고 잠재적인 교통 체증에 대해 알릴 수 있습니다.
- **로그**: 웹 서버 로그는 당사 사이트에서 가장 많이 방문한 페이지와 시간을 파악하는 데 사용할 수 있습니다.
* 반정형(Semi-structured)
- **소셜 네트워크(Social Network)**: 소셜 네트워크 그래프는 사용자의 성격과 정보 확산의 잠재적 효과에 대한 훌륭한 데이터 소스가 될 수 있습니다.
- **그룹 역학**: 파티에서 찍은 사진이 많을 때 서로 사진을 찍는 사람들의 그래프를 만들어 그룹 역학 데이터를 추출해 볼 수 있습니다.
다양한 데이터 소스를 알면, 상황을 더 잘 파악하고 비즈니스 프로세스를 개선하기 위해, 데이터 과학 기술을 적용할 수 있는 다양한 시나리오에 대해 생각해 볼 수 있습니다.
## 데이터로 할 수 있는 일
데이터 과학에서는 데이터 여정의 다음 단계에 중점을 둡니다.
<dl>
<dt>1) 데이터 수집</dt>
<dd>
첫 번째 단계는 데이터를 수집하는 것입니다. 많은 경우 웹 애플리케이션에서 데이터베이스로 오는 데이터와 같이 간단한 프로세스일 수 있지만 때로는 특별한 기술을 사용해야 합니다. 예를 들어 IoT 센서의 데이터는 압도적으로 많을 수 있으며, IoT Hub와 같은 버퍼링 엔드포인트를 사용하여 추가 프로세싱 전에 모든 데이터를 수집하는 것이 좋습니다.
</dd>
<dt>2) 데이터 저장</dt>
<dd>
특히 빅 데이터의 경우에, 데이터를 저장하는 것은 어려울 수 있습니다. 데이터를 저장하는 방법을 결정할 때는 나중에 데이터를 쿼리할 방법을 예상하는 것이 좋습니다. 데이터를 저장할 수 있는 방법에는 여러 가지가 있습니다.
<ul>
<li>관계형 데이터베이스는 테이블 모음을 저장하고 SQL이라는 특수 언어를 사용하여 쿼리합니다. 일반적으로 테이블은 어떤 스키마를 사용하여 서로 연결됩니다. 많은 경우 스키마에 맞게 원래 형식의 데이터를 변환해야 합니다.</li>
<li><a href="https://azure.microsoft.com/services/cosmos-db/?WT.mc_id=acad-31812-dmitryso">CosmosDB</a>와 같은 <a href="https://en.wikipedia.org/wiki/NoSQL">NoSQL</a> 데이터베이스는 데이터에 스키마를 적용하지 않으며, 계층적 JSON 문서 또는 그래프와 같은 더 복잡한 데이터를 저장할 수 있습니다. 그러나 NoSQL 데이터베이스는 SQL의 풍부한 쿼리 기능이 없으며 데이터 간의 참조 무결성을 강제할 수 없습니다.</li>
<li><a href="https://en.wikipedia.org/wiki/Data_lake">Data Lake</a> 저장소는 원시 형식(raw form)의 대규모 데이터 저장소로 사용됩니다. 데이터 레이크는 모든 데이터가 하나의 시스템에 들어갈 수 없고 클러스터에서 저장 및 처리를 해야하는 빅 데이터와 함께 사용하는 경우가 많습니다. <a href="https://en.wikipedia.org/wiki/Apache_Parquet">Parquet</a>은 빅 데이터와 함께 자주 사용되는 데이터 형식입니다.</li>
</ul>
</dd>
<dt>3) 데이처 처리</dt>
<dd>
이 부분은 데이터를 원래 형식에서 시각화/모델 학습에 사용할 수 있는 형식으로 처리하는 것과 관련된, 데이터 여정에서 가장 흥미로운 부분입니다. 텍스트나 이미지와 같은 비정형 데이터를 처리할 때 데이터에서 **특징(features)**을 추출하여 정형화된 형식으로 변환하기 위해 일부 AI 기술을 사용해야 할 수도 있습니다.
</dd>
<dt>4) 시각화(Visualization) / 인간 통찰력(Human Insights)</dt>
<dd>
데이터를 이해하기 위해 우리는 종종 데이터를 시각화해야 합니다. 우리에게는 다양한 시각화 기술이 있으므로 인사이트를 만들어내기 위한 올바른 데이터의 시각화를 찾아낼 수 있습니다. 종종 데이터 과학자는 "데이터를 가지고 노는" 작업을 수행하여 여러 번 시각화하고 관계를 찾아야 합니다. 또한 통계 기술을 사용하여 몇 가지 가설을 테스트하거나 서로 다른 데이터 조각 간의 상관 관계를 증명할 수 있습니다.
</dd>
<dt>5) 예측 모델 학습</dt>
<dd>
데이터 과학의 궁극적인 목표는 데이터를 기반으로 의사 결정을 내리는 것이므로, 문제를 해결할 수 있는 예측 모델을 구축하기 위해 <a href="http://github.com/microsoft/ml-for-beginners">머신러닝</a> 기술을 사용할 수 있습니다.
</dd>
</dl>
물론 실제 데이터에 따라 일부 단계가 누락될 수 있거나(예: 데이터베이스에 데이터가 이미 있는 경우 또는 모델 학습이 필요하지 않은 경우) 일부 단계가 여러 번 반복될 수 있습니다(예: 데이터 처리 ).
## 디지털화(Digitalization) 및 디지털 트랜스포메이션(Digital Transformation)
지난 10년 동안, 많은 기업이 비즈니스 결정을 내릴 때 데이터의 중요성을 이해하기 시작했습니다. 데이터 과학 원칙을 비즈니스 운영에 적용하려면 먼저 일부 데이터를 수집해야 합니다. 즉, 어떻게든 비즈니스 프로세스를 디지털 형식으로 전환해야 합니다. 이를 **디지털화(digitalization)**라고 하며, 데이터 과학 기술을 사용하여 결정을 안내하고 종종 생산성(또는 비즈니스 피봇(pivot))이 크게 증가하는 **디지털 트랜스포메이션(Digital Transformation)**을 동반합니다.
예를 들어 보겠습니다. 우리가 학생들에게 온라인으로 제공하는 데이터 과학 과정(예를 들어 현재 이 과정)이 있고 이를 개선하기 위해 데이터 과학을 사용하려고 한다고 가정해 보겠습니다. 어떻게 할 수 있습니까?
우리는 "무엇을 디지털화할 수 있는가?"라고 생각하는 것으로 시작할 수 있습니다. 가장 간단한 방법은 각 학생이 각 모듈을 완료하는 데 걸리는 시간과 획득한 지식을 측정하는 것입니다(예를 들어, 각 모듈의 끝에 객관식 테스트를 제공함으로). 모든 학생의 완료 시간을 평균화하여 어떤 모듈이 학생들에게 가장 많은 문제를 일으키는지 찾아내고 이를 단순화하기 위해 노력할 수 있습니다.
> 모듈의 길이가 다를 수 있으므로 이 접근 방식이 이상적이지 않다고 주장할 수 있습니다. 시간을 모듈의 길이(문자 수)로 나누고 대신 해당 값을 비교하는 것이 더 공정할 수 있습니다.
객관식 시험의 결과를 분석하기 시작하면 학생들이 잘 이해하지 못하는 특정 개념을 찾아 내용을 개선할 수 있습니다. 그렇게 하려면 각 질문이 특정 개념이나 지식 덩어리에 매핑되는 방식으로 테스트를 설계해야 합니다.
더 복잡하게 하려면 학생의 연령 범주에 대해 각 모듈에 소요된 시간을 표시할 수 있습니다. 일부 연령 범주의 경우 모듈을 완료하는 데 부적절하게 오랜 시간이 걸리거나 학생들이 특정 지점에서 중도 탈락한다는 것을 알 수 있습니다. 이를 통해 모듈에 대한 권장 연령을 제공하고 잘못된 기대로 인한 사람들의 불만을 최소화할 수 있습니다.
## 🚀 챌린지
이 챌린지에서는 텍스트에서 데이터 과학 분야와 관련된 개념을 찾으려고 합니다. 데이터 과학에 대한 Wikipedia 기사를 가져와 텍스트를 다운로드 및 처리한 다음 다음과 같은 워드 클라우드를 구축해봅시다.
![데이터 과학에 대한 워드 클라우드](../images/ds_wordcloud.png)
[`notebook.ipynb`](../notebook.ipynb)에서 코드를 읽어보세요. 코드를 실행할 수 있고, 실시간으로 모든 데이터 변환을 어떻게 수행하는 지 확인할 수 있습니다.
> 주피터 노트북(Jupyter Notebook)에서 코드를 어떻게 실행하는 지 잘 모른다면, [이 기사](https://soshnikov.com/education/how-to-execute-notebooks-from-github/)를 읽어보세요.
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/1)
## 과제
* **Task 1**: **빅 데이터** 및 **머신러닝** 분야에 대한 관련 개념을 찾기 위해 위의 코드를 수정합니다.
* **Task 2**: [데이터 과학 시나리오에 대해 생각하기](./assignment.ko.md)
## 크레딧
강의를 제작한 분: [Dmitry Soshnikov](http://soshnikov.com)

@ -0,0 +1,164 @@
# Definitie van Data Science
| ![ Sketchnote door [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../sketchnotes/01-Definitions.png) |
| :----------------------------------------------------------------------------------------------------: |
| Defining Data Science - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
---
[![Defining Data Science Video](../images/video-def-ds.png)](https://youtu.be/beZ7Mb_oz9I)
## [Starttoets data science](https://red-water-0103e7a0f.azurestaticapps.net/quiz/0)
## Wat is Data?
In ons dagelijks leven zijn we voortdurend omringd door data. De tekst die je nu leest is data. De lijst met telefoonnummers van je vrienden op je smartphone is data, evenals de huidige tijd die op je horloge wordt weergegeven. Als mens werken we van nature met data, denk aan het geld dat we moeten tellen of door berichten te schrijven aan onze vrienden.
Gegevens werden echter veel belangrijker met de introductie van computers. De primaire rol van computers is om berekeningen uit te voeren, maar ze hebben gegevens nodig om mee te werken. We moeten dus begrijpen hoe computers gegevens opslaan en verwerken.
Met de opkomst van het internet nam de rol van computers als gegevensverwerkingsapparatuur toe. Als je erover nadenkt, gebruiken we computers nu steeds meer voor gegevensverwerking en communicatie, in plaats van echte berekeningen. Wanneer we een e-mail schrijven naar een vriend of zoeken naar informatie op internet, creëren, bewaren, verzenden en manipuleren we in wezen gegevens.
> Kan jij je herinneren wanneer jij voor het laatste echte berekeningen door een computer hebt laten uitvoeren?
## Wat is Data Science?
[Wikipedia](https://en.wikipedia.org/wiki/Data_science) definieert **Data Science** als *een interdisciplinair onderzoeksveld met betrekking tot wetenschappelijke methoden, processen en systemen om kennis en inzichten te onttrekken uit (zowel gestructureerde als ongestructureerde) data.*
Deze definitie belicht de volgende belangrijke aspecten van data science:
* Het belangrijkste doel van data science is om **kennis** uit gegevens te destilleren, in andere woorden - om data **te begrijpen**, verborgen relaties te vinden en een **model** te bouwen.
* Data science maakt gebruik van **wetenschappelijke methoden**, zoals waarschijnlijkheid en statistiek. Toen de term *data science* voor het eerst werd geïntroduceerd, beweerden sommige mensen zelfs dat data science slechts een nieuwe mooie naam voor statistiek was. Tegenwoordig is duidelijk geworden dat het veld veel breder is.
* Verkregen kennis moet worden toegepast om enkele **bruikbare inzichten** te produceren, d.w.z. praktische inzichten die je kunt toepassen op echte bedrijfssituaties.
* We moeten in staat zijn om te werken met zowel **gestructureerde** als **ongestructureerde** data. We komen later in de cursus terug om verschillende soorten gegevens te bespreken.
* **Toepassingsdomein** is een belangrijk begrip, en datawetenschappers hebben vaak minstens een zekere mate van expertise nodig in het probleemdomein, bijvoorbeeld: financiën, geneeskunde, marketing, enz.
> Een ander belangrijk aspect van Data Science is dat het bestudeert hoe gegevens kunnen worden verzameld, opgeslagen en bediend met behulp van computers. Terwijl statistiek ons wiskundige grondslagen geeft, past data science wiskundige concepten toe om daadwerkelijk inzichten uit gegevens te halen.
Een van de manieren (toegeschreven aan [Jim Gray](https://en.wikipedia.org/wiki/Jim_Gray_(computer_scientist))) om naar de data science te kijken, is om het te beschouwen als een apart paradigma van de wetenschap:
* **Empirisch**, waarbij we vooral vertrouwen op waarnemingen en resultaten van experimenten
* **Theoretisch**, waar nieuwe concepten voortkomen uit bestaande wetenschappelijke kennis
* **Computational**, waar we nieuwe principes ontdekken op basis van enkele computationele experimenten
* **Data-Driven**, gebaseerd op het ontdekken van relaties en patronen in de data
## Andere gerelateerde vakgebieden
Omdat data alomtegenwoordig is, is data science zelf ook een breed vakgebied, dat veel andere disciplines raakt.
<dl>
<dt>Databases</dt>
<dd>
Een kritische overweging is **hoe de gegevens op te slaan**, d.w.z. hoe deze te structureren op een manier die een snellere verwerking mogelijk maakt. Er zijn verschillende soorten databases die gestructureerde en ongestructureerde gegevens opslaan, welke <a href ="../../../2-Working-With-Data/README.md">we in onze cursus zullen overwegen</a>.
</dd>
<dt>Big Data</dt>
<dd>
Vaak moeten we zeer grote hoeveelheden gegevens opslaan en verwerken met een relatief eenvoudige structuur. Er zijn speciale benaderingen en hulpmiddelen om die gegevens op een gedistribueerde manier op een computercluster op te slaan en efficiënt te verwerken.
</dd>
<dt>Machine learning</dt>
<dd>
Een manier om gegevens te begrijpen is door **een model** te bouwen dat in staat zal zijn om een gewenste uitkomst te voorspellen. Het ontwikkelen van modellen op basis van data wordt **machine learning** genoemd. Misschien wilt u een kijkje nemen op onze <a href = "https://aka.ms/ml-beginners">Machine Learning for Beginners</a> Curriculum om er meer over te weten te komen.
</dd>
<dt>kunstmatige intelligentie</dt>
<dd>
Een gebied van machine learning dat bekend staat als Artificial Intelligence (AI) is ook afhankelijk van gegevens en betreft het bouwen van modellen met een hoge complexiteit die menselijke denkprocessen nabootsen. AI-methoden stellen ons vaak in staat om ongestructureerde data (bijvoorbeeld natuurlijke taal) om te zetten in gestructureerde inzichten.
</dd>
<dt>visualisatie</dt>
<dd>
Enorme hoeveelheden gegevens zijn onbegrijpelijk voor een mens, maar zodra we nuttige visualisaties maken met behulp van die gegevens, kunnen we de gegevens beter begrijpen en enkele conclusies trekken. Het is dus belangrijk om veel manieren te kennen om informatie te visualiseren - iets dat we zullen behandelen in <a href="../../../3-Data-Visualization/README.md">Sectie 3</a> van onze cursus. Gerelateerde velden omvatten ook **Infographics** en **Mens-computerinteractie** in het algemeen.
</dd>
</dl>
## Typen van Data
Zoals we al hebben vermeld, zijn gegevens overal te vinden. We moeten het gewoon op de juiste manier vastleggen! Het is handig om onderscheid te maken tussen **gestructureerde** en **ongestructureerde** data. De eerste wordt meestal weergegeven in een goed gestructureerde vorm, vaak als een tabel of een aantal tabellen, terwijl de laatste slechts een verzameling bestanden is. Soms kunnen we het ook hebben over **semigestructureerde** gegevens, die een soort structuur hebben die sterk kan variëren.
| Gestructureerde | Semi-gestructureerde | Ongestructureerde |
| --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| Lijst van mensen met hun telefoonnummer | Wikipedia pagina's met links | Tekst van encyclopaedia Britannica |
| Temperatuur in alle kamers van een gebouw op elke minuut gedurende de laatste 20 jaar | Verzameling van wetenschappelijke artikelen in JSON-formaat met auteurs, publicatiegegevens en een abstract | Bestanden opslag met bedrijfsdocumenten |
| Gegevens van leeftijd en geslacht van alle mensen die het gebouw betreden | Internet pagina's | Onbewerkte videofeed van bewakingscamera's |
## Waar data vandaan te halen
Er zijn veel mogelijke gegevensbronnen en het zal onmogelijk zijn om ze allemaal op te sommen! Laten we echter enkele van de typische plaatsen noemen waar u gegevens kunt krijgen:
* **Gestructureerd**
- **Internet of Things** (IoT), inclusief data van verschillende sensoren, zoals temperatuur- of druksensoren, leveren veel bruikbare data op. Als een kantoorgebouw bijvoorbeeld is uitgerust met IoT-sensoren, kunnen we automatisch verwarming en verlichting regelen om de kosten te minimaliseren.
- **Enquêtes** die we gebruikers vragen in te vullen na een aankoop of na een bezoek aan een website.
- **Analyse van gedrag** kan ons bijvoorbeeld helpen begrijpen hoe diep een gebruiker in een website gaat en wat de typische reden is om de site te verlaten.
* **Ongestructureerd **
- **Teksten** kunnen een rijke bron van inzichten zijn, zoals een algemene **sentimentscore**, of het extraheren van trefwoorden en semantische betekenis.
- **Afbeeldingen** of **Video**. Een video van een bewakingscamera kan worden gebruikt om het verkeer op de weg in te schatten en mensen te informeren over mogelijke files.
- Webserver **Logs** kunnen worden gebruikt om te begrijpen welke pagina's van onze site het vaakst worden bezocht en voor hoe lang.
* Semi-gestructureerd
- **Social Network** grafieken kunnen geweldige bronnen van gegevens zijn over gebruikerspersoonlijkheden en potentiële effectiviteit bij het verspreiden van informatie.
- Wanneer we een heleboel foto's van een feest hebben, kunnen we proberen **Group Dynamics**-gegevens te extraheren door een grafiek te maken van mensen die met elkaar foto's maken.
Door verschillende mogelijke databronnen te kennen, kun je proberen na te denken over verschillende scenario's waarin data science technieken kunnen worden toegepast om de situatie beter te leren kennen en bedrijfsprocessen te verbeteren.
## Wat je met Data kunt doen
In Data Science richten we ons op de volgende stappen van data journey:
<dl>
<dt>1) Data-acquisitie</dt>
<dd>
De eerste stap is het verzamelen van de gegevens. Hoewel het in veel gevallen een eenvoudig proces kan zijn, zoals gegevens die vanuit een webapplicatie naar een database komen, moeten we soms speciale technieken gebruiken. Gegevens van IoT-sensoren kunnen bijvoorbeeld overweldigend zijn en het is een goede gewoonte om bufferingseindpunten zoals IoT Hub te gebruiken om alle gegevens te verzamelen voordat ze verder worden verwerkt.
</dd>
<dt>2) Gegevensopslag</dt>
<dd>
Het opslaan van gegevens kan een uitdaging zijn, vooral als we het hebben over big data. Wanneer u beslist hoe u gegevens wilt opslaan, is het logisch om te anticiperen op de manier waarop u de gegevens in de toekomst zou opvragen. Er zijn verschillende manieren waarop gegevens kunnen worden opgeslagen:
<ul>
<li>Een relationele database slaat een verzameling tabellen op en gebruikt een speciale taal genaamd SQL om deze op te vragen. Tabellen zijn meestal georganiseerd in verschillene groepen die schema's worden genoemd. In veel gevallen moeten we de gegevens van de oorspronkelijke vorm converteren naar het schema.</li>
<li><a href="https://en.wikipedia.org/wiki/NoSQL">A NoSQL</a> database, zoals <a href="https://azure.microsoft.com/services/cosmos-db/?WT.mc_id=academic-31812-dmitryso">CosmosDB</a>, dwingt geen schema's af op gegevens en maakt het opslaan van complexere gegevens mogelijk, bijvoorbeeld hiërarchische JSON-documenten of grafieken. NoSQL-databases hebben echter niet de uitgebreide querymogelijkheden van SQL en kunnen geen referentiële integriteit afdwingen, d.w.z. regels over hoe de gegevens in tabellen zijn gestructureerd en de relaties tussen tabellen regelen.</li>
<li><a href="https://en.wikipedia.org/wiki/Data_lake">Data Lake</a> opslag wordt gebruikt voor grote verzamelingen gegevens in ruwe, ongestructureerde vorm. Data lakes worden vaak gebruikt met big data, waarbij alle data niet op één machine past en moet worden opgeslagen en verwerkt door een cluster van servers. <a href="https://en.wikipedia.org/wiki/Apache_Parquet">Parquet</a> is het gegevensformaat dat vaak wordt gebruikt in combinatie met big data.</li>
</ul>
</dd>
<dt>3) Gegevensverwerking</dt>
<dd>
Dit is het meest spannende deel van het gegevenstraject, waarbij de gegevens van de oorspronkelijke vorm worden omgezet in een vorm die kan worden gebruikt voor visualisatie / modeltraining. Bij het omgaan met ongestructureerde gegevens zoals tekst of afbeeldingen, moeten we mogelijk enkele AI-technieken gebruiken om **functies** uit de gegevens te destilleren en deze zo naar gestructureerde vorm te converteren.
</dd>
<dt>4) Visualisatie / Menselijke inzichten</dt>
<dd>
Vaak moeten we, om de gegevens te begrijpen, deze visualiseren. Met veel verschillende visualisatietechnieken in onze toolbox kunnen we de juiste weergave vinden om inzicht te krijgen. Vaak moet een data scientist "spelen met data", deze vele malen visualiseren en op zoek gaan naar wat relaties. Ook kunnen we statistische technieken gebruiken om een hypothese te testen of een correlatie tussen verschillende gegevens te bewijzen.
</dd>
<dt>5) Het trainen van een voorspellend model</dt>
<dd>
Omdat het uiteindelijke doel van data science is om beslissingen te kunnen nemen op basis van data, willen we misschien de technieken van <a href="http://github.com/microsoft/ml-for-beginners">Machine Learning</a> gebruiken om een voorspellend model te bouwen. We kunnen dit vervolgens gebruiken om voorspellingen te doen met behulp van nieuwe datasets met vergelijkbare structuren.
</dd>
</dl>
Natuurlijk, afhankelijk van de werkelijke gegevens, kunnen sommige stappen ontbreken (bijvoorbeeld wanneer we de gegevens al in de database hebben opgeslagen of wanneer we geen modeltraining nodig hebben), of sommige stappen kunnen meerdere keren worden herhaald (zoals gegevensverwerking).
## Digitalisering en digitale transformatie
In het afgelopen decennium begonnen veel bedrijven het belang van gegevens te begrijpen bij het nemen van zakelijke beslissingen. Om data science-principes toe te passen op het opereren van een bedrijf, moet men eerst wat gegevens verzamelen, d.w.z. bedrijfsprocessen vertalen naar digitale vorm. Dit staat bekend als **digitalisering**. Het toepassen van data science-technieken op deze gegevens om beslissingen te sturen, kan leiden tot aanzienlijke productiviteitsstijgingen (of zelfs zakelijke spil), **digitale transformatie** genoemd.
Laten we een voorbeeld nemen. Stel dat we een data science-cursus hebben (zoals deze) die we online aan studenten geven, en we willen data science gebruiken om het te verbeteren. Hoe kunnen we dat doen?
We kunnen beginnen met de vraag "Wat kan worden gedigitaliseerd?" De eenvoudigste manier zou zijn om de tijd te meten die elke student nodig heeft om elke module te voltooien en om de verkregen kennis te meten door aan het einde van elke module een meerkeuzetest te geven. Door het gemiddelde te nemen van de time-to-complete over alle studenten, kunnen we erachter komen welke modules de meeste problemen veroorzaken voor studenten en werken aan het vereenvoudigen ervan.
> Je zou kunnen stellen dat deze aanpak niet ideaal is, omdat modules van verschillende lengtes kunnen zijn. Het is waarschijnlijk eerlijker om de tijd te delen door de lengte van de module (in aantal tekens) en in plaats daarvan die waarden te vergelijken.
Wanneer we beginnen met het analyseren van resultaten van meerkeuzetoetsen, kunnen we proberen te bepalen welke concepten studenten moeilijk kunnen begrijpen en die informatie gebruiken om de inhoud te verbeteren. Om dat te doen, moeten we tests zo ontwerpen dat elke vraag is toegewezen aan een bepaald concept of een deel van de kennis.
Als we het nog ingewikkelder willen maken, kunnen we de tijd die voor elke module nodig is, uitzetten tegen de leeftijdscategorie van studenten. We kunnen erachter komen dat het voor sommige leeftijdscategorieën ongepast lang duurt om de module te voltooien, of dat studenten afhaken voordat ze het voltooien. Dit kan ons helpen leeftijdsaanbevelingen voor de module te geven en de ontevredenheid van mensen over verkeerde verwachtingen te minimaliseren.
## 🚀 Uitdaging
In deze challenge proberen we concepten te vinden die relevant zijn voor het vakgebied Data Science door te kijken naar teksten. We nemen een Wikipedia-artikel over Data Science, downloaden en verwerken de tekst en bouwen vervolgens een woordwolk zoals deze:
![Word Cloud for Data Science](../images/ds_wordcloud.png)
Ga naar ['notebook.ipynb'](notebook.ipynb) om de code door te lezen. Je kunt de code ook uitvoeren en zien hoe alle gegevenstransformaties in realtime worden uitgevoerd.
> Als je niet weet hoe je code in een Jupyter Notebook moet uitvoeren, kijk dan eens naar [dit artikel](https://soshnikov.com/education/how-to-execute-notebooks-from-github/).
## [Post-lecture quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/1)
## Opdrachten
* **Taak 1**: Wijzig de bovenstaande code om gerelateerde concepten te achterhalen voor de velden **Big Data** en **Machine Learning**
* **Taak 2**: [Denk na over Data Science-scenario's] (assignment.md)
## Credits
Deze les is geschreven met ♥️ door [Dmitry Soshnikov] (http://soshnikov.com)

@ -45,7 +45,7 @@ Já que dados são um conceito difundido, a ciência de dados em si também é u
<dl>
<dt>Banco de Dados</dt>
<dd>
A coisa mais óbvia a considerar é **como armazenar** os dados, ex. como estruturá-los de uma forma que permite um processamento rápido. Existem diferentes tipos de banco de dados que armazenam dados estruturados e não estruturados, que <a href="../../2-Working-With-Data/README.md">nós vamos considerar nesse curso</a>.
A coisa mais óbvia a considerar é **como armazenar** os dados, ex. como estruturá-los de uma forma que permite um processamento rápido. Existem diferentes tipos de banco de dados que armazenam dados estruturados e não estruturados, que <a href="../../../2-Working-With-Data/README.md">nós vamos considerar nesse curso</a>.
</dd>
<dt>Big Data</dt>
<dd>
@ -61,7 +61,7 @@ Como aprendizado de máquina, inteligência artificial também se baseia em dado
</dd>
<dt>Visualização</dt>
<dd>
Vastas quantidades de dados são incompreensíveis para o ser humano, mas uma vez que criamos visualizações úteis - nós podemos começar a dar muito mais sentido aos dados, e desenhar algumas conclusões. Portanto, é importante conhecer várias formas de visualizar informação - algo que vamos cobrir na <a href="../../3-Data-Visualization/README.md">Seção 3</a> do nosso curso. Áreas relacionadas também incluem **Infográficos**, e **Interação Humano-Computador** no geral.
Vastas quantidades de dados são incompreensíveis para o ser humano, mas uma vez que criamos visualizações úteis - nós podemos começar a dar muito mais sentido aos dados, e desenhar algumas conclusões. Portanto, é importante conhecer várias formas de visualizar informação - algo que vamos cobrir na <a href="../../../3-Data-Visualization/README.md">Seção 3</a> do nosso curso. Áreas relacionadas também incluem **Infográficos**, e **Interação Humano-Computador** no geral.
</dd>
</dl>

@ -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,31 @@
# 과제: 데이터 사이언스 시나리오
이 첫 번째 과제에서는 실제 프로세스 또는 여러 문제 영역의 문제에 대해 생각하고 데이터 사이언스 프로세스를 사용하여 이를 개선할 수 있는 방법에 대해 생각해 보도록 요청합니다. 다음에 대해 생각해 보십시오.
1. 어떤 데이터를 수집할 수 있습니까?
1. 어떻게 모을 것인가?
1. 데이터를 어떻게 저장하시겠습니까? 데이터가 얼마나 클 것 같습니까?
1. 이 데이터에서 얻을 수 있는 통찰력은 무엇입니까? 데이터를 기반으로 어떤 결정을 내릴 수 있습니까?
3가지 다른 문제/프로세스에 대해 생각하고 각 문제 영역에 대해 위의 각 요점을 설명하십시오.
다음은 생각을 시작할 수 있는 몇 가지 문제 영역과 문제입니다.
1. 학교에서 아이들의 교육 과정을 개선하기 위해 데이터를 어떻게 사용할 수 있습니까?
1. 대유행 기간 동안 예방 접종을 통제하기 위해 데이터를 어떻게 사용할 수 있습니까?
1. 직장에서 생산성을 유지하기 위해 데이터를 어떻게 사용할 수 있습니까?
## 지침
다음 표를 채우십시오(필요한 경우 제안된 문제 도메인을 자신의 도메인으로 대체).
| 문제 도메인 | 문제 | 수집할 데이터 | 데이터를 저장하는 방법 | 우리가 내릴 수 있는 통찰력/결정|
|----------------|---------|-----------------------|-----------------------|--------------------------------------|
| 교육 | | | | |
| 예방 접종 | | | | |
| 생산성 | | | | |
## 기준표
모범 | 충분 | 개선 필요
--- | --- | -- |
합리적인 데이터 소스, 데이터 저장 방법 및 모든 도메인 영역에 대한 가능한 결정/통찰력을 식별할 수 있습니다. | 솔루션의 일부 측면이 상세하지 않고, 데이터 저장이 논의되지 않고, 적어도 2개의 문제 영역이 설명되어 있습니다. | 데이터 솔루션의 일부만 설명되고 하나의 문제 영역만 고려됩니다.

@ -0,0 +1,263 @@
# 데이터 윤리 소개
| ![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../sketchnotes/02-Ethics.png) |
| :-----------------------------------------------------------------------------------------------: |
| 데이터 과학 윤리 - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
---
우리는 모두 데이터화된 세계(datafied world)에 살고 있는 데이터 시민(data citizens)입니다.
시장 동향에 따르면 2022년까지 3분의 1 규모의 대규모 조직이 온라인 [마켓플레이스 및 거래소](https://www.gartner.com/smarterwithgartner/gartner-top-10-trends-in-data-and-analytics-for-2020/)를 통해 데이터를 사고 팔 것입니다. **앱 개발자**로서 우리는 데이터를 기반으로 한 인사이트(data-driven insight)와 알고리즘 기반 자동화(algorithm-driven automation)를 일상적인 사용자 경험에 통합하는 것이 더 쉽고, 더 저렴하다는 것을 알게 될 것입니다. 그러나 AI가 보편화 됨에 따라, 그러한 알고리즘이 규모적으로 [무기화](https://www.youtube.com/watch?v=TQHs8SA1qpk)로 인한 잠재적 위험을 지니고 있음을 이해해야 합니다.
또한 트렌드에 따르면 우리가 2025년까지 [180 제타 바이트](https://www.statista.com/statistics/871513/worldwide-data-created/) 이상의 데이터를 생성하고 사용할 것을 알려줍니다. **데이터 과학자**로서, 이러한 트렌드는 개인 데이터에 대한 전례 없는 수준의 접근을 제공합니다. 이는 사용자의 행동 프로파일(behavioral profiles)을 구축하고, 우리가 선호하는 결과로 사용자를 유도하는 [자유 선택의 환상](https://www.datasciencecentral.com/profiles/blogs/the-illusion-of-choice)을 만들어내므로 의사결정 과정에 영향을 미칩니다.
데이터 윤리는 이제 데이터 과학 및 데이터 엔지니어링에 _필수적인 가드레일_ 이 되어 데이터 기반 작업으로 인한 잠재적 피해와 의도하지 않은 결과를 최소화하는 데 도움이 됩니다. [가트너(Gartner)의 AI 하이프사이클(Hype Cycle)](https://www.gartner.com/smarterwithgartner/2-megatrends-dominate-the-gartner-hype-cycle-for-artificial-intelligence-2020/)은 AI의 _민주화(democratization)__산업화(industrialization)_ 에 대한 더 큰 메가트렌드의 핵심 요인으로 디지털 윤리와 관련된 트렌드, 책임감 있는 AI(responsible AI), AI 거버넌스를 가리킵니다.
![가트너(Gartner)의 AI 하이프사이클(Hype Cycle) - 2020](https://images-cdn.newscred.com/Zz1mOWJhNzlkNDA2ZTMxMWViYjRiOGFiM2IyMjQ1YmMwZQ==)
이 강의에서는 핵심 개념 및 과제부터 사례 연구 및 거버넌스와 같은 응용 AI 개념에 이르기까지, 데이터와 AI를 사용하여 작업하는 팀과 조직에서 윤리 문화를 확립하는 데 도움이 되는 데이터 윤리의 멋진 영역을 살펴볼 것입니다.
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/2) 🎯
## 기본 정의
기본 용어를 이해하는 것부터 시작해보겠습니다.
윤리라는 단어는 _성격 또는 본성_ 을 의미하는 (그 어원은 "ethos"인) [그리스어 "ethikos"](https://en.wikipedia.org/wiki/Ethics)에서 유래했습니다.
**윤리**는 사회에서 우리의 행동을 지배하는 공유된 가치와 도덕적 원칙에 관한 것입니다. 윤리는 법에 근거한 것이 아니라
무엇이 "옳고 그른지"에 대해 널리 받아들여지는 규범에 근거합니다. 그러나 윤리적인 고려 사항은 규정 준수에 대한 더 많은 인센티브를 생성하는 기업 거버넌스 이니셔티브 및 정부 규정에 영향을 미칠 수 있습니다.
**데이터 윤리**는 "_데이터, 알고리즘, 그에 해당하는 실행(practice)_ 과 연관된 도덕적 문제를 측정하고 연구"하는 [윤리의 새로운 분과(branch)](https://royalsocietypublishing.org/doi/full/10.1098/rsta.2016.0360#sec-1)입니다. 여기서 **"데이터"** 는 생성, 기록, 큐레이션, 처리 보급, 공유 및 사용과 관련된 작업에 중점을 두고, **"알고리즘"** 은 AI, 에이전트, 머신러닝 및 로봇에 중점을 둡니다. **"실행(practice)"** 은 책임 있는 혁신, 프로그래밍, 해킹 및 윤리 강령과 같은 주제에 중점을 둡니다.
**응용 윤리**는 [도덕적 고려사항의 실제적인 적용](https://en.wikipedia.org/wiki/Applied_ethics)을 말합니다. 이는 _실제 행동, 제품 및 프로세스_ 의 맥락에서 윤리적 문제를 적극적으로 조사하고 우리가 정의한 윤리적 가치와 일치하도록 수정하는 조치를 취하는 과정입니다.
**윤리 문화**는 우리의 윤리 원칙과 관행이 다음과 같이 채택되도록 [_운영화_ 응용 윤리](https://hbr.org/2019/05/how-to-design-an-ethical-organization)에 관한 것입니다. 조직 전체에 걸쳐 일관되고 확장 가능한 방식. 성공적인 윤리 문화는 조직 전체의 윤리 원칙을 정의하고 준수를 위한 의미 있는 인센티브를 제공하며 조직의 모든 수준에서 바람직한 행동을 장려하고 증폭함으로써 윤리 규범을 강화합니다.
## 윤리적 개념
이 섹션에서는 데이터 윤리에 대한 **공유 가치**(원칙) 및 **윤리적 과제**(문제)와 같은 개념을 논의하고 이러한 개념을 이해하는 데 도움이 되는 **케이스 스터디**를 살펴볼 것입니다.
### 1. 윤리 원칙
모든 데이터 윤리에 대한 전략은 _윤리 원칙_-데이터 및 AI 프로젝트에서, 허용되는 행동을 설명하고 규정 준수 조치에 대해 설명하는 "공유된 가치"-이 무엇인지 정의하는 것으로부터 시작됩니다. 개인 또는 팀 단위로 정의할 수 있습니다. 그러나 대부분의 대규모 조직은 이런 _윤리적인 AI_ 의 Mission 선언문이나 프레임워크를 회사 차원에서 정의하고, 모든 팀에 일관되게 시행하므로 간략하게 정의합니다.
**예시:** 마이크로소프트의 [책임있는 AI](https://www.microsoft.com/en-us/ai/responsible-ai) Mission 선언문은 다음과 같습니다: _"우리는 사람을 최우선으로 하는 융리 원칙에 따라 AI 기반의 발전에 전념합니다."_ - 아래 프레임워크에서 6가지 윤리 원칙을 식별합니다.
![Microsoft의 책임있는 AI](https://docs.microsoft.com/en-gb/azure/cognitive-services/personalizer/media/ethics-and-responsible-use/ai-values-future-computed.png)
이러한 원칙을 간략하게 살펴보겠습니다. _투명성__책임성_ 은 다른 원칙들의 기반이 되는 기본적인 가치입니다. 여기에서부터 시작하겠습니다.
* [**책임**](https://www.microsoft.com/en-us/ai/responsible-ai?activetab=pivot1:primaryr6)은 실무자가 데이터 및 AI 운영과 이러한 윤리적 원칙 준수에 대해 _책임_ 을 지도록 합니다.
* [**투명성**](https://www.microsoft.com/en-us/ai/responsible-ai?activetab=pivot1:primaryr6)은 데이터 및 AI 작업이 사용자에게 _이해 가능_(해석 가능)하도록 보장하여 결정의 배경과 이유를 설명합니다.
* [**공평성**](https://www.microsoft.com/en-us/ai/responsible-ai?activetab=pivot1%3aprimaryr6) - AI가 _모든 사람_ 을 공정하게 대하도록 하는 데 중점을 두고, 데이터 및 시스템의 모든 시스템적 또는 암묵적 사회∙기술적 편견을 해결합니다.
* [**신뢰성 & 안전**](https://www.microsoft.com/en-us/ai/responsible-ai?activetab=pivot1:primaryr6)은 AI가 정의된 값으로 _일관되게_ 동작하도록 하여 잠재적인 피해나 의도하지 않은 결과를 최소화합니다.
* [**프라이버시 & 보안**](https://www.microsoft.com/en-us/ai/responsible-ai?activetab=pivot1:primaryr6)는 데이터 계보(Data Lineage)를 이해하고, 사용자에게 _데이터 개인 정보 보호 및 관련 보호 기능_ 을 제공하는 것입니다.
* [**포용**](https://www.microsoft.com/en-us/ai/responsible-ai?activetab=pivot1:primaryr6)은 AI 솔루션을 의도적으로 설계하고 _광범위한 인간의 요구_ 와 기능을 충족하도록 조정하는 것 입니다.
> 🚨 데이터 윤리 Mission 선언문이 무엇인지 생각해보십시오. 다른 조직의 윤리적 AI 프레임워크를 탐색해보세요. - 다음과 같은 예시가 있습니다. [IBM](https://www.ibm.com/cloud/learn/ai-ethics), [Google](https://ai.google/principles) ,and [Facebook](https://ai.facebook.com/blog/facebooks-five-pillars-of-responsible-ai/). 이들의 공통점은 무엇입니까? 이러한 원칙은 그들이 운영하는 AI 제품 또는 산업과 어떤 관련이 있습니까?
### 2. 윤리적 과제
윤리적 원칙이 정의되면 다음 단계는 데이터와 AI 작업을 평가하여 이러한 공유 가치와 일치하는지 확인하는 것입니다. _데이터 수집__알고리즘 디자인_, 이 두 가지 범주에서 당신의 행동(Action)을 생각해 보십시오.
데이터 수집을 통해, 그 행동에는 식별 가능한(idenitifiable) 살아있는 개인에 대한 **개인 데이터** 또는 개인 식별 정보(PII, Personally Identifiable Information)이 포함될 수 있습니다. 여기에는 종합적으로 개인을 식별할 수 있는 [비개인 데이터의 다양한 항목](https://ec.europa.eu/info/law/law-topic/data-protection/reform/what-personal-data_en)도 포함됩니다. 윤리적인 문제는 _데이터 프라이버시(개인 정보 보호)_, _데이터 소유권(ownership)_, 그리고 사용자의 _정보 제공 동의__지적 재산권_ 과 같은 관련된 주제와 연관될 수 있습니다.
알고리즘 설계(design)을 사용하면, **데이터 셋**을 수집 및 선별란 다음 이를 사용하여 결과를 예측하거나 실제 상황에서 의사결정을 자동화하는 **데이터 모델**을 교육 및 배포하는 작업이 포함됩니다. 윤리적인 문제는 본질적으로 시스템적인 일부 문제를 포함하여 알고리즘의 _데이터 셋 편향_, _데이터 품질_ 문제, _불공정__잘못된 표현_ 으로 인해 발생할 수 있습니다.
두 경우 모두 윤리 문제는 우리의 행동이 공유 가치와 충돌할 수 있는 영역을 강조합니다. 이러한 우려를 감지, 완화, 최소화 또는 제거하려면 우리의 행동과 관련된 도덕적 "예/아니오" 질문을 하고 필요에 따라 수정 조치를 취하십시오. 몇 가지 윤리적 챌린지와 그것이 제기하는 도덕적 질문을 살펴보겠습니다.
#### 2.1 데이터 소유권
데이터 수집에는 종종 데이터 주체를 식별할 수 있는 개인 데이터가 포함됩니다. [데이터 소유권](https://permission.io/blog/data-ownership)은 데이터의 생성, 처리 및 보급과 관련된 _제어(control)_ 와 [_사용자 권한_](https://permission.io/blog/data-ownership)에 관한 것입니다.
우리가 물어야 할 도덕적 질문은 다음과 같습니다.:
* 누가 데이터를 소유합니까? (사용자 또는 조직)
* 데이터 주체(data subjects)는 어떤 권리를 가지고 있나요? (예: 접근, 삭제, 이동성)
* 조직은 어떤 권리를 가지고 있습니까? (예: 악의적인 사용자 리뷰 수정)
#### 2.2 정보 제공 동의
[정보 제공 동의](https://legaldictionary.net/informed-consent/)는 목적, 잠재적 위험 및 대안을 포함한 관련 사실을 _완전히 이해_ 한 사용자가 데이터 수집과 같은 조치에 동의하는 행위를 말합니다.
여기에서 탐색할 질문은 다음과 같습니다.:
* 사용자(데이터 주체)가 데이터 캡처 및 사용에 대한 권한을 부여했습니까?
* 사용자가 해당 데이터가 수집된 목적을 이해했습니까?
* 사용자가 참여로 인한 잠재적 위험을 이해했습니까?
#### 2.3 지적 재산권
[지적 재산권](https://en.wikipedia.org/wiki/Intellectual_property)은 인간의 주도(human initiative)로 인해 생긴 개인이나 기업에 _경제적 가치가 있을 수 있는_ 무형의 창조물을 말합니다.
여기에서 탐색할 질문은 다음과 같습니다:
* 수집된 데이터가 사용자나 비즈니스에 경제적 가치가 있었습니까?
* **사용자**가 여기에 지적 재산권을 가지고 있습니까?
* **조직**에 지적 재산권이 있습니까?
* 이러한 권리가 존재한다면, 어떻게 보호가 됩니까?
#### 2.4 데이터 프라이버시
[데이터 프라이버시](https://www.northeastern.edu/graduate/blog/what-is-data-privacy/) 또는 정보 프라이버시는 개인 식별 정보에 대한 사용자 개인 정보 보호 및 사용자 신원 보호를 의미합니다.
여기서 살펴볼 질문은 다음과 같습니다:
* 사용자(개인) 데이터는 해킹 및 유출로부터 안전하게 보호되고 있습니까?
* 승인된 사용자 및 컨텍스트만 사용자 데이터에 액세스할 수 있습니까?
* 데이터를 공유하거나 유포할 때 사용자의 익명성이 유지됩니까?
* 익명화된 데이터 세트에서 사용자를 익명화할 수 있습니까?
#### 2.5 잊혀질 권리
[잊혀질 권리](https://en.wikipedia.org/wiki/Right_to_be_forgotten) 또는 [삭제할 권리](https://www.gdpreu.org/right-to-be-forgotten/)는 사용자에 대한 추가적인 개인 데이터 보호를 제공합니다. 특히, 사용자에게 _특정 상황에서_ 인터넷 검색 및 기타 위치에서 개인 데이터 삭제 또는 제거를 요청할 수 있는 권리를 부여하여, 사용자가 과거 조치(action)를 취하지 않고 온라인에서 새로운 출발을 할 수 있게 합니다.
여기서는 다음 질문들을 살펴볼 것입니다:
* 시스템에서 데이터 주체(Data Subject)가 삭제를 요청할 수 있습니까?
* 사용자 동의 철회 시 자동으로 데이터를 삭제해야 하나요?
* 데이터가 동의 없이 또는 불법적인 방법으로 수집되었나요?
* 우리는 데이터 개인 정보 보호에 대한 정부 규정을 준수합니까?
#### 2.6 데이터셋 편향(Bias)
데이터셋 또는 [데이터 콜렉션 편향](http://researcharticles.com/index.php/bias-in-data-collection-in-research/)은 알고리즘 개발을 위해 _대표적이지 않은(non-representative)_ 데이터 하위 집합을 선택하여, 다양한 그룹의 결과에서 잠재적인 불공정이 발생하는 것에 관한 것입니다. 편향의 유형에는 선택 또는 샘플링 편향, 자원자 편향, 도구 편향이 있습니다.
여기서는 다음 질문들을 살펴볼 것입니다:
* 데이터 주체의 대표적인 데이터들을 모집했는가?
* 다양한 편향에 대해 수집되거나 선별된 데이터 셋을 테스트 했습니까?
* 발견된 편향을 완화하거나 제거할 수 있습니까?
#### 2.7 데이터 품질
[데이터 품질](https://lakefs.io/data-quality-testing/)은 알고리즘을 개발하는 데 사용된 선별된 데이터 셋의 유효성을 살펴보고, 기능과 레코드가 우리의 AI 목적에 필요한 정확성 및 일관성 수준에 대한 요구사항을 충족하는 지 확인합니다.
여기서는 다음 질문들을 살펴볼 것입니다:
* 유스케이스(use case)에 대한 유효한 _기능_ 을 캡처했습니까?
* 다양한 데이터 소스에서 데이터가 _일관되게_ 캡처되었습니까?
* 데이터셋은 다양한 조건 또는 시나리오에 대해 _완전_ 합니까?
* 포착된 정보가 현실을 _정확하게_ 반영합니까?
#### 2.8 알고리즘 공정성
[알고리즘 공정성](https://towardsdatascience.com/what-is-algorithm-fairness-3182e161cf9f)은, _할당(해당 그룹에서 리소스가 거부되거나 보류되는 경우)__서비스 품질(일부 하위 그룹의 경우 AI가 다른 그룹의 경우만큼 정확하지 않음)_ 에서, 알고리즘 설계가 [잠재적인 피해](https://docs.microsoft.com/en-us/azure/machine-learning/concept-fairness-ml)로 이어지는 데이터 주체의 특정 하위 그룹을 체계적으로 구별하는지 확인합니다.
여기서는 다음 질문들을 살펴볼 것입니다:
* 다양한 하위 그룹 및 조건에 대해 모델 정확도를 평가했습니까?
* 잠재적인 피해(예: 고정 관념)에 대해 시스템을 면밀히 조사했습니까?
* 식별된 피해를 완화하기 위해 데이터를 수정하거나 모델을 다시 학습시킬 수 있습니까?
더 알아보고 싶다면, 다음 자료를 살펴보세요: [AI 공정성 체크리스트](https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RE4t6dA)
#### 2.9 와전(Misrepresentation)
[데이터 와전(Misrepresentation)](https://www.sciencedirect.com/topics/computer-science/misrepresentation)은 정직하게 보고된 데이터의 통찰력을, 원하는 내러티브(Narrative)에 맞춰 기만적인 방식으로 전달하고 있는지 묻는 것입니다.
여기서는 다음 질문들을 살펴볼 것입니다:
* 불완전하거나 부정확한 데이터를 보고하고 있습니까?
* 오해의 소지가 있는 결론을 도출하는 방식으로 데이터를 시각화하고 있습니까?
* 결과를 조작하기 위해 선택적 통계 기법을 사용하고 있습니까?
* 다른 결론을 제시할 수 있는 대안적인 설명이 있습니까?
#### 2.10 자유로운 선택
[자유롭게 선택하고 있다는 환상](https://www.datasciencecentral.com/profiles/blogs/the-illusion-of-choice)은 시스템 '선택 아키텍처'가 의사결정 알고리즘을 사용하여 사람들에게 선택권과 통제권을 주는 것처럼 하면서 시스템이 선호하는 결과를 선택하도록 유도할 때 발생합니다. 이런 [다크 패턴(dark pattern)](https://www.darkpatterns.org/)은 사용자에게 사회적, 경제적 피해를 줄 수 있습니다. 사용자 결정은 행동 프로파일에 영향을 미치기 때문에, 이러한 행동은 잠재적으로 이러한 피해의 영향을 증폭하거나 확장할 수 있는 향후의 선택을 유도합니다.
여기서는 다음 질문들을 살펴볼 것입니다:
* 사용자는 그 선택의 의미를 이해했습니까?
* 사용자는 (대안이 되는) 선택과 각각의 장단점을 알고 있습니까?
* 사용자가 나중에 자동화되거나 영향을 받은 선택을 되돌릴 수 있습니까?
### 3. 케이스 스터디
이러한 윤리적 문제를 실제 상황에 적용하려면, 그러한 윤리 위반이 간과 되었을 때 개인과 사회에 미칠 잠재적인 피해와 결과를 강조하는 케이스 스터디를 살펴보는 것이 도움이 됩니다.
다음은 몇 가지 예입니다.
| 윤리적 과제 | Case Study |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **통보 동의** | 1972 - [Tuskegee 매독 연구](https://en.wikipedia.org/wiki/Tuskegee_Syphilis_Study) - 피험자로 연구에 참여한 아프리카계 미국인 남성은 피험자에게 진단이나 정보를 알려주지 않은 연구원들에게 무료 의료 서비스를 약속받았지만, 약속은 지켜지지 않았다. 많은 피험자가 사망하고 배우자와 자녀들이 영향을 받았습니다. 연구는 40년 동안 지속되었습니다. |
| **데이터 프라이버시(Privacy)** | 2007 - [넷플릭스 Data Prize](https://www.wired.com/2007/12/why-anonymous-data-sometimes-isnt/) 는 추천 알고리즘을 개선하기 위해 연구원들에게 _5만명 고객으로부터 수집한 1천만개의 비식별화된(anonymized) 영화 순위_를 제공했습니다. 그러나 연구원들은 비식별화된(anonymized) 데이터를 _외부 데이터셋_ (예를 들어, IMDb 댓글)에 있는 개인식별 데이터(personally-identifiable data)와 연관시킴으로, 효과적으로 일부 Netflix 가입자를 '비익명화(de-anonymizing)' 할 수 있었습니다. |
| **편향 수집** | 2013 - 보스턴 시는 시민들이 움푹 들어간 곳을 보고할 수 있는 앱인 [Street Bump](https://www.boston.gov/transportation/street-bump)를 개발하여 시에서 문제를 찾고 수정할 수 있는 더 나은 도로 데이터를 제공합니다. 그러나 [저소득층의 사람들은 자동차와 전화에 대한 접근성이 낮기 때문에](https://hbr.org/2013/04/the-hidden-biases-in-big-data) 이 앱에서 도로 문제를 볼 수 없었습니다. 개발자들은 학계와 협력하여 공정성을 위한 _공평한 접근 및 디지털 격차_ 문제를 해결했습니다. |
| **알고리즘 공정성** | 2018 - MIT [성별 유색인종 연구](http://gendershades.org/overview.html)에서 성별 분류 AI 제품의 정확도를 평가하여 여성과 유색인의 정확도 격차를 드러냈습니다. [2019년도 Apple Card](https://www.wired.com/story/the-apple-card-didnt-see-genderand-thats-the-problem/)는 남성보다 여성에게 신용을 덜 제공하는 것으로 보입니다. 둘 다 사회 경제적 피해로 이어지는 알고리즘 편향의 문제를 나타냅니다. |
| **데이터 허위 진술** | 2020년 - [조지아 보건부 코로나19 차트 발표](https://www.vox.com/covid-19-coronavirus-us-response-trump/2020/5/18/21262265/georgia-covid- 19건-거절-재개)의 x축이 시간순이 아닌 순서로 표시된 확인된 사례의 추세에 대해 시민들을 잘못된 방향으로 이끄는 것으로 나타났습니다. 이 발표 시각화 트릭을 통해 잘못된 표현을 나타냈습니다. |
| **자유 선택의 환상** | 2020 - 학습 앱인 [ABCmouse는 부모들이 취소할 수 없는 구독료에 빠지게 되는 FTC 불만 해결을 위해 1천만 달러 지불](https://www.washingtonpost.com/business/2020/09/04/abcmouse-10-million-ftc-settlement/) 했습니다. 이는 사용자가 잠재적으로 해로운 선택을 하도록 유도하는 선택 아키텍처의 어두운 패턴을 보여줍니다. |
| **데이터 개인정보 보호 및 사용자 권한** | 2021 - Facebook 의 [데이터 침해](https://www.npr.org/2021/04/09/986005820/after-data-breach-exposes-530-million-facebook-says-it-will-not-notify- 사용자) 는 5억 3천만 명의 사용자의 데이터를 노출하여 FTC에 50억 달러의 합의금을 냈습니다. 그러나 데이터 투명성 및 액세스에 대한 사용자 권한을 위반하는 위반 사항을 사용자에게 알리는 것을 거부했습니다. |
더 많은 사례 연구를 살펴보고 싶으십니까? 다음 리소스를 확인하세요.:
* [윤리를 풀다(ethic unwrapped)](https://ethicsunwrapped.utexas.edu/case-studies) - 다양한 산업 분야의 윤리 딜레마
* [데이터 과학 윤리 과정](https://www.coursera.org/learn/data-science-ethics#syllabus) - 획기적인 사례 연구 탐구
* [문제가 발생한 곳](https://deon.drivendata.org/examples/) - 사례와 함께 살펴보는 데온(deon)의 체크리스트
> 🚨 당신이 본 사례 연구에 대해 생각해보십시오. 당신은 당신의 삶에서 유사한 윤리적 도전을 경험했거나 영향을 받은 적이 있습니까? 이 섹션에서 논의한 윤리적 문제 중 하나에 대한 다른 사례 연구를 하나 이상 생각할 수 있습니까?
## 응용 윤리(Applied Ethics)
우리는 실제 상황에서 윤리 개념, 도전 과제 및 사례 연구에 대해 이야기했습니다. 그러나 프로젝트에서 윤리적 원칙과 관행을 _적용_ 하기 시작하려면 어떻게 해야 합니까? 그리고 더 나은 거버넌스를 위해 이러한 관행을 어떻게 _운영_ 할 수 있습니까? 몇 가지 실제 솔루션을 살펴보겠습니다:
### 1. 전문 코드(Professional Codes)
전문 강령(Professional Codes)은 조직이 구성원의 윤리 원칙과 사명 선언문을 지지하도록 "인센티브"를 제공하는 하나의 옵션을 제공합니다. 강령은 직원이나 구성원이 조직의 원칙에 부합하는 결정을 내리는 데 도움이 되는 직업적 행동에 대한 _도덕적 지침_ 입니다. 이는 회원들의 자발적인 준수에 달려 있습니다. 그러나 많은 조직에서 구성원의 규정 준수를 유도하기 위해 추가 보상과 처벌을 제공합니다.
다음과 같은 사례가 있습니다:
* [Oxford Munich](http://www.code-of-ethics.org/code-of-conduct/) 윤리강령
* [데이터 과학 협회](http://datascienceassn.org/code-of-conduct.html) 행동강령 (2013년 제정)
* [ACM 윤리 및 직업 행동 강령](https://www.acm.org/code-of-ethics) (1993년 이후)
> 🚨 전문 엔지니어링 또는 데이터 과학 조직에 속해 있습니까? 그들의 사이트를 탐색하여 그들이 직업적 윤리 강령을 정의하는지 확인하십시오. 이것은 그들의 윤리적 원칙에 대해 무엇을 말합니까? 구성원들이 코드를 따르도록 "인센티브"를 제공하는 방법은 무엇입니까?
### 2. 윤리 체크리스트
전문 강령은 실무자에게 필요한 _윤리적 행동_ 을 정의하지만 특히 대규모 프로젝트 시행에서 [자주 사용되는 제한 사항이 있습니다](https://resources.oreilly.com/examples/0636920203964/blob/master/of_oaths_and_checklists.md). 이로 인해 많은 데이터 과학 전문가들이 [체크리스트를 따름으로](https://resources.oreilly.com/examples/0636920203964/blob/master/of_oaths_and_checklists.md) 보다 결정적이고 실행 가능한 방식으로 **원칙과 사례를 연결** 할 수 있습니다.
체크리스트는 질문을 운영 가능한 "예/아니오" 작업으로 변환하여 표준 제품 릴리스 워크플로의 일부로 추적할 수 있도록 합니다.
다음과 같은 사례가 있습니다:
* [Deon](https://deon.drivendata.org/) - 쉬운 통합을 위한 Command Line Tool 형태의 범용적인 윤리 체크리스트 ([업계 권고사항](https://deon.drivedata.org/#checklist-citations)에서 만들어짐)
* [개인정보 감사 체크리스트](https://cyber.harvard.edu/ecommerce/privacyaudit.html) - 법적 및 사회적 노출 관점에서 정보 처리 관행에 대한 일반적인 지침을 제공합니다.
* [AI 공정성 체크리스트](https://www.microsoft.com/en-us/research/project/ai-fairness-checklist/) - 공정성 검사의 채택 및 AI 개발 주기 통합을 지원하기 위해 AI 실무자가 작성.
* [데이터 및 AI의 윤리에 대한 22가지 질문](https://medium.com/the-organization/22-questions-for-ethics-in-data-and-ai-efb68fd19429) - 디자인, 구현 및 조직적 맥락에서 윤리적 문제의 초기 탐색을 위한, 보다 개방적인 프레임워크, 구조화.
### 3. 윤리 규정
윤리는 공유 가치를 정의하고 옳은 일을 _자발적으로_ 하는 것입니다. **규정 준수**는 정의된 경우 _법률 준수_ 에 관한 것입니다. **거버넌스**는 조직이 윤리 원칙을 시행하고 확립된 법률을 준수하기 위해 운영하는 모든 방식을 광범위하게 포함합니다.
오늘날 거버넌스는 조직 내에서 두 가지 형태를 취합니다. 첫째, **윤리적 AI** 원칙을 정의하고 조직의 모든 AI 관련 프로젝트에서 채택을 운영하기 위한 관행을 수립하는 것입니다. 둘째, 사업을 영위하는 지역에 대해 정부에서 의무화한 모든 **데이터 보호 규정**을 준수하는 것입니다.
데이터 보호 및 개인 정보 보호 규정 사례:
* `1974`, [미국 개인 정보 보호법](https://www.justice.gov/opcl/privacy-act-1974) - _연방 정부_ 의 개인 정보 수집, 사용 및 공개를 규제합니다.
* `1996`, [미국 HIPAA(Health Insurance Portability & Accountability Act)](https://www.cdc.gov/phlp/publications/topic/hipaa.html) - 개인 건강 데이터를 보호합니다.
* `1998`, [미국 아동 온라인 개인정보 보호법(COPPA)](https://www.ftc.gov/enforcement/rules/rulemaking-regulatory-reform-proceedings/childrens-online-privacy-protection-rule) - 13세 미만 어린이의 데이터 프라이버시를 보호합니다.
* `2018`, [GDPR(일반 데이터 보호 규정)](https://gdpr-info.eu/) - 사용자 권한, 데이터 보호 및 개인 정보 보호를 제공합니다.
* `2018`, [캘리포니아 소비자 개인정보 보호법(CCPA)](https://www.oag.ca.gov/privacy/ccpa) 소비자에게 자신의 (개인) 데이터에 대해 더 많은 _권리_ 를 부여합니다.
* `2021`, 중국의 [개인정보보호법](https://www.reuters.com/world/china/china-passes-new-personal-data-privacy-law-take-effect-nov-1-2021-08-20/) 막 통과되어 전 세계적으로 가장 강력한 온라인 데이터 개인 정보 보호 규정 중 하나를 만들었습니다.
> 🚨 유럽 연합에서 정의한 GDPR(일반 데이터 보호 규정)은 오늘날 가장 영향력 있는 데이터 개인 정보 보호 규정 중 하나입니다. 시민의 디지털 프라이버시와 개인 데이터를 보호하기 위헌 [8가지 사용자 권한](https://www.freeprivacypolicy.com/blog/8-user-rights-gdpr)도 정의하고 있다는 사실을 알고 계셨습니까? 이것이 무엇이며 왜 중요한지 알아보십시오.
### 4. 윤리 문화
_준수_ ("법규"를 충족하기 위해 충분히 노력함)와 (골화, 정보 비대칭 및 분배 불공정과 같은) AI의 무기화를 가속화할 수 있는 [시스템 문제](https://www.coursera.org/learn/data-science-ethics/home/week) 해결 사이에는 무형의 격차가 있습니다.
후자는 산업에서 _조직 전체적으로_ 정서적 연결과 일관된 공유 가치를 구축하는 [윤리 문화를 정의하기 위한 협력적 접근 방식](https://towardsdatascience.com/why-ai-ethics-requires-a-culture-driven-approach-26f451afa29f)이 필요합니다. 이것은 조직에서 더 많은 [공식화된 데이터 윤리 문화](https://www.codeforamerica.org/news/formalizing-an-ethical-data-culture/)를 요구합니다. 이런 문화는 _누구나_ (프로세스 초기에 윤리 문제 제기를 위해) [Andon 강령을 사용하고](https://en.wikipedia.org/wiki/Andon_(manufacturing)) _윤리적 평가_ (예: 고용 시)를 AI 프로젝트의 핵심 기준 팀 구성으로 만듭니다.
---
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/3) 🎯
## 복습 & 독학
과정과 책은 핵심 윤리 개념과 과제를 이해하는 데 도움이 되며, Case Study와 도구는 실제 상황에서 윤리 사항들을 적용하는 데 도움이 됩니다. 다음은 시작을 할 때 도움이 되는 몇가지 자료들입니다.
* [초보자를 위한 기계 학습](https://github.com/microsoft/ML-For-Beginners/blob/main/1-Introduction/3-fairness/README.md) - 공정성(fairness)에 대한 강의, from Microsoft.
* [책임있는 AI 원칙](https://docs.microsoft.com/en-us/learn/modules/responsible-ai-principles/) - 무료 학습 경로, from Microsoft Learn.
* [윤리와 데이터 과학](https://resources.oreilly.com/examples/0636920203964) - O'Reilly EBook (M. Loukides, H. Mason et. al)
* [데이터 과학 윤리](https://www.coursera.org/learn/data-science-ethics#syllabus) - 미시간 대학의 온라인 학습 과정.
* [Ethics Unwrapped](https://ethicsunwrapped.utexas.edu/case-studies) - 텍사스 대의 Case Study.
# 과제
[데이터 윤리 Case Study 작성](./assignment.ko.md)

@ -0,0 +1,21 @@
## 데이터 윤리 사례 연구 작성
## 지침
다양한 [데이터 윤리 과제](README?id=_2-ethics-challenges)에 대해 배웠고 실제 컨텍스트의 데이터 윤리 과제를 반영하는 [사례 연구](README?id=_3-case-studies)의 몇 가지 예를 보았습니다.
이 과제에서는 자신의 경험이나 친숙한 관련 실제 상황에서 데이터 윤리 문제를 반영하는 사례 연구를 작성합니다. 다음 단계를 따르세요.
1. `데이터 윤리 과제 선택`. [수업 예시](README?id=_2-ethics-challenges)를 보거나 [Deon 체크리스트](https://deon.drivedata.org/examples/)와 같은 온라인 예시를 탐색하여 영감을 얻으십시오.
2. `실제 사례 설명`. 이러한 특정 문제가 발생한 상황(헤드라인, 연구 연구 등) 또는 경험했던(지역 커뮤니티) 상황에 대해 생각해 보십시오. 문제와 관련된 데이터 윤리 질문에 대해 생각하고 이 문제로 인해 발생하는 잠재적인 피해 또는 의도하지 않은 결과에 대해 논의합니다. 보너스 포인트: 이 문제의 부정적인 영향을 제거하거나 완화하기 위해 여기에 적용될 수 있는 잠재적 솔루션 또는 프로세스에 대해 생각하십시오.
3. `관련 자료 목록 제공`. 하나 이상의 리소스(기사 링크, 개인 블로그 게시물 또는 이미지, 온라인 연구 논문 등)를 공유하여 이것이 실제 발생했음을 증명합니다. 보너스 포인트: 사고로 인한 잠재적 피해 및 결과를 보여주는 리소스를 공유하거나 재발을 방지하기 위해 취한 긍정적인 조치를 강조합니다.
## 기준표
모범 | 충분 | 개선 필요
--- | --- | -- |
하나 이상의 데이터 윤리 문제가 식별됩니다. <br/> <br/> 사례 연구는 그 도전을 반영하는 실제 사건을 명확하게 설명하고 그로 인해 야기된 바람직하지 않은 결과 또는 피해를 강조합니다. <br/><br/> 이 문제가 발생했음을 증명하는 연결된 리소스가 하나 이상 있습니다. | 하나의 데이터 윤리 과제가 식별됩니다. <br/><br/> 적어도 하나의 관련 피해 또는 결과가 간략하게 논의됩니다. <br/><br/> 그러나 논의가 제한적이거나 실제 발생에 대한 증거가 부족합니다. | 데이터 챌린지가 식별됩니다. <br/><br/> 그러나 설명이나 리소스가 문제를 적절하게 반영하지 않거나 실제 상황임을 증명하지 못합니다. |

@ -25,14 +25,14 @@ A benefit of structured data is that it can be organized in such a way that it c
Examples of structured data: spreadsheets, relational databases, phone numbers, bank statements
### Unstructured Data
Unstructured data typically cannot be categorized into into rows or columns and doesn't contain a format or set of rules to follow. Because unstructured data has less restrictions on its structure it's easier to add new information in comparison to a structured dataset. If a sensor capturing data on barometric pressure every 2 minutes has received an update that now allows it to measure and record temperature, it doesn't require altering the existing data if it's unstructured. However, this may make analyzing or investigating this type of data take longer. For example, a scientist who wants to find the average temperature of the previous month from the sensors data, but discovers that the sensor recorded an "e" in some of its recorded data to note that it was broken instead of a typical number, which means the data is incomplete.
Unstructured data typically cannot be categorized into rows or columns and doesn't contain a format or set of rules to follow. Because unstructured data has less restrictions on its structure it's easier to add new information in comparison to a structured dataset. If a sensor capturing data on barometric pressure every 2 minutes has received an update that now allows it to measure and record temperature, it doesn't require altering the existing data if it's unstructured. However, this may make analyzing or investigating this type of data take longer. For example, a scientist who wants to find the average temperature of the previous month from the sensors data, but discovers that the sensor recorded an "e" in some of its recorded data to note that it was broken instead of a typical number, which means the data is incomplete.
Examples of unstructured data: text files, text messages, video files
### Semi-structured
Semi-structured data has features that make it a combination of structured and unstructured data. It doesn't typically conform to a format of rows and columns but is organized in a way that is considered structured and may follow a fixed format or set of rules. The structure will vary between sources, such as a well defined hierarchy to something more flexible that allows for easy integration of new information. Metadata are indicators that help decide how the data is organized and stored and will have various names, based on the type of data. Some common names for metadata are tags, elements, entities and attributes. For example, a typical email message will have a subject, body and a set of recipients and can be organized by whom or when it was sent.
Examples of unstructured data: HTML, CSV files, JavaScript Object Notation (JSON)
Examples of semi-structured data: HTML, CSV files, JavaScript Object Notation (JSON)
## Sources of Data

@ -0,0 +1,69 @@
# 데이터 정의
|![ [(@sketchthedocs)의 스케치노트](https://sketchthedocs.dev) ](../../../sketchnotes/03-DefiningData.png)|
|:---:|
|데이터 정의 - _Sketchnote 작성자 [@nitya](https://twitter.com/nitya)_ |
데이터는 발견을 하고 정보에 입각한 결정을 지원하는 데 사용되는 사실, 정보, 관찰 및 측정입니다. 데이터 포인트는 데이터 포인트의 모음인 데이터셋(Data Set)에 있는 단일 데이터 단위입니다. 데이터셋은 다양한 형식과 구조로 제공될 수 있으며 일반적으로 소스 또는 데이터의 출처를 기반으로 합니다. 예를 들어 회사의 월별 수입은 스프레드시트에 있지만 스마트워치의 시간당 심박수 데이터는 [JSON](https://stackoverflow.com/a/383699) 형식일 수 있습니다. 데이터 과학자는 데이터셋 내에서 다양한 유형의 데이터로 작업하는 것이 일반적입니다.
이 단원에서는 데이터의 특성과 소스를 기준으로 데이터를 식별하고 분류하는 데 중점을 둡니다.
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/4)
## 데이터 설명 방법
**원시 데이터**는 초기 상태의 소스에서 가져온, 분석이나 구조화되지 않은 데이터입니다. 데이터셋에서 무슨 일이 일어나고 있는지 이해하기 위해서는 데이터셋를 인간이 이해할 수 있는 형식과 추가 분석에 사용할 수 있는 기술로 구성해야 합니다. 데이터셋의 구조는 구성 방법을 설명하고 구조화, 비구조화 및 반구조화로 분류할 수 있습니다. 이러한 유형의 구조는 출처에 따라 다르지만 궁극적으로 이 세 가지 범주에 맞습니다.
### 정량적 데이터
정량적 데이터는 데이터셋 내의 수치적 관찰이며 일반적으로 수학적인 분석, 측정 및 사용할 수 있습니다. 정량적 데이터의 몇 가지 예는 다음과 같습니다: 국가의 인구, 개인의 키 또는 회사의 분기별 수입. 몇 가지 추가 분석을 통해 정량적 데이터에서 AQI(대기 질 지수)의 계절적 추세를 발견하거나 일반적인 근무일의 러시아워 교통량 확률을 추정할 수 있습니다.
### 정성 데이터
범주형 데이터라고도 하는 정성적 데이터는 정량적 데이터의 관찰과 같이 객관적으로 측정할 수 없는 데이터입니다. 일반적으로 제품이나 프로세스와 같은 무언가의 품질을 나타내는 주관적 데이터의 다양한 형식입니다. 경우에 따라 정성적 데이터는 숫자이며 일반적으로 전화번호나 타임스탬프와 같이 수학적으로 사용되지 않습니다. 정성적 데이터의 몇 가지 예는 다음과 같습니다: 비디오 댓글, 자동차 제조사 및 모델 또는 가장 친한 친구가 가장 좋아하는 색상. 정성적 데이터는 소비자가 가장 좋아하는 제품을 이해하거나 입사 지원 이력서에서 인기 있는 키워드를 식별하는 데 사용할 수 있습니다.
### 구조화된 데이터
구조화된 데이터는 행과 열로 구성된 데이터로, 각 행에는 동일한 열 집합이 있습니다. 열은 특정 유형의 값을 나타내며 값이 나타내는 것을 설명하는 이름으로 식별되는 반면 행에는 실제 값이 포함됩니다. 열에는 값이 열을 정확하게 나타내도록 하기 위해 값에 대한 특정 규칙 또는 제한 사항이 있는 경우가 많습니다. 예를 들어, 각 행에 전화번호가 있어야 하고 전화번호에는 알파벳 문자가 포함되지 않는 고객 스프레드시트를 상상해 보십시오. 전화번호 열이 비어 있지 않고 숫자만 포함되도록 하는 규칙이 적용될 수 있습니다.
구조화된 데이터의 이점은 다른 구조화된 데이터와 관련될 수 있는 방식으로 구성될 수 있다는 것입니다. 그러나 데이터가 특정 방식으로 구성되도록 설계되었기 때문에 전체 구조를 변경하려면 많은 노력이 필요할 수 있습니다. 예를 들어 비워둘 수 없는 이메일 열을 고객 스프레드시트에 추가한다는 것은 이러한 값을 데이터세트의 기존 고객 행에 추가하는 방법을 파악해야 함을 의미합니다.
구조화된 데이터의 예: 스프레드시트, 관계형 데이터베이스, 전화번호, 은행 거래 내역
### 비정형 데이터
비정형 데이터는 일반적으로 행이나 열로 분류할 수 없으며 따라야 할 형식이나 규칙 집합을 포함하지 않습니다. 구조화되지 않은 데이터는 구조에 대한 제한이 적기 때문에 구조화된 데이터세트에 비해 새로운 정보를 추가하는 것이 더 쉽습니다. 2분마다 기압 데이터를 캡처하는 센서가 이제 온도를 측정하고 기록할 수 있는 업데이트를 수신한 경우 구조화되지 않은 기존 데이터를 변경할 필요가 없습니다. 그러나 이렇게 하면 이러한 유형의 데이터를 분석하거나 조사하는 데 시간이 더 오래 걸릴 수 있습니다. 예를 들어, 센서 데이터에서 전월 평균 온도를 찾고자 하는 과학자가 센서가 기록된 데이터 중 일부에 "e"를 기록하여 일반적인 숫자가 아닌 파손된 것을 확인하는 것을 발견했습니다. 데이터가 불완전하다는 것을 의미합니다.
비정형 데이터의 예: 텍스트 파일, 문자 메시지, 비디오 파일
### 반구조화
반정형 데이터에는 정형 데이터와 비정형 데이터가 결합된 기능이 있습니다. 일반적으로 행과 열의 형식을 따르지 않지만 구조화된 것으로 간주되고 고정 형식이나 일련의 규칙을 따를 수 있는 방식으로 구성됩니다. 구조는 소스에 따라 다양해지는데, 잘 정의된 계층에서 새로운 정보를 쉽게 통합할 수 있는 보다 유연한 형태같은 것이 있습니다. 메타데이터는 데이터가 구성되고 저장되는 방식을 결정하는 데 도움이 되는 지표이며 데이터 유형에 따라 다양한 이름을 갖게 됩니다. 메타데이터의 일반적인 이름에는 태그, 요소(elements), 엔터티(entity) 및 속성(attribute)이 있습니다. 예를 들어 일반적인 전자 메일 메시지에는 제목, 본문 및 수신자 집합이 있으며 보낸 사람 또는 보낸 시간을 구성할 수 있습니다.
반구조화된 데이터의 예: HTML, CSV 파일, JSON(JavaScript Object Notation)
## 데이터 소스
데이터 소스는 데이터가 생성된 초기 위치 또는 데이터가 "살아 있는" 위치이며 수집 방법과 시기에 따라 달라집니다. 사용자가 생성한 데이터를 1차 데이터라고 하고 2차 데이터는 일반 사용을 위해 데이터를 수집한 소스에서 가져옵니다. 예를 들어, 열대 우림에서 관찰을 수집하는 과학자 그룹은 기본으로 간주되며 다른 과학자와 공유하기로 결정한 경우 이를 사용하는 과학자 그룹에 대해 보조로 간주됩니다.
데이터베이스는 공통 소스이며 사용자가 쿼리라는 명령을 사용하여 데이터를 탐색하는 데이터를 호스팅하고 유지 관리하기 위해 데이터베이스 관리 시스템에 의존합니다. 데이터 소스로서의 파일은 오디오, 이미지 및 비디오 파일과 Excel과 같은 스프레드시트가 될 수 있습니다. 인터넷 소스는 데이터베이스와 파일을 찾을 수 있는 데이터 호스팅을 위한 일반적인 위치입니다. API라고도 하는 응용 프로그래밍 인터페이스를 사용하면 프로그래머가 인터넷을 통해 외부 사용자와 데이터를 공유하는 방법을 만들 수 있으며 웹 스크래핑 프로세스는 웹 페이지에서 데이터를 추출합니다. [데이터 작업 강의](/2-Working-With-Data)에서는 다양한 데이터 소스를 사용하는 방법에대해 알아봅니다.
## 결론
이 단원에서 우리는 다음을 배웠습니다.
- 어떤 데이터인가
- 데이터 설명 방법
- 데이터 분류 및 분류 방법
- 데이터를 찾을 수 있는 곳
## 🚀 도전
Kaggle은 공개 데이터셋의 훌륭한 소스입니다. [데이터셋 검색 도구](https://www.kaggle.com/datasets)를 사용하여 흥미로운 데이터셋을 찾고 다음 기준에 따라 3~5개의 데이터셋을 분류합니다.
- 데이터는 양적입니까, 질적입니까?
- 데이터가 정형, 비정형 또는 반정형입니까?
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/5)
## 복습 및 독학
- [데이터 분류](https://docs.microsoft.com/en-us/learn/modules/choose-storage-approach-in-azure/2-classify-data)라는 제목의 이 Microsoft Learn 단원에는 정형, 반정형 및 비정형 데이터의 분류할 것입니다.
## 과제
[데이터셋 분류](./assignment.ko.md)

@ -0,0 +1,76 @@
# Veriyi Tanımlamak
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../sketchnotes/03-DefiningData.png)|
|:---:|
|Veriyi Tanımlamak - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
Veri, keşifler yapmak ve bilinçli kararları desteklemek için kullanılan gerçekler, bilgi, gözlemler ve ölçümlerdir. Bir veri noktası, veri noktalarından oluşan bir yığın olan veri setlerindeki bir birim veridir. Veri setleri genellikle kaynağına veya verinin nereden geldiğine bağlı olarak farklı formatlarda ve yapılarda bulunabilir. Örneğin, bir şirketin aylık kazancı bir hesap çizelgesinde bulunabilecekken bir akıllı saatten gelen saatlik kalp atışı verisi [JSON] (https://stackoverflow.com/a/383699) formatında olabilir.
Bu ders veriyi karakteristiklerine ve kaynaklarına göre tanımlama ve sınıflandırma üzerine odaklanmaktadır.
## [Ders Öncesi Kısa Sınavı](https://red-water-0103e7a0f.azurestaticapps.net/quiz/4)
## Veri nasıl tanımlanır
**Ham veri** kaynağından oluşturulduğu şekilde aktarılan ve analiz edilmemiş veya düzenlenmemiş veridir. Bir veri setinde ne olduğunu anlayabilmek için veri setlerinin insanların ve verilerin daha ileri düzeyde analiz etmekte kullanabilecekleri teknolojilerin anlayabileceği bir formatta düzenlenmesi gerekmektedir. Bir veri setinin yapısı veri setinin nasıl düzenlendiğini açıklar ve yapısal, yapısal olmayan ve yarı yapısal olarak sınıflandırılabilir.Bu yapı tipleri değişkenlik gösterebilir ve kaynağa bağlıdır ancak veri setleri nihayetinde bu üç kategoriden birisine uyacaktır.
### Nicel veri
Nicel veri bir veri setinin içerisindeki sayısal gözlemlerdir ve genel olacak analiz edilebilir, ölçülebilir ve matematiksel olarak kullanılabilirdir. Nicel verinin bazı örnekleri şu şekilde verilebilir: ülkenin nüfusu, kişinin boyu veya şirketin kazancı. Bazı ek analizlerle nicel veri, Hava Kalitesi İndeksi'nin sezonsal eğilimlerini keşfetmek için veya sıradan bir iş günündeki trafiğin en yoğun olduğu zamanları tahmin etmek için kullanılabilir.
### Nitel veri
Nitel veri veya diğer adıysal kategorik veri, nicel verinin gözlemlerindeki gibi objektif olarak ölçülemeyen verilerdir. Genel olarak ürün veya süreç gibi bir şeyin niteliğini tutan çeşitli formatlardaki subjektif verilerdir. Bazen nitel veri telefon numaraları veya zaman damgaları gibi sayısal olabilir ve genellikle bunlar matematiksel olarak kullanılamaz. Nitel data ile ilgili bazı örnekler: video yorumları, bir arabanın marka ve modeli veya en yakın arkadaşının en sevdiği rengi. Nitel veri, müşterilerin hangi ürünleri en çok sevdiğini görmekte veya bir iş başvurusundaki öz geçmişlerde sıklıkla kullanılan kelimeleri belirlemekte kullanılabilir.
### Yapısal veri
Yapısal veri, her satırın aynı sütun takımına sahip olduğu satır ve sütunlarla düzenlenmiş veridir. Sütunlar belirli bir tipteki değeri temsil eder ve değerin neyi temsil ettiğini açıklayan bir isimle tanımlanır, satırlar ise gerçek değerleri bulundurur. Sütunlar genellikle değerin doğru bir şekilde sütunu temsil ettiğini güvence altına almak için spesifik bir dizi kurallara ya da değerler üzerinde sınırlandırmalara sahip olur. Örneğin her satırın bir telefon numarası içermesi gerektiği ve numaraların alfabetik karakterleri asla içermemesi gerektiği bir müşteri çizelgesini düşünün. Telefon numarası sütununa asla boş olmaması ve sadece numara içerdiğinden emin olmak için kurallar uygulanmış olabilir.
Yapısal verinin bir faydası diğer yapısal verilerle ilişkilendirilerek düzenlenebilir olmasıdır. Ancak veri spesifik bir şekilde düzenlendiği için genel yapısında değişiklikler yapmak oldukça fazla efor gerektirecektir. Örneğin bir müşteri çizelgesine bir email sütunu eklemek, sizin aynı zamanda veri setinde bulunan varolan müşteri satırlarına bu değerleri nasıl ekleyeceğinizi çözmenizi gerektirecektir.
Yapısal veriye örnekler: çizelgeler, ilişkisel veritabanları, telefon numaraları, hesap ekstreleri
### Yapısal olmayan veri
Yapısal olmayan veri genellikle satırlar ve sütunlar kullanılarak kategorize edilemez ve bir format veya takip edilecek kurallar bulundurmazlar. Çünkü yapısal olmayan veriler yapılarında daha az sınırlandırmalar bulundururlar. Yapısal veri setleriyle karşılaştırıldığında yeni bilgi eklemek daha kolaydır. Her 2 dakikada bir barometrik basınç verisini toplayan bir sensör eğer sıcaklığı da ölçüp kaydetmesine izin veren bir güncelleme aldıysa ve eğer veri yapısal değilse mevcut veride değişiklik yapmamıza gerek kalmaz. Ancak bu tip bir veriyi analiz edip incelemek daha uzun süre alabilir. Örneğin sensör verisinden geçen ayki ortalama sıcaklığı bulmak isteyen bir bilim adamını düşünelim. Fakat keşfediyor ki sensör topladığı verilerde bir sayı yerine hatalı olduğunu gösteren "e" harfini kaydetmiş, yani bu demek oluyor ki veri eksiktir.
Yapısal olmayan veriler üzerine örnekler: metin dosyaları, metin iletisi, video dosyaları
### Yarı yapısal
Yarı yapısal veri, onu hem yapısal hem de yapısal olmayan verinin bir kombinasyonu yapan özelliklere sahiptir. Genellikle satır ve sütunlar formatına uymaz ancak yapısal olarak kabul edilebilecek bir şekilde düzenlenmiştir ve sabit bir formatı veya bir dizi kuralı takip eder. İyi tanımlanmış bir hiyerarşi veya yeni bilginin kolay entegrasyonuna izin veren daha esnek bir şeyler gibi kaynaklar arasında yapı değişkenlik gösterecektir. Metaveri verilerin nasıl organize edileceğine ve saklanacağına karar vermeye yardımcı olan göstergelerdir ve verinin tipine dayalı olarak çeşitli isimleri olacaktır. Etiketler, elemanlar, varlıklar ve nitelikler bazı yaygın metaveri isimleridir. Örneğin tipik bir email iletisi konuya, mesaj gövdesine ve bir dizi alıcıya sahiptir ve kim tarafından veya ne zaman gönderildiğine göre düzenlenebilir.
Yarı yapısal veriye örnekler: HTML, CSV dosyaları, JavaScript Nesne Notasyonu (JSON)
## Verinin Kaynakları
Bir veri kaynağı verinin oluşturulduğu veya "yaşadığı" ilk konumdur ve nasıl ve ne zaman toplandığına göre değişkenlik gösterecektir. Kullanıcı(lar) tarafından oluşturulan veriler birincil veri olarak tanımlanırken ikincil veri dediğimiz veriler genel kullanım için toplanmış verilerin bulunduğu bir kaynaktan gelir. Örneğin bir yağmur ormanındaki gözlemleri toplayan bir gurup bilim adamı birincil kaynak olarak nitelendirilebilirken eğer bu kişiler toplandıkları verileri başka bilim adamlarıyla paylaşmak isterlerse bu verileri kullanacaklara bu veriler ikincil veri olacaktır.
Veritabanları yaygın bir kaynaktır ve verileri tutmak ve sürdürülebilirliği sağlamak için bir veritabanı yönetim sistemine bağlıdır. Kullanıcılar verileri araştırmak için sorgular dediğimiz komutları kullanır. Dosya şeklindeki veir kaynakları sesler, görüntüler ve video dosyaları olabileceği gibi Excel gibi hesap çizelgeleri de olabilir. Veritabanlarının ve dosyaların bulunabileceği internet kaynakları verileri barındırmak için yaygın bir kaynaktır. Uygulama programlama arayüzleri (API) programlamacıların harici kullanıcılara internet üzerinden veri paylaşımı için yollar oluşturmaya olanak sağlarken web kazıma işlemi web sitelerinden veri çıkarmaya yarar. ["Veriyle Çalışmak"taki dersler](../../../2-Working-With-Data) çeşitli veri kaynaklarının nasıl kullanılacağına odaklanmaktadır.
## Sonuç
Bu derste öğrendiklerimizi gözden geçirelim:
- Verinin ne olduğunu
- Verinin nasıl tanımlandığını
- Verinin nasıl sınıflandırılıp kategorize edildiğini
- Verinin nerelerde bulunabileceği öğrendik.
## 🚀 Challange
Kaggle mükemmel bir açık veri seti kaynağıdır. İlginç birkaç veri seti bulmak ve 3 ila 5 veri setini aşağıdaki kriterlere göre sıralamak için [Veri seti arama aracını](https://www.kaggle.com/datasets) kullanın.
Kriterler:
- Bu veri nicel midir yoksa nitel midir?
- Bu veri yapısal mıdır, yapısal değil midir yoksa yarı yapısal mıdır?
## [Ders Sonu Kısa Sınavı](https://red-water-0103e7a0f.azurestaticapps.net/quiz/5)
## İnceleme & Öz Çalışma
- Bu [Verini Sınıflandır](https://docs.microsoft.com/en-us/learn/modules/choose-storage-approach-in-azure/2-classify-data) başlıklı Microsoft Learn dersi detaylı bir şekilde yapısal, yarı yapısal ve yapısal olmayan verileri ele almaktadır.
## Ödev
[Veri Setlerini Sınıflandırma](../assignment.md)

@ -0,0 +1,65 @@
# 데이터셋 분류
## 지침
이 과제의 프롬프트에 따라 다음 데이터 타입 중 하나로 데이터를 식별하고 분류합니다.
**구조 유형**: 구조화, 반구조화 또는 비구조화
**값 유형**: 정성적 또는 정량적
**소스 유형**: Primary 또는 Secondary
1. 회사가 인수되었고, 현재 모회사가 있습니다. 데이터 과학자들은 모회사로부터 고객 전화번호 스프레드시트를 받았습니다.
구조 유형:
값 유형:
소스 유형:
---
2. 스마트 워치는 착용자로부터 심박수 데이터를 수집하고 있으며 원시 데이터는 JSON 형식입니다.
구조 유형:
값 유형:
소스 유형:
---
3. CSV 파일에 저장된 직원 사기의 직장 설문 조사.
구조 유형:
값 유형:
소스 유형:
---
4. 천체 물리학자들은 우주 탐사선에 의해 수집된 은하 데이터베이스에 접근하고 있습니다. 데이터에는 각 은하에 있는 행성의 수가 포함됩니다.
구조 유형:
값 유형:
소스 유형:
---
5. 개인 금융 앱은 API를 사용하여 사용자의 금융 계정에 연결하여 순자산을 계산합니다. 행과 열 형식으로 모든 거래를 볼 수 있으며 스프레드시트와 유사하게 보입니다.
구조 유형:
값 유형:
소스 유형:
## 기준표
모범 | 충분 | 개선 필요
--- | --- | -- |
모든 구조, 값 및 소스를 올바르게 식별 |모든 구조, 값 및 소스를 3개 모두 올바르게 식별|2개 이하의 모든 구조, 값 및 소스를 올바르게 식별|

@ -25,7 +25,7 @@ In the case of discrete random variables, it is easy to describe the probability
The most well-known discrete distribution is **uniform distribution**, in which there is a sample space of N elements, with equal probability of 1/N for each of them.
It is more difficult to describe the probability distribution of a continuous variable, with values drawn from some interval [a,b], or the whole set of real numbers &Ropf;. Consider the case of bus arrival time. In fact, for each exact arrival time $t$, the probability of a bus arriving at exactly that time is 0!
It is more difficult to describe the probability distribution of a continuous variable, with values drawn from some interval [a,b], or the whole set of real numbers &Ropf;. Consider the case of bus arrival time. In fact, for each exact arrival time *t*, the probability of a bus arriving at exactly that time is 0!
> Now you know that events with 0 probability happen, and very often! At least each time when the bus arrives!
@ -240,8 +240,8 @@ While this is definitely not exhaustive list of topics that exist within probabi
## 🚀 Challenge
Use the sample code in the notebook to test other hypothesis that:
1. First basemen and older that second basemen
2. First basemen and taller than third basemen
1. First basemen are older than second basemen
2. First basemen are taller than third basemen
3. Shortstops are taller than second basemen
## [Post-lecture quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/7)

@ -0,0 +1,263 @@
# 통계 및 확률에 대한 간략한 소개
|![ [(@sketchthedocs)의 스케치노트](https://sketchthedocs.dev) ](../../../sketchnotes/04-Statistics-Probability.png)|
|:---:|
| 통계 및 확률 - _[@nitya](https://twitter.com/nitya)_ 의 스케치노트 |
통계 및 확률 이론은 데이터 과학과 매우 관련성이 높은 수학 영역입니다. 수학에 대한 깊은 지식이 없어도 데이터로 작업하는 것은 가능하지만 최소한 몇 가지 기본 개념은 알고 있는 것이 좋습니다. 이 장에서 통계 및 확률을 시작하는 데 도움이 되는 간단한 소개를 제공합니다.
[![인트로 영상](../images/video-prob-and-stats.png)](https://youtu.be/Z5Zy85g4Yjw)
## [강의전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/6)
## 확률과 랜덤 변수
**확률**은 **사건**의 확률을 나타내는 0과 1 사이의 숫자입니다. 모든 결과의 가능성이 동일할 경우 이벤트로 이어지는 긍정적인 결과의 수를 총 결과 수로 나눈 값으로 정의됩니다. 예를 들어, 주사위를 굴릴 때 짝수가 나올 확률은 3/6 = 0.5입니다.
이벤트에 대해 이야기할 때 **임의 변수**를 사용합니다. 예를 들어, 주사위를 던질 때 얻은 숫자를 나타내는 확률 변수는 1에서 6까지의 값을 취합니다. 1에서 6까지의 숫자 집합을 **샘플 공간**이라고 합니다. 예를 들어 P(X=3)=1/6과 같이 임의의 변수가 특정 값을 취할 확률에 대해 이야기할 수 있습니다.
이전 예의 확률 변수는 셀 수 있는 샘플 공간, 즉 열거할 수 있는 별도의 값이 있기 때문에 **이산**이라고 합니다. 표본 공간이 실수의 범위이거나 실수의 전체 집합인 경우가 있습니다. 이러한 변수를 **연속**이라고 합니다. 좋은 예는 버스가 도착하는 시간입니다.
## 확률 분포
이산 확률 변수의 경우 각 이벤트의 확률을 함수 P(X)로 설명하기 쉽습니다. 샘플 공간 *S*의 각 값 *s*에 대해 모든 이벤트에 대한 P(X=s)의 모든 값의 합이 1이 되도록 0에서 1까지의 숫자를 제공합니다.
가장 잘 알려진 이산 분포는 **균일 분포**로, 각 요소에 대해 동일한 확률이 1/N인 N 요소의 표본 공간이 있습니다.
일부 구간 [a,b]에서 가져온 값 또는 실수 &Ropf의 전체 집합을 사용하여 연속 변수의 확률 분포를 설명하는 것이 더 어렵습니다. 버스 도착 시간의 경우를 고려하십시오. 실제로 각 정확한 도착 시간 *t*에 대해 버스가 정확히 그 시간에 도착할 확률은 0입니다!
> 이제 확률이 0인 이벤트가 매우 자주 발생한다는 것을 알았습니다! 적어도 버스가 도착할 때마다!
예를 들어 주어진 값 간격에 변수가 떨어질 확률에 대해서만 이야기할 수 있습니다. P(t<sub>1</sub>&le;X<t<sub>2</sub>). 이 경우 확률 분포는 **확률 밀도 함수** p(x)로 다음과 같이 설명됩니다.
![P(t_1\le X<t_2)=\int_{t_1}^{t_2}p(x)dx](../images/probability-density.png)
균일 분포의 연속 아날로그는 유한 간격으로 정의되는 **연속 균일**이라고 합니다. 값 X가 길이 l의 구간에 들어갈 확률은 l에 비례하고 1까지 올라갑니다.
또 다른 중요한 분포는 **정규 분포**입니다. 이에 대해서는 아래에서 더 자세히 설명하겠습니다.
## 평균, 분산 및 표준 편차
확률 변수 X의 n개 샘플 시퀀스를 그린다고 가정합니다: x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>n</sub>. 우리는 전통적인 방식으로 시퀀스의 **mean**(또는 **산술 평균**) 값을 다음과 같이 정의할 수 있습니다. (x<sub>1</sub>+x<sub>2</sub>+x<sub >n</sub>)/n. 표본의 크기를 늘리면(즉, n&rarr;&infin;으로 극한을 취함) 분포의 평균(**기대값**이라고도 함)을 얻게 됩니다. 기대치를 **E**(x)로 표시합니다.
> 값이 {x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>N</sub>}이고 해당 확률이 있는 이산 분포의 경우 p<sub>1</sub>, p<sub>2</sub>, ..., p<sub>N</sub>, 기대값은 E(X)=x<sub>1< /sub>p<sub>1</sub>+x<sub>2</sub>p<sub>2</sub>+...+x<sub>N</sub>p<sub>N </sub>.
값이 얼마나 퍼져 있는지 식별하기 위해 분산 sigma;<sup>2</sup> = &sum;(x<sub>i</sub> - &mu;)<sup>2</sup>/를 계산할 수 있습니다. n, 여기서 &mu; 수열의 평균입니다. 가치 σ; **표준편차**라고 하고 sigma;<sup>2</sup>**분산**이라고 합니다.
## 모드(Mode), 중앙값(Median) 및 사분위수(Quartiles)
때때로 평균은 데이터의 "일반적인" 값을 적절하게 나타내지 않습니다. 예를 들어, 범위를 완전히 벗어난 극단값이 몇 개 있는 경우 평균에 영향을 줄 수 있습니다. 또 다른 좋은 표시는 데이터 포인트의 절반이 그보다 낮고 다른 절반은 더 높은 값인 **중앙값**입니다.
데이터 분포를 이해하는 데 도움이 되도록 **사분위수**에 대해 이야기하는 것이 좋습니다.
* 1사분위수 또는 Q1은 데이터의 25%가 그 아래로 떨어지는 값입니다.
* 3사분위수 또는 Q3은 데이터의 75%가 그 아래에 속하는 값입니다.
**박스 플롯**이라는 다이어그램에서 중앙값과 사분위수 간의 관계를 그래픽으로 나타낼 수 있습니다.
<img src="../images/boxplot_explanation.png" width="50%"/>
여기에서 **사분위수 범위** IQR=Q3-Q1 및 소위 **이상치** - 경계 외부에 있는 값[Q1-1.5*IQR,Q3+1.5*IQR]도 계산합니다.
적은 수의 가능한 값을 포함하는 유한 분포의 경우 좋은 "전형적인" 값이 가장 자주 나타나는 값이며, 이를 **모드(Mode)**라고 합니다. 색상과 같은 범주형 데이터에 자주 적용됩니다. 빨간색을 강하게 선호하는 사람과 파란색을 선호하는 사람의 두 그룹이 있는 상황을 생각해 보십시오. 색상을 숫자로 코딩하면 좋아하는 색상의 평균 값은 주황색-녹색 스펙트럼의 어딘가에 있을 것이며, 이는 어느 그룹의 실제 선호도를 나타내지 않습니다. 그러나 모드는 투표하는 사람들의 수가 같을 경우 색상 중 하나 또는 두 색상 모두가 됩니다(이 경우 샘플 **다중 모드**라고 함).
## 실제 데이터
실생활의 데이터를 분석할 때 결과를 알 수 없는 실험을 하지 않는다는 의미에서 확률변수가 아닌 경우가 많습니다. 예를 들어, 야구 선수로 구성된 팀과 키, 체중 및 나이와 같은 신체 데이터를 고려하십시오. 그 숫자는 정확히 무작위가 아니지만 여전히 동일한 수학적 개념을 적용할 수 있습니다. 예를 들어, 사람들의 가중치 시퀀스는 임의의 변수에서 가져온 값 시퀀스로 간주될 수 있습니다. 아래는 [이 데이터셋](http://wiki.stat.ucla.edu)에서 가져온 [메이저리그 야구](http://mlb.mlb.com/index.jsp)의 실제 야구 선수들의 가중치 순서입니다. /socr/index.php/SOCR_Data_MLB_HeightsWeights) (편의를 위해 처음 20개 값만 표시됨):
```
[180.0, 215.0, 210.0, 210.0, 188.0, 176.0, 209.0, 200.0, 231.0, 180.0, 188.0, .0, 180.0, 188.0, 180.0, 185.0, 180.5
```
> **참고**: 이 데이터셋으로 작업하는 예를 보려면 [노트북 파일](../notebook.ipynb)을 살펴보세요. 또한 이 단원에는 여러 가지 문제가 있으며 해당 노트북에 몇 가지 코드를 추가하여 완료할 수 있습니다. 데이터 작업 방법이 확실하지 않은 경우 걱정하지 마세요. 나중에 Python을 사용하여 데이터 작업으로 다시 돌아올 것입니다. Jupyter Notebook에서 코드를 실행하는 방법을 모른다면 [이 기사](https://soshnikov.com/education/how-to-execute-notebooks-from-github/)를 참조하십시오.
다음은 데이터의 평균, 중앙값 및 사분위수를 보여주는 상자 그림입니다.
![Weight Box Plot](../images/weight-boxplot.png)
우리 데이터에는 다양한 플레이어 **역할**에 대한 정보가 포함되어 있기 때문에 역할별로 상자 그림을 그릴 수도 있습니다. 이를 통해 매개변수 값이 역할에 따라 어떻게 다른지에 대한 아이디어를 얻을 수 있습니다. 이번에는 높이를 고려할 것입니다.
![역할별 상자 플롯](../images/boxplot_byrole.png)
이 도표는 평균적으로 1루수의 키가 2루수의 키보다 높다는 것을 암시합니다. 이 수업의 뒷부분에서 우리는 이 가설을 보다 공식적으로 테스트하는 방법과 우리의 데이터가 이를 보여주기 위해 통계적으로 유의하다는 것을 증명하는 방법을 배울 것입니다.
> 실제 데이터로 작업할 때 모든 데이터 포인트는 일부 확률 분포에서 추출한 샘플이라고 가정합니다. 이 가정을 통해 우리는 기계 학습 기술을 적용하고 작동하는 예측 모델을 구축할 수 있습니다.
데이터 분포를 확인하기 위해 **히스토그램**이라는 그래프를 그릴 수 있습니다. X축은 다양한 가중치 간격(소위 **빈**)을 포함하고 세로축은 랜덤 변수 샘플이 주어진 간격 내에 있는 횟수를 표시합니다.
![실제 데이터의 히스토그램](../images/weight-histogram.png)
이 히스토그램에서 모든 값이 특정 평균 가중치의 중심에 있고 해당 가중치에서 멀어질수록 해당 값의 가중치가 더 적음을 알 수 있습니다. 즉, 야구 선수의 체중이 평균 체중과 크게 다를 가능성은 매우 낮습니다. 가중치의 분산은 가중치가 평균과 다를 가능성이 있는 정도를 나타냅니다.
> 야구리그가 아닌 타인의 가중치를 취하면 분포가 달라질 가능성이 높다. 그러나 분포의 모양은 동일하지만 평균과 분산은 변경됩니다. 따라서 야구 선수를 대상으로 모델을 훈련하면 기본 분포가 다르기 때문에 대학 학생에게 적용하면 잘못된 결과가 나올 수 있습니다.
## 정규 분포
위에서 본 가중치 분포는 매우 일반적이며 실제 세계의 많은 측정값은 동일한 유형의 분포를 따르지만 평균과 분산은 다릅니다. 이 분포를 **정규 분포**라고 하며 통계에서 매우 중요한 역할을 합니다.
정규 분포를 사용하는 것은 잠재적인 야구 선수의 무작위 가중치를 생성하는 올바른 방법입니다. 평균 가중치 'mean'과 표준 편차 'std'를 알게 되면 다음과 같은 방식으로 1000개의 가중치 샘플을 생성할 수 있습니다.
```파이썬
샘플 = np.random.normal(mean,std,1000)
```
생성된 샘플의 히스토그램을 플롯하면 위에 표시된 것과 매우 유사한 그림을 볼 수 있습니다. 샘플 수와 빈 수를 늘리면 이상에 더 가까운 정규 분포 그림을 생성할 수 있습니다.
![평균이 0이고 std.dev=1인 정규 분포](../images/normal-histogram.png)
*mean=0 및 std.dev=1인 정규 분포*
## 신뢰 구간
야구 선수의 체중에 대해 이야기할 때 모든 야구 선수(소위 **인구**)의 체중에 대한 이상적인 확률 분포에 해당하는 특정 **무작위 변수 W**가 있다고 가정합니다. 가중치 시퀀스는 **샘플**이라고 하는 모든 야구 선수의 하위 집합에 해당합니다. 흥미로운 질문은 W 분포의 매개변수, 즉 모집단의 평균과 분산을 알 수 있습니까?
가장 쉬운 대답은 표본의 평균과 분산을 계산하는 것입니다. 그러나 무작위 표본이 전체 모집단을 정확하게 나타내지 않을 수 있습니다. 따라서 **신뢰 구간**에 대해 이야기하는 것이 좋습니다.
> **신뢰 구간**은 표본이 제공된 모집단의 실제 평균 추정치로, 특정 확률(또는 **신뢰 수준**)이 정확합니다.
분포에서 샘플 X<sub>1</sub>, ..., X<sub>n</sub>이 있다고 가정합니다. 분포에서 표본을 추출할 때마다 다른 평균값 μ가 됩니다. 따라서 뮤; 확률변수라고 할 수 있습니다. 신뢰 p가 있는 **신뢰 구간**은 값 쌍(L<sub>p</sub>,R<sub>p</sub>)입니다. **P**(L<sub>p </sub><leq;&mu;&leq;R<sub>p</sub>) = p, 즉 측정된 평균값이 구간 내에 포함될 확률은 p와 같습니다.
이러한 신뢰 구간을 계산하는 방법에 대해 자세히 설명하는 것은 짧은 소개를 넘어서는 것입니다. 더 자세한 내용은 [위키피디아](https://en.wikipedia.org/wiki/Confidence_interval)에서 찾을 수 있습니다. 간단히 말해서, 모집단의 실제 평균을 기준으로 계산된 표본 평균의 분포를 정의하며, 이를 **학생 분포**라고 합니다.
> **흥미로운 사실**: 학생 분포는 "학생"이라는 가명으로 논문을 발표한 수학자 William Sealy Gosset의 이름을 따서 명명되었습니다. 그는 기네스 양조장에서 일했으며 버전 중 하나에 따르면 그의 고용주는 일반 대중이 원료의 품질을 결정하기 위해 통계적 테스트를 사용하고 있다는 사실을 알기를 원하지 않았습니다.
평균 &mu; 우리 모집단의 p를 신뢰하는 경우, 학생 분포 A의 *(1-p)/2-백분위수*를 가져와야 합니다. 이는 테이블이나 통계 소프트웨어의 일부 내장 기능을 사용하는 컴퓨터에서 가져올 수 있습니다(예: .파이썬, R 등). 그런 다음 &mu; X&pm;A*D/&radic;n으로 주어지며, 여기서 X는 샘플의 얻은 평균, D는 표준 편차입니다.
> **참고**: 학생 배포와 관련하여 중요한 [자유도](https://en.wikipedia.org/wiki/Degrees_of_freedom_(statistics))의 중요한 개념에 대한 논의도 생략합니다. 이 개념을 더 깊이 이해하려면 통계에 대한 더 완전한 책을 참조할 수 있습니다.
몸무게와 키에 대한 신뢰구간을 계산하는 예시는 [첨부노트](../notebook.ipynb)에 나와 있습니다.
| 피 | 무게 평균 |
|-----|-----------|
| 0.85 | 201.73±0.94 |
| 0.90 | 201.73±1.08 |
| 0.95 | 201.73±1.28 |
신뢰 확률이 높을수록 신뢰 구간이 넓어집니다.
## 가설 검증
야구 선수 데이터셋에는 다양한 선수 역할이 있으며 아래에 요약할 수 있습니다(이 표를 계산하는 방법을 보려면 [첨부 노트](../notebook.ipynb) 참조).
| 역할 | 높이 | 무게 | 카운트 |
|---------|--------|--------|-------|
| 포수 | 72.723684 | 204.328947 | 76 |
| 지명타자 | 74.222222 | 220.888889 | 18 |
| 퍼스트_루수 | 74.000000 | 213.109091 | 55 |
| 외야수 | 73.010309 | 199.113402 | 194 |
| Relief_Pitcher | 74.374603 | 203.517460 | 315 |
| Second_Baseman | 71.362069 | 184.344828 | 58 |
| 유격수 | 71.903846 | 182.923077 | 52 |
| 시작_투수 | 74.719457 | 205.163636 | 221 |
| Third_Baseman | 73.044444 | 200.955556 | 45 |
1루수의 평균 신장이 2루수의 평균 신장보다 높다는 것을 알 수 있습니다. 따라서 우리는 **1루수가 2루수보다 높다**라는 결론을 내릴 수 있습니다.
> 사실이 사실인지 아닌지 알 수 없기 때문에 이 진술을 **가설**이라고 합니다.
그러나 우리가 이러한 결론을 내릴 수 있는지 여부가 항상 분명한 것은 아닙니다. 위의 논의에서 우리는 각 평균에 연관된 신뢰 구간이 있다는 것을 알고 있으므로 이 차이는 단지 통계적 오류일 수 있습니다. 우리는 우리의 가설을 검증하기 위해 좀 더 공식적인 방법이 필요합니다.
1루수와 2루수 키에 대한 신뢰 구간을 별도로 계산해 보겠습니다.
| 자신감 | 1루수 | 2루수 |
|------------|------------------|----------------|
| 0.85 | 73.62..74.38 | 71.04..71.69 |
| 0.90 | 73.56..74.44 | 70.99..71.73 |
| 0.95 | 73.47..74.53 | 70.92..71.81 |
신뢰하지 않는 경우 구간이 겹치는 것을 볼 수 있습니다. 이것은 1루수가 2루수보다 높다는 우리의 가설을 증명합니다.
보다 공식적으로, 우리가 해결하는 문제는 **두 개의 확률 분포가 동일한지** 또는 최소한 동일한 매개변수를 갖는지 확인하는 것입니다. 분포에 따라 다른 테스트를 사용해야 합니다. 분포가 정상이라는 것을 안다면 **[Student t-test](https://en.wikipedia.org/wiki/Student%27s_t-test)** 를 적용할 수 있습니다.
스튜던트 t-검정에서는 분산을 고려하여 평균 간의 차이를 나타내는 소위 **t-값**을 계산합니다. t-값은 **학생 분포**를 따르며, 이를 통해 주어진 신뢰 수준 **p**에 대한 임계값을 얻을 수 있습니다(이는 계산하거나 숫자 표에서 조회할 수 있음). 그런 다음 t-값을 이 임계값과 비교하여 가설을 승인하거나 기각합니다.
파이썬에서는 `ttest_ind` 기능을 포함하는 **SciPy** 패키지를 사용할 수 있습니다(다른 많은 유용한 통계 기능 외에도!). 그것은 우리를 위해 t-값을 계산하고 또한 신뢰 p-값의 역 조회를 수행하여 우리가 결론을 도출하기 위해 신뢰를 볼 수 있도록 합니다.
예를 들어, 1루수와 2루수의 키를 비교하면 다음과 같은 결과가 나옵니다.
```파이썬
scipy.stats에서 ttest_ind 가져오기
tval, pval = ttest_ind(df.loc[df['역할']=='First_Baseman',['신장']], df.loc[df['역할']=='지정된_히터',['신장'] ],equal_var=거짓)
print(f"T 값 = {tval[0]:.2f}\nP 값: {pval[0]}")
```
```
T-값 = 7.65
P-값: 9.137321189738925e-12
```
우리의 경우 p-값이 매우 낮습니다. 이는 1루수가 키가 크다는 강력한 증거가 있음을 의미합니다.
테스트할 수 있는 다른 유형의 가설도 있습니다. 예를 들면 다음과 같습니다.
* 주어진 표본이 어떤 분포를 따른다는 것을 증명하기 위해. 우리의 경우 높이가 정규 분포라고 가정했지만 공식적인 통계 검증이 필요합니다.
* 표본의 평균값이 미리 정의된 값과 일치함을 증명하기 위해
* 여러 표본의 평균을 비교하기 위해(예: 연령대에 따른 행복 수준의 차이)
## 대수의 법칙과 중심극한정리
정규 분포가 중요한 이유 중 하나는 소위 **중심극한 정리**입니다. 평균이 &mu인 분포에서 샘플링된 독립적인 N 값 X<sub>1</sub>, ..., X<sub>N</sub>의 큰 샘플이 있다고 가정합니다. 및 분산 σ<sup>2</sup>. 그런 다음 충분히 큰 N에 대해(즉, N<sub>i</sub>X<sub>i</sub>인 경우) 평균 Σ<sub>i</sub>는 정규 분포를 따르고 평균은 Δmu; 및 분산 σ<sup>2</sup>/N.
> 중심극한정리를 해석하는 또 다른 방법은 분포에 관계없이 임의의 변수 값의 합계의 평균을 계산할 때 정규 분포로 끝나는 것이라고 말하는 것입니다.
중심극한정리로부터, N''일 때, 표본 평균의 확률은 α와 같다는 것이 또한 따른다. 1이 됩니다. 이것은 **대수의 법칙**으로 알려져 있습니다.
## 공분산과 상관
데이터 과학이 하는 일 중 하나는 데이터 간의 관계를 찾는 것입니다. 두 시퀀스가 ​​동시에 유사한 동작을 나타낼 때 **상관관계**가 있다고 말합니다. 즉, 동시에 상승/하강하거나, 다른 시퀀스가 ​​떨어질 때 한 시퀀스가 ​​상승하고 그 반대의 경우도 마찬가지입니다. 즉, 두 시퀀스 사이에 어떤 관계가 있는 것 같습니다.
> 상관 관계가 반드시 두 시퀀스 간의 인과 관계를 나타내는 것은 아닙니다. 때로는 두 변수 모두 외부 원인에 따라 달라질 수 있거나 순전히 우연히 두 시퀀스가 ​​상관 관계가 있을 수 있습니다. 그러나 강한 수학적 상관관계는 두 변수가 어떻게든 연결되어 있다는 좋은 표시입니다.
수학적으로 두 확률 변수 간의 관계를 보여주는 주요 개념은 **공분산**이며 다음과 같이 계산됩니다. Cov(X,Y) = **E**\[(X-**E**(X) ))(Y-**E**(Y))\]. 평균값에서 두 변수의 편차를 계산한 다음 해당 편차의 곱을 계산합니다. 두 변수가 함께 벗어나면 제품은 항상 양수 값이 되어 양의 공분산이 됩니다. 두 변수가 동기화되지 않은 상태에서 벗어나면(즉, 하나는 평균 아래로 떨어지고 다른 하나는 평균 이상으로 상승하는 경우) 항상 음수를 얻게 되며, 이는 합산하여 음의 공분산이 됩니다. 편차가 종속적이지 않은 경우 합산하면 대략 0이 됩니다.
공분산의 절대 값은 실제 값의 크기에 따라 달라지기 때문에 상관 관계가 얼마나 큰지 알려주지 않습니다. 정규화하기 위해 공분산을 두 변수의 표준 편차로 나누어 **상관**을 얻을 수 있습니다. 좋은 점은 상관 관계가 항상 [-1,1] 범위에 있다는 것입니다. 여기서 1은 값 간의 강한 양의 상관 관계를 나타내고, -1 - 강한 음의 상관 관계를 나타내고, 0 - 상관 관계가 전혀 없음(변수는 독립적임)을 나타냅니다.
**예**: 위에서 언급한 데이터셋에서 야구 선수의 체중과 키 간의 상관 관계를 계산할 수 있습니다.
```파이썬
print(np.corrcoef(무게, 높이))
```
결과적으로 다음과 같은 **상관 행렬**을 얻습니다.
```
배열([[1. , 0.52959196],
[0.52959196, 1. ]])
```
> 상관 행렬 C는 입력 시퀀스 S<sub>1</sub>, ..., S<sub>n</sub>의 개수에 관계없이 계산할 수 있습니다. C<sub>ij</sub>의 값은 S<sub>i</sub>와 S<sub>j</sub> 사이의 상관 관계이며 대각선 요소는 항상 1입니다(이는 S<sub>i</sub>).
우리의 경우 값 0.53은 사람의 체중과 키 사이에 약간의 상관 관계가 있음을 나타냅니다. 관계를 시각적으로 보기 위해 다른 값에 대한 한 값의 산점도를 만들 수도 있습니다.
![체중과 키의 관계](../images/weight-height-relationship.png)
> [첨부노트](../notebook.ipynb)에서 상관관계와 공분산의 더 많은 예를 볼 수 있습니다.
## 결론
이 섹션에서는 다음을 배웠습니다.
* 평균, 분산, 모드 및 사분위수와 같은 데이터의 기본 통계 속성
* 정규 분포를 포함한 다양한 확률 변수 분포
* 서로 다른 속성 간의 상관 관계를 찾는 방법
* 몇 가지 가설을 증명하기 위해 수학과 통계의 건전한 장치를 사용하는 방법,
* 주어진 데이터 샘플에서 확률 변수에 대한 신뢰 구간을 계산하는 방법
이것은 확률과 통계에 존재하는 주제의 완전한 목록은 아니지만 이 과정을 시작하기에 충분할 것입니다.
## 🚀 도전
노트북의 샘플 코드를 사용하여 다음과 같은 다른 가설을 테스트합니다.
1. 1루수가 2루수보다 나이가 많다
2. 1루수는 3루수보다 키가 크다
3. 유격수는 2루수보다 키가 크다
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/7)
## 복습 및 독학
확률과 통계는 그 자체로 충분한 가치가 있는 광범위한 주제입니다. 이론에 대해 더 깊이 알고 싶다면 다음 책을 계속 읽어도 좋습니다.
1. 뉴욕대학교의 [Carlos Fernanderz-Graranda](https://cims.nyu.edu/~cfgranda/) 강의노트가 훌륭합니다. [Probability and Statistics for Data Science](https://cims.nyu.edu/~cfgranda/pages/stuff/probability_stats_for_DS.pdf) (온라인에서 사용 가능)
1. [피터와 앤드류 브루스. 데이터 과학자를 위한 실용 통계.](https://www.oreilly.com/library/view/practical-statistics-for/9781491952955/) [[R의 샘플 코드](https://github.com/andrewgbruce/statistics-for-data-scientists)].
1. [제임스 D. 밀러. 데이터 과학 통계](https://www.packtpub.com/product/statistics-for-data-science/9781788290678) [[샘플 코드 R](https://github.com/PacktPublishing/Statistics-for-Data-Science)]
## 과제
[소형 당뇨병 연구](./assignment.ko.md)
## 크레딧
이 수업은 [Dmitry Soshnikov](http://soshnikov.com)의 ♥️ 으로 작성되었습니다.

@ -0,0 +1,30 @@
# 소당뇨병 연구
이 과제에서 우리는 [여기](https://www4.stat.ncsu.edu/~boos/var.select/diabetes.html)에서 가져온 당뇨병 환자의 작은 데이터셋으로 작업할 것입니다.
| | AGE | SEX | BMI | BP | S1 | S2 | S3 | S4 | S5 | S6 | Y |
|---|-----|-----|-----|----|----|----|----|----|----|----|----|
| 0 | 59 | 2 | 32.1 | 101. | 157 | 93.2 | 38.0 | 4. | 4.8598 | 87 | 151 |
| 1 | 48 | 1 | 21.6 | 87.0 | 183 | 103.2 | 70. | 3. | 3.8918 | 69 | 75 |
| 2 | 72 | 2 | 30.5 | 93.0 | 156 | 93.6 | 41.0 | 4.0 | 4. | 85 | 141 |
| ... | ... | ... | ... | ...| ...| ...| ...| ...| ...| ...| ... |
## 지침
* jupyter notebook 환경에서 [과제노트](assignment.ipynb) 열기
* notebook 에 나열된 모든 작업, 즉:
[ ] 모든 값의 평균값과 분산 계산
[ ] 성별에 따른 BMI, BP 및 Y에 대한 플롯 상자 그림
[ ] 연령, 성별, BMI 및 Y 변수의 분포는 무엇입니까?
[ ] 다른 변수와 질병 진행 사이의 상관 관계 테스트(Y)
[ ] 당뇨병 진행 정도가 남녀 간에 다르다는 가설 검정
## 기준표
모범 | 충분 | 개선 필요
--- | --- | -- |
필요한 모든 작업이 완료되고 그래픽으로 설명 및 설명 되어 있음 | 대부분의 작업이 완료되었으며 그래프 및/또는 얻은 값의 설명이나 요약이 누락되었습니다. | 평균/분산 계산 및 기본 도표와 같은 기본 작업만 완료되어 있으며 데이터에서 결론이 내려지지 않습니다.

@ -12,7 +12,7 @@ cómo se definen los datos y un poco de probabilidad y estadística, el núcleo
1. [Definiendo la Ciencia de Datos](../01-defining-data-science/README.md)
2. [Ética de la Ciencia de Datos](../02-ethics/README.md)
3. [Definición de Datos](../03-defining-data/translations/README.es.md)
4. [introducción a la probabilidad y estadística](../04-stats-and-probability/README.md)
4. [Introducción a la probabilidad y estadística](../04-stats-and-probability/README.md)
### Créditos

@ -0,0 +1,21 @@
<div dir="rtl">
# مقدمه‌ای بر علم داده
![data in action](../images/data.jpg)
> تصویر از <a href="https://unsplash.com/@dawson2406?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Stephen Dawson</a> در <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
شما در این بخش با تعریف علم داده و ملاحظات اخلاقی که یک دانشمند علوم داده باید در نظر داشته باشد آشنا خواهید شد. همچنین با تعریف داده و کمی هم با آمار و احتمالات که پایه و اساس علم داده است آشنا خواهید شد.
### سرفصل ها
1. [تعریف علم داده](../01-defining-data-science/README.md)
2. [اصول اخلاقی علم داده](../02-ethics/README.md)
3. [تعریف داده](../03-defining-data/README.md)
4. [مقدمه ای بر آمار و احتمال](../04-stats-and-probability/README.md)
### تهیه کنندگان
این درس ها با ❤️ توسط [Nitya Narasimhan](https://twitter.com/nitya) و [Dmitry Soshnikov](https://twitter.com/shwars) تهیه شده است.
</div>

@ -0,0 +1,17 @@
# 데이터 과학(Data Science) 소개
![활용중인 데이터](../images/data.jpg)
> 촬영 작가: <a href="https://unsplash.com/@dawson2406?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Stephen Dawson</a> on <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
이 수업에서는 데이터 과학이 어떻게 정의되는지 알아보고 데이터 과학자가 고려해야 하는 윤리적인 사항들에 대해 배웁니다. 또한 데이터가 어떻게 정의되는지 배우고 데이터 과학의 핵심 학문 영역인 확률과 통계에 대해서 간단히 배우게 됩니다.
### 주제
1. [데이터 과학 정의](../01-defining-data-science/translations/README.ko.md)
2. [데이터 과학 윤리](../02-ethics/translations/README.ko.md)
3. [데이터 정의](../03-defining-data/translations/README.ko.md)
4. [확률과 통계 소개](../04-stats-and-probability/translations/README.ko.md)
### 크레딧
강의를 제작한 분: [Nitya Narasimhan](https://twitter.com/nitya) 과 [Dmitry Soshnikov](https://twitter.com/shwars)

@ -0,0 +1,17 @@
# Inleiding tot datawetenschap
![data in actie](images/data.jpg)
> 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,181 @@
# 데이터 처리: 관계형 데이터베이스
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../sketchnotes/05-RelationalData.png)|
|:---:|
| 데이터 처리: 관계형 데이터베이스 - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
과거에 스프레드 시트를 통해 정보를 저장한 경험이 있을 것입니다. 이는 행(rows)과 열(columns)을 가지고 있으며, 행(rows)에는 정보(혹은 데이터)를 나타내고 열(columns)에는 해당 정보(또는 메타데이터)를 정의합니다. 관계형 데이터베이스는 테이블의 행과 열의 핵심 원리를 기반으로 구축되며 여러 테이블에 정보를 분산시킬 수 있습니다. 이를 통해 더 복잡한 데이터를 다룰 수 있을 뿐만 아니라 중복을 방지하고, 데이터 탐색 방식에서 유연성을 가질 수 있습니다. 관계형 데이터베이스의 개념을 좀 더 살펴보겠습니다.
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/8)
## 모든 것의 시작 : 테이블(table)
관계형 데이터베이스는 테이블을 가지며, 스프레드 시트와 마찬가지로 열과 행으로 이루어져 있습니다. 행에는 도시 이름이나 강우량등의 작업하고자 하는 데이터나 정보를 나타냅니다. 열에는 저장된 데이터에 대한 설명을 나타냅니다.
그렇다면 이제 실습을 시작해보겠습니다. 우선 도시 정보를 저장하는 테이블을 생성해 보도록 하겠습니다. 아래와 같이 나라와 도시 이름을 저장할 수 있을 것입니다.:
| City | Country |
| -------- | ------------- |
| Tokyo | Japan |
| Atlanta | United States |
| Auckland | New Zealand |
**city**, **country****population**의 열 이름은 저장 중인 데이터를 가리키며, 각 행에는 도시에 대한 정보가 저장되어 있습니다.
## 단일 테이블의 단점
위의 테이블은 비교적 친숙해 보일 수도 있습니다. 이제 데이터베이스에 급증하는 연간 강우량(밀리미터 단위)에 대한 몇가지 데이터를 추가해 보겠습니다. 만약 우리가 2018,2018 그리고 2020년의 데이터를 추가한다면, 다음과 같을 것입니다.:
| City | Country | Year | Amount |
| ----- | ------- | ---- | ------ |
| Tokyo | Japan | 2020 | 1690 |
| Tokyo | Japan | 2019 | 1874 |
| Tokyo | Japan | 2018 | 1445 |
테이블에서 뭔가 알아차리셨나요? 도시의 이름과 국가를 계속해서 중복적으로 사용하고 있는 것을 발견했을 것입니다. 이러한 경우 불필요한 복사본을 저장함에 따라 저장소 낭비가 발생하게 됩니다. 결국, Tokyo는 하나만 존재해야 합니다.
그렇다면 다른 방식으로 접근해 보겠습니다. 각 연도에 대한 새 열을 추가하겠습니다.:
| City | Country | 2018 | 2019 | 2020 |
| -------- | ------------- | ---- | ---- | ---- |
| Tokyo | Japan | 1445 | 1874 | 1690 |
| Atlanta | United States | 1779 | 1111 | 1683 |
| Auckland | New Zealand | 1386 | 942 | 1176 |
이러한 방식은 행에 대한 중복을 피할수는 있지만, 몇 가지 해결해야할 과제가 존재합니다. 우선, 새로운 연도가 추가될 때마다 테이블의 구조를 수정해야만 합니다. 또한, 데이터가 증가함에 따라 값을 검색하고 계산하는 것이 더 어려워집니다.
이것이 여러 테이블의 관계가 필요한 이유입니다. 데이터를 분리함으로써 중복을 방지하고, 데이터를 보다 유연하게 사용할 수 있습니다.
## 관계의 개념
다시 데이터를 보며 어떻게 데이터를 분할할 것인지 결정해 보겠습니다. 이미 우리는 City의 Name과 Country를 저장하는 것이 최선의 방법인 것을 알고 있고, 실제로 가장 잘 동작할 것입니다.
| City | Country |
| -------- | ------------- |
| Tokyo | Japan |
| Atlanta | United States |
| Auckland | New Zealand |
하지만 우리가 다음 테이블을 생성하기 이전에, 우리는 각각의 도시를 어떻게 참조할 것인지 생각해 봐야합니다. 구분 지을 수 있는 여러 형태의 식별자,ID 또는 기본키(Primary key)가 필요합니다. 기본키(Primary key)는 테이블에서 특정 행을 식별하는데 사용되는 값입니다. 기본키로 값 자체(ex. 도시 이름)를 사용할 수도 있지만, 대부분 숫자 또는 다른 식별자가 사용됩니다. ID 값이 바뀌면서 관계를 깨뜨릴 수 있기 때문에 대부분 기본키 또는 자동 생성된 번호를 사용합니다.
> ✅ 기본키(Primary key)는 주로 PK라고 약칭 됩니다.
### 도시
| city_id | City | Country |
| ------- | -------- | ------------- |
| 1 | Tokyo | Japan |
| 2 | Atlanta | United States |
| 3 | Auckland | New Zealand |
> ✅ 이번 강의에서 우리는 "id"와 "기본키(Primary key)"를 혼용해서 사용하고 있습니다. 이에 대한 자세한 개념은 나중에 살펴볼 데이터 프레임(DataFrames)에 적용됩니다. 데이터 프레임(DataFrames)이 "기본 키"라는 용어를 사용하지는 않지만, 동일한 방식인 것을 알 수 있습니다.
도시 테이블이 생성되었으니, 강우량 테이블을 만들어 보겠습니다. 도시에 대한 전체 정보를 가져오는 대신, 이제 우리는 id를 사용할 수 있습니다. 모든 테이블은 id 또는 기본 키를 가져야 하므로, 새로 생성되는 테이블도 *id* 열을 가져야 합니다.
### 강수량
| rainfall_id | city_id | Year | Amount |
| ----------- | ------- | ---- | ------ |
| 1 | 1 | 2018 | 1445 |
| 2 | 1 | 2019 | 1874 |
| 3 | 1 | 2020 | 1690 |
| 4 | 2 | 2018 | 1779 |
| 5 | 2 | 2019 | 1111 |
| 6 | 2 | 2020 | 1683 |
| 7 | 3 | 2018 | 1386 |
| 8 | 3 | 2019 | 942 |
| 9 | 3 | 2020 | 1176 |
새롭게 생성된 **강수량** 테이블의 **city_id** 열이 추가 되었습니다. 이 열은 **cities** 테이블의 참조 값(reference id)을 나타냅니다. 기술적 용어로 이것을, **외래키**(foreign key)라고 부릅니다; 이는 다른 테이블의 기본키입니다. 참조나 포인터의 개념이라고 생각할 수 있습니다. **city_id** 1은 Tokyo를 참조합니다.
> ✅ 외래키(Foreign key)는 주로 FK라고 약칭합니다.
## 데이터 조회
데이터가 두개의 테이블로 분리되어 있을때는, 어떻게 데이터를 검색할까요?. 만약 우리가 MYSQL, SQL Server, Oracle과 같은 관계형 데이터베이스를 사용하는 경우, 우리는 구조화된 질의언어 혹은 SQL을 사용할 수 있습니다 . SQL("에스큐엘"이라고 발음된다.)은 관계형 데이터베이스에서 데이터를 검색하고 수정하는 데 사용되는 표준 언어입니다.
데이터를 검색할 때는 `SELECT` 명령어를 사용합니다. 핵심은 데이터가 담긴 테이블에서(**from**) 찾고자 하는 열을 검색(**select**)하는 것입니다. 만약 도시의 이름만 보이고 싶다면, 다음 내용을 따라하세요:
```sql
SELECT city
FROM cities;
-- Output:
-- Tokyo
-- Atlanta
-- Auckland
```
`SELECT`는 열의 집합이라면, `FROM`은 테이블의 집합이라고 할 수 있습니다.
> [주의] SQL 문법은 대소문자를 구분하지 않으며, `select``SELECT`는 서로 같습니다. 그러나, 데이터베이스의 타입에 따라 열과 테이블은 대소문자를 구분할 수도 있습니다. 따라서, 대소문자를 구분해 프로그래밍하는 것이 좋습니다. SQL 쿼리를 작성할 때 키워드를 대문자로 적는 것이 원칙입니다.
위의 예시 쿼리는 모든 도시를 나타냅니다. 여기서 뉴질랜드(New Zealand)의 도시만 보여주고 싶다면 어떻게 할까요? 사용할 키워드는 `WHERE`, 혹은 "where something is true" 입니다.
```sql
SELECT city
FROM cities
WHERE country = 'New Zealand';
-- Output:
-- Auckland
```
## 데이터 조인
우리는 이전까지 단일 테이블에서 데이터를 검색했습니다. 이제 도시(**city**)와 강수량(**rainfall**)의 데이터를 하나로 통합해 보여주려 합니다. 이것은 데이터 *조인*을 통해서 할 수 있습니다. 데이터 조인은 두개의 다른 테이블의 열을 일치시킴으로써 효과적으로 이어줍니다.
예를들어, 강수량(**rainfall**) 테이블의 **city_id** 열과 도시(**city**) 테이블의 **city_id** 열을 매칭할 수 있습니다. 조인을 통해 각 도시들과 그에 맞는 강수량을 매칭할 것입니다. 여러 조인의 종류 중에서 먼저 다룰 것은 *inner* 조인입니다. *inner* 조인은 테이블간의 행이 정확하게 일치하지 않으면 표시되지 않습니다. 위의 예시의 경우 모든 도시에 비가 내리므로, 모든 행이 표시될 것입니다.
그렇다면 모든 도시의 2019년 강수량을 보겠습니다.
첫번째로 이전에 강조했던 **city_id** 열을 매칭해 데이터를 결합하겠습니다.
```sql
SELECT cities.city
rainfall.amount
FROM cities
INNER JOIN rainfall ON cities.city_id = rainfall.city_id
```
같은 **city_id**값과 함께 테이블 명을 명시함으로써, 테이블 조인에 핵심적인 열을 강조했습니다. 이제 `WHERE` 구문을 추가해 2019년만 검색해 보겠습니다.
```sql
SELECT cities.city
rainfall.amount
FROM cities
INNER JOIN rainfall ON cities.city_id = rainfall.city_id
WHERE rainfall.year = 2019
-- Output
-- city | amount
-- -------- | ------
-- Tokyo | 1874
-- Atlanta | 1111
-- Auckland | 942
```
## 요약
관계형 데이터 베이스는 여러 테이블 간에 정보를 분산시키며, 데이터 분석과 검색을 위해 결합됩니다. 계산을 수행할때나 조작할때 높은 유연성을 보장하는 것이 장점입니다. 지금까지 관계형 데이터베이스의 핵심 개념과 두 테이블 간의 조인을 수행하는 방법을 살펴보았습니다.
## 🚀 챌린지
인터넷에는 수많은 관계형 데이터베이스가 있습니다. 위에서 배운 내용과 기술을 토대로 이제 데이터를 자유롭게 다룰 수 있습니다.
## 강의 후 퀴즈
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/9)
## 리뷰 & 복습
[Microsoft 학습](https://docs.microsoft.com/learn?WT.mc_id=academic-40229-cxa)에 SQL 및 관계형 데이터베이스 개념에 대한 학습을 계속할 수 있는 자료들이 있습니다.
- [관계형 데이터의 개념 설명](https://docs.microsoft.com//learn/modules/describe-concepts-of-relational-data?WT.mc_id=academic-40229-cxa)
- [Transact-SQL로 시작하는 쿼리](https://docs.microsoft.com//learn/paths/get-started-querying-with-transact-sql?WT.mc_id=academic-40229-cxa) (Transact-SQL SQL의 버전이다.)
- [Microsoft 학습의 SQL 콘텐츠](https://docs.microsoft.com/learn/browse/?products=azure-sql-database%2Csql-server&expanded=azure&WT.mc_id=academic-40229-cxa)
## 과제
[과제](assignment.md)

@ -0,0 +1,149 @@
# 데이터 처리: 비-관계형 데이터
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../sketchnotes/06-NoSQL.png)|
|:---:|
|데이터 처리: NoSQL 데이터 - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/10)
데이터는 관계형 데이터베이스에만 국한되지 않습니다. 이 과정을 통해 비-관계형 데이터에 초점을 맞춰 스프레드시트와 NoSQL의 기초에 대해 설명하겠습니다.
## 스프레드시트
스프레드시트는 설정 및 시작에 필요한 작업량이 적기 때문에 데이터를 저장하거나 탐색하는 일반적인 방법입니다. 이 과정에서는 공식 및 함수뿐만 아니라 스프레드시트의 기본 구성요소에 대해 알아보겠습니다. 예시들은 Microsoft Excel에서 다룰 것이며, 대부분의 다른 스프레드시트 소프트웨어 또한 유사한 이름과 단계들을 가지고 있습니다.
![An empty Microsoft Excel workbook with two worksheets](../images/parts-of-spreadsheet.png)
스프레드시트는 하나의 파일이며, 컴퓨터, 장치, 클라우드 기반 파일 시스템에서 접근할 수 있습니다. 소프트웨어 자체로써 브라우저 기반이거나 컴퓨터나 앱에서 다운로드해야 하는 응용 프로그램일 수도 있습니다. 엑셀에서 이러한 파일은 **워크북**이라고 정의되며, 이 과정의 나머지 부분에서 다시 설명하도록 하겠습니다.
워크북은 하나 이상의 **워크시트**가 포함되며, 각 워크시트에는 탭으로 레이블이 지정됩니다. 워크시트에는 **셀**이라 불리는 사각형이 있고, 실제 데이터가 여기에 들어가게 됩니다. 셀은 행과 열의 교차하며 열에는 알파벳 문자의 레이블, 행에는 숫자 레이블이 지정됩니다. 일부 스프레드시트는 처음 몇 행에 셀의 데이터를 설명하는 머릿글이 위치할 수도 있습니다.
엑셀 워크북의 기본 요소를 사용하며 스프레드시트의 몇가지 추가적인 기능을 살펴보기 위해서, 재고를 다루는 [마이크로소프트 템플릿](https://templates.office.com/)에서 제공하는 몇 가지 예제를 사용하겠습니다.
### 재고 관리
"재고 예시"라는 스프레드시트 파일은 세 개의 워크시트를 가지고 있는 재고 목록의 형식화된 스프레드시트입니다. 탭에는 "재고 목록", "선택한 재고 목록", "Bin 조회" 레이블을 가지고 있습니다. 재고 목록 워크시트의 4행은 각 셀의 값을 설명하는 머리글입니다.
![A highlighted formula from an example inventory list in Microsoft Excel](../images/formula-excel.png)
위의 예시 중 어떤 셀은 값을 생성하기 위해 다른 셀의 값에 의존하기도 합니다. 재고 목록 스프레드시트는 재고에 대한 단가는 가지고 있지만, 만약 우리가 재고의 전체적인 비용을 알아야 한다면 어떻게 할까? 이 예에서 [**공식**](https://support.microsoft.com/en-us/office/overview-of-formulas-34519a4e-1e8d-4f4b-84d4-d642c4f63263) 셀 데이터에 대해 계산을 수행하고 재고 비용을 계산하는 데 사용됩니다. 이 스프레드시트는 재고 비용 열의 공식을 사용해 QTY 헤더에 따른 수량과 COST 헤더에 따른 단가를 곱해 각 항목의 값을 계산했습니다. 셀을 두 번 클릭하거나 강조 표시하면 공식이 표시됩니다. 공식은 등호 다음에 계산 또는 연산으로 시작합니다.
![A highlighted function from an example inventory list in Microsoft Excel](../images/function-excel.png)
우리는 재고 비용의 모든 값을 더한 총 합계를 구하기 위해 다른 공식을 사용할 수도 있습니다. 총 합계를 계산하기 위해 각각의 셀을 추가해 계산할 수도 있지만, 이것은 너무 지루한 작업입니다. 이 같은 문제를 해결하기 위해 엑셀은 [**함수**](https://support.microsoft.com/en-us/office/sum-function-043e1c7d-7726-4e80-8f32-07b23e057f89), 또는 셀 값에 대한 계산을 수행하기 위한 사전에 정의된 공식을 가지고 있습니다. 함수는 이러한 계산을 수행하는 데 필요한 값인 인수가 필요합니다. 함수에 둘 이상의 인수가 필요한 경우, 인수가 특정 순서로 나열되지 않는다면 올바른 값이 도출되지 않을 수 있습니다. 이 예제에서는 SUM 함수를 사용하겠습니다. 재고 값들을 인수로 사용해, 3행 B열(또는 B3)에 나열된 합계를 추가합니다.
## NoSQL
NoSQL은 비관계적 데이터를 저장하는 다양한 방법을 포괄적으로 지칭하는 용어이며, "비SQL", "비-관계적" 또는 "SQL의 확장"으로 해석될 수 있다. 이러한 유형의 데이터베이스 시스템은 4가지 유형으로 분류할 수 있습니다.
![Graphical representation of a key-value data store showing 4 unique numerical keys that are associated with 4 various values](../images/kv-db.png)
> 출처: [Michał Białecki 블로그](https://www.michalbialecki.com/2018/03/18/azure-cosmos-db-key-value-database-cloud/)
[키-값](https://docs.microsoft.com/en-us/azure/architecture/data-guide/big-data/non-relational-data#keyvalue-data-stores) 데이터베이스는 값과 연결된 고유 식별자인 고유 키를 쌍으로 구성합니다. 이러한 쌍들은 해시 함수를 사용하여 [해시 테이블](https://www.hackerearth.com/practice/data-structures/hash-tables/basics-of-hash-tables/tutorial/)에 저장됩니다.
![Graphical representation of a graph data store showing the relationships between people, their interests and locations](../images/graph-db.png)
> 출처: [Microsoft](https://docs.microsoft.com/en-us/azure/cosmos-db/graph/graph-introduction#graph-database-by-example)
[그래프](https://docs.microsoft.com/en-us/azure/architecture/data-guide/big-data/non-relational-data#graph-data-stores) 데이터베이스는 데이터의 관계를 설명하고 노드(node)와 엣지(edge)의 집합으로 표현됩니다. 노드는 학생 또는 은행 명세서처럼 실제 세계에 존재하는 엔티티를 나타냅니다. 엣지는 두 엔티티간의 관계를 나타냅니다. 각 노드와 가장자리는 각각에 대한 추가 정보를 제공하는 속성을 가지고 있습니다.
![Graphical representation of a columnar data store showing a customer database with two column families named Identity and Contact Info](../images/columnar-db.png)
[컬럼 기반](https://docs.microsoft.com/en-us/azure/architecture/data-guide/big-data/non-relational-data#columnar-data-stores) 데이터 스토어는 데이터를 관계형 데이터 구조처럼 열과 행으로 구성하지만, 각 열은 컬럼패밀리(column family)라 불리는 그룹으로 나뉘며, 한 컬럼 아래의 모든 데이터가 관련되 하나의 단위로 검색 및 변경할 수 있습니다.
### Azure Cosmos DB를 사용한 문서 데이터 저장소
[문서](https://docs.microsoft.com/en-us/azure/architecture/data-guide/big-data/non-relational-data#document-data-stores) 데이터 저장소는 키 값 데이터 저장소의 개념을 기반으로 하며, 일련의 필드와 객체로 구성됩니다. 이 섹션에서는 Cosmos DB 에뮬레이터를 사용하여 문서 데이터베이스를 살펴봅니다.
Cosmos DB 데이터베이스는 "Not Only SQL"의 정의에 부합하며, 여기서 Cosmos DB의 문서 데이터베이스는 SQL에 의존하여 데이터를 쿼리합니다. SQL에 대한 [이전 과정](../../05-relational-databases/README.md)에서는 언어의 기본 사항에 대해 설명하며 여기서 동일한 쿼리 중 일부를 문서 데이터베이스에 적용할 수 있습니다. 우리는 컴퓨터에서 로컬로 문서 데이터베이스를 만들고 탐색할 수 있는 Cosmos DB 에뮬레이터를 사용할 것입니다. 에뮬레이터에 관해서는 [이곳](https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator?tabs=ssl-netstd21)에서 더 자세히 알아보세요.
문서는 필드 및 오브젝트 값의 집합으로, 여기서 필드는 오브젝트 값이 나타내는 것을 설명합니다. 아래는 문서의 예시입니다.
```json
{
"firstname": "Eva",
"age": 44,
"id": "8c74a315-aebf-4a16-bb38-2430a9896ce5",
"_rid": "bHwDAPQz8s0BAAAAAAAAAA==",
"_self": "dbs/bHwDAA==/colls/bHwDAPQz8s0=/docs/bHwDAPQz8s0BAAAAAAAAAA==/",
"_etag": "\"00000000-0000-0000-9f95-010a691e01d7\"",
"_attachments": "attachments/",
"_ts": 1630544034
}
```
이 문서의 관심 필드는 `firstname`, `id`, 그리고 `age` 입니다. 밑줄이 있는 나머지 필드는 Cosmos DB에서 생성되었습니다.
#### Cosmos DB 에뮬레이터를 이용한 데이터 탐색
당신은 [이곳](https://aka.ms/cosmosdb-emulator)에서 윈도우 전용 에뮬레이터를 다운로드하여 설치할 수 있습니다. macOS 및 Linux용 에뮬레이터를 실행하는 방법은 이 [설명서](https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator?tabs=ssl-netstd21#run-on-linux-macos)를 참조하세요.
에뮬레이터는 탐색기 보기를 통해 문서를 탐색할 수 있는 브라우저 창을 실행합니다.
![The Explorer view of the Cosmos DB Emulator](../images/cosmosdb-emulator-explorer.png)
다음은 "샘플부터 시작(Start with Sample)"을 클릭하여 샘플DB(SampleDB)라고 불리는 샘플 데이터베이스를
생성합니다. 화살표를 클릭하여 샘플 DB를 확장하게 되면, 컨테이너 안에 있는 문서인 항목들을 모아둔 `사람`이라는 컨테이너가 있습니다. 당신은 이제 `항목` 아래에 있는 4개의 개별문서들을 탐색할 수 있습니다.
![Exploring sample data in the Cosmos DB Emulator](../images/cosmosdb-emulator-persons.png)
#### Cosmos DB 에뮬레이터를 사용한 문서 데이터 쿼리
우리는 또한 새로운 SQL Query 버튼(왼쪽에서 2번째 버튼)을 클릭하여 샘플 데이터를 조회할 수 있습니다.
`SELECT * FROM c` 는 컨테이너에 있는 모든 문서를 반환합니다. `WHERE` 절을 추가하고 40세 이하의 모든 사람을 찾아봅시다!
`SELECT * FROM c where c.age < 40`
![Running a SELECT query on sample data in the Cosmos DB Emulator to find documents that have an age field value that is less than 40](../images/cosmosdb-emulator-persons-query.png)
이 쿼리는 나이에 대한 값이 40보다 작은 두 개의 문서를 반환합니다.
#### JSON 과 문서들
만약 당신이 JavaScript Object Notation (JSON)에 익숙한 경우 문서가 JSON과 유사하다는 것을 알 수 있습니다. 이 디렉토리에는 `항목 업로드` 버튼을 통해 에뮬레이터의 사용자 컨테이너에 업로드할 수 있는 더 많은 데이터가 포함된 `PersonData.json` 파일이 있습니다.
대부분의 경우 JSON 데이터를 반환하는 API는 문서 데이터 베이스에 직접 전송 및 저장할 수 있습니다. 아래는 트위터 API를 사용하여 검색된 마이크로소프트 트위터 계정의 트윗을 나타낸 문서이며 Cosmos DB에 삽입되었습니다.
```json
{
"created_at": "2021-08-31T19:03:01.000Z",
"id": "1432780985872142341",
"text": "Blank slate. Like this tweet if youve ever painted in Microsoft Paint before. https://t.co/cFeEs8eOPK",
"_rid": "dhAmAIUsA4oHAAAAAAAAAA==",
"_self": "dbs/dhAmAA==/colls/dhAmAIUsA4o=/docs/dhAmAIUsA4oHAAAAAAAAAA==/",
"_etag": "\"00000000-0000-0000-9f84-a0958ad901d7\"",
"_attachments": "attachments/",
"_ts": 1630537000
```
이 문서의 관심 필드는 `created_at`, `id`, 그리고 `text` 입니다.
## 🚀 과제
샘플 DB 데이터베이스에 업로드할 수 있는 `TwitterData.json` 파일이 있습니다. 별도의 컨테이너에 추가하는 것을 추천합니다. 이 작업은 다음에 따라 수행할 수 있습니다.:
1. 오른쪽 상단에 있는 새 컨테이너 버튼을 클릭합니다.
1. 컨테이너에 대한 컨테이너 id 를 작성하는 기존 데이터베이스(Sample DB)를 선택합니다.
1. 파티션 키를 `/id`로 설정합니다.
1. OK(확인)를 클릭합니다.(이 보기의 나머지 정보는 컴퓨터에서 로컬로 실행되는 작은 데이터 집합이므로 무시할 수 있습니다.)
1. 새 컨테이너를 열고 `항목업로드`버튼으로 트위터 데이터 파일을 업로드합니다.
텍스트 필드에 Microsoft가 있는 문서를 찾기 위해 몇 가지 쿼리를 실행해 보십시오. 힌트: [LIKE 키워드](https://docs.microsoft.com/en-us/azure/cosmos-db/sql/sql-query-keywords#using-like-with-the--wildcard-character)를 사용해 보십시오.
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/11)
## 리뷰 & 복습
- 이 과정에서는 다루지 않는 일부 추가 형식 및 기능이 이 스프레드쉬트에 추가되었습니다. 마이크로 소프트는 흥미를 가질만한 엑셀에 대한 [많은 영상과 문서들](https://support.microsoft.com/excel)을 가지고 있습니다.
- 이 아키텍처 문서에는 여러 유형의 비관계형 데이터의 특성이 자세히 나와 있습니다: [비-관계형 데이터와 NoSQL](https://docs.microsoft.com/en-us/azure/architecture/data-guide/big-data/non-relational-data)
- Cosmos DB는 클라우드 기반 비관계형 데이터베이스로, 이 과정에서 언급한 다양한 NoSQL 유형도 저장할 수 있습니다. [Cosmos DB Microsoft 학습 모듈](https://docs.microsoft.com/en-us/learn/paths/work-with-nosql-data-in-azure-cosmos-db/)에서 이러한 유형에 대해 자세히 알아보세요.
## 과제
[탄산음료 수익](assignment.md)

@ -52,7 +52,7 @@ Pandas is centered around a few basic concepts.
### Series
**Series** is a sequence of values, similar to a list or numpy array. The main difference is that series also has and **index**, and when we operate on series (eg., add them), the index is taken into account. Index can be as simple as integer row number (it is the index used by default when creating a series from list or array), or it can have a complex structure, such as date interval.
**Series** is a sequence of values, similar to a list or numpy array. The main difference is that series also has an **index**, and when we operate on series (eg., add them), the index is taken into account. Index can be as simple as integer row number (it is the index used by default when creating a series from list or array), or it can have a complex structure, such as date interval.
> **Note**: There is some introductory Pandas code in the accompanying notebook [`notebook.ipynb`](notebook.ipynb). We only outline some the examples here, and you are definitely welcome to check out the full notebook.

@ -4,7 +4,7 @@ In this assignment, we will ask you to elaborate on the code we have started dev
## COVID-19 Spread Modelling
- [ ] Plot $R_t$ graphs for 5-6 different countries on one plot for comparison, or using several plots side-by-side
- [ ] Plot *R<sub>t</sub>* graphs for 5-6 different countries on one plot for comparison, or using several plots side-by-side
- [ ] See how the number of deaths and recoveries correlate with number of infected cases.
- [ ] Find out how long a typical disease lasts by visually correlating infection rate and deaths rate and looking for some anomalies. You may need to look at different countries to find that out.
- [ ] Calculate the fatality rate and how it changes over time. *You may want to take into account the length of the disease in days to shift one time series before doing calculations*
@ -20,4 +20,4 @@ In this assignment, we will ask you to elaborate on the code we have started dev
Exemplary | Adequate | Needs Improvement
--- | --- | -- |
All tasks are complete, graphically illustrated and explained, including at least one of two stretch goals | More than 5 tasks are complete, no stretch goals are attempted, or the results are not clear | Less than 5 (but more than 3) tasks are complete, visualizations do not help to demonstrate the point
All tasks are complete, graphically illustrated and explained, including at least one of two stretch goals | More than 5 tasks are complete, no stretch goals are attempted, or the results are not clear | Less than 5 (but more than 3) tasks are complete, visualizations do not help to demonstrate the point

@ -2264,7 +2264,7 @@
"\r\n",
"## Computing $R_t$\r\n",
"\r\n",
"To see how infectuous is the disease, we look at the **basic repoduction number** $R_0$, which indicated the number of people that an infected person would further infect. When $R_0$ is more than 1, the epidemic is likely to spread.\r\n",
"To see how infectuous is the disease, we look at the **basic reproduction number** $R_0$, which indicated the number of people that an infected person would further infect. When $R_0$ is more than 1, the epidemic is likely to spread.\r\n",
"\r\n",
"$R_0$ is a property of the disease itself, and does not take into account some protective measures that people may take to slow down the pandemic. During the pandemic progression, we can estimate the reproduction number $R_t$ at any given time $t$. It has been shown that this number can be roughly estimated by taking a window of 8 days, and computing $$R_t=\\frac{I_{t-7}+I_{t-6}+I_{t-5}+I_{t-4}}{I_{t-3}+I_{t-2}+I_{t-1}+I_t}$$\r\n",
"where $I_t$ is the number of newly infected individuals on day $t$.\r\n",
@ -2447,4 +2447,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

@ -31,9 +31,9 @@
"\r\n",
"**NOTE**: We do not provide a copy of the dataset as part of this repository. You may first need to download the [`metadata.csv`](https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge?select=metadata.csv) file from [this dataset on Kaggle](https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge). Registration with Kaggle may be required. You may also download the dataset without registration [from here](https://ai2-semanticscholar-cord-19.s3-us-west-2.amazonaws.com/historical_releases.html), but it will include all full texts in addition to metadata file.\r\n",
"\r\n",
"We will try to get the data directly from online source, however, if it fails, you need to download the data as described above. Also, it makese sense to download the data if you plan to experiment with it further, to save on waiting time.\r\n",
"We will try to get the data directly from online source, however, if it fails, you need to download the data as described above. Also, it makes sense to download the data if you plan to experiment with it further, to save on waiting time.\r\n",
"\r\n",
"> **NOTE** that dataset is quite large, aroung 1 Gb in size, and the following line of code can take a long time to complete! (~5 mins)"
"> **NOTE** that dataset is quite large, around 1 Gb in size, and the following line of code can take a long time to complete! (~5 mins)"
],
"metadata": {}
},
@ -2332,4 +2332,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

@ -1312,7 +1312,7 @@
"source": [
"## Printing and Plotting\r\n",
"\r\n",
"Data Scientist often has to explore the data, thus it is important to be able to visualize it. When DataFrame is big, manytimes we want just to make sure we are doing everything correctly by printing out the first few rows. This can be done by calling `df.head()`. If you are running it from Jupyter Notebook, it will print out the DataFrame in a nice tabular form."
"Data Scientist often has to explore the data, thus it is important to be able to visualize it. When DataFrame is big, many times we want just to make sure we are doing everything correctly by printing out the first few rows. This can be done by calling `df.head()`. If you are running it from Jupyter Notebook, it will print out the DataFrame in a nice tabular form."
],
"metadata": {}
},
@ -1496,4 +1496,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

@ -0,0 +1,284 @@
# 데이터 처리: Python and Panda 라이브러리
| ![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../sketchnotes/07-WorkWithPython.png) |
| :-------------------------------------------------------------------------------------------------------: |
| 데이터처리: 파이썬(python) - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
[![Intro Video](../images/video-ds-python.png)](https://youtu.be/dZjWOGbsN4Y)
데이터베이스가 질의 언어를 사용하여 데이터를 저장하고 쿼리하는 매우 효율적인 방법을 제공하지만, 데이터 처리의 가장 유연한 방법은 데이터를 조작하기 위해 자신만의 프로그램을 작성하는 것입니다. 대부분의 경우 데이터베이스 쿼리를 수행하는 것이 더 효과적인 방법입니다. 그러나 더 복잡한 데이터 처리가 필요한 경우 SQL을 사용하여 쉽게 처리할 수 없습니다.
데이터 처리는 어떤 프로그래밍 언어로도 프로그래밍이 가능하지만, 데이터 작업에 있어서 더 유용한 언어가 있습니다. 데이터 과학자는 일반적으로 다음 언어 중 하나를 선호합니다:
* **[Python(파이썬)](https://www.python.org/)** 은 범용 프로그래밍 언어로 간단하기 때문에 초보자를 위한 최고의 선택지 중 하나입니다. 파이썬(python)에는 ZIP 아카이브에서 데이터를 추출하거나 그림을 흑백으로 변환하는 것과 같은 실제 문제를 해결하는 데 도움이 되는 많은 추가 라이브러리가 존재합니다. 게다가, 데이터 과학 외에도 파이썬은 웹 개발에도 많이 사용됩니다.
* **[R(알)](https://www.r-project.org/)** 은 통계 데이터 처리를 염두에 두고 개발된 전통적인 도구 상자입니다. 또한 대규모 라이브러리 저장소(CRAN)를 포함하고 있어 데이터 처리에 적합합니다. 그러나, R은 범용 프로그래밍 언어가 아니며 데이터 과학 영역 밖에서는 거의 사용되지 않습니다.
* **[Julia(줄리아)](https://julialang.org/)** 데이터 과학을 위해 특별히 개발된 또 다른 언어이다. 이것은 파이썬보다 더 나은 성능을 제공하기 위한 것으로 과학 실험을 위한 훌륭한 도구입니다.
이 과정에서는 간단한 데이터 처리를 위해 파이썬을 사용하는 것에 초점을 맞출 것입니다. 사전에 파이썬에 익숙해질 필요가 있습니다. 파이썬에 대해 더 자세히 살펴보고 싶다면 다음 리소스 중 하나를 참조할 수 있습니다:
* [Turtle Graphics와 Fractal로 Python을 재미있게 배우기](https://github.com/shwars/pycourse) - GitHub 기반 Python 프로그래밍에 대한 빠른 소개 과정
* [Python으로 첫 걸음 내딛기](https://docs.microsoft.com/en-us/learn/paths/python-first-steps/?WT.mc_id=academic-31812-dmitryso) - [Microsoft 학습](http://learn.microsoft.com/?WT.mc_id=academic-31812-dmitryso)으로 이동하기
데이터는 다양한 형태로 나타날 수 있습니다. 이 과정에서 우리는 세 가지 형태의 데이터를 고려할 것입니다. - **표로 나타낸 데이터(tabular data)**, **텍스트(text)** and **이미지(images)**.
모든 관련 라이브러리에 대한 전체 개요를 제공하는 대신 데이터 처리의 몇 가지 예를 중점적으로 살펴보겠습니다. 이를 통해 무엇이 가능한지에 대한 주요 아이디어를 얻을 수 있으며, 필요할 때 문제에 대한 해결책을 찾을 수 있는 방도를 파악할 수 있습니다.
> **유용한 Tip**. 방법을 모르는 데이터에 대해 특정 작업을 수행해야 할 경우 인터넷에서 검색해 보십시오. [스택오버플로우](https://stackoverflow.com/)는 일반적으로 많은 일반적인 작업을 위해 다양한 파이썬의 유용한 코드 샘플을 가지고 있습니다.
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/12)
## 표 형식 데이터 및 데이터 프레임
이전에 관계형 데이터베이스에 대해 이야기할 때 이미 표 형식의 데이터를 다뤘습니다. 데이터가 많고 다양한 테이블이 연결된 경우 SQL을 사용하여 작업하는 것이 좋습니다. 그러나, 데이터 테이블을 가질 때 많은 경우들이 있으며, 우리는 분포, 값들 사이의 상관관계 등과 같이 데이터 자체에 대한 조금의 **이해**나 **통찰력**을 얻을 필요가 있습니다. 데이터 과학에서는 원본 데이터의 일부 변환을 수행한 후 시각화를 수행해야 하는 경우가 많습니다. 이 두 단계는 파이썬을 사용하면 쉽게 수행할 수 있습니다.
파이썬에는 표 형식의 데이터를 처리하는 데 도움이 되는 두 가지 가장 유용한 라이브러리가 있습니다:
* **[Pandas](https://pandas.pydata.org/)** 를 사용하면 관계형 테이블과 유사한 이른바 **데이터 프레임**을 조작할 수 있습니다. 명명된 컬럼을 가질 수 있으며 일반적으로 행,열 및 데이터 프레임에 대해 다양한 작업을 수행할 수 있습니다.
* **[Numpy](https://numpy.org/)** 는 **tensors(텐서)** 작업을 위한 라이브러리 입니다. (예: 다차원 **배열**). 배열은 동일한 기본 유형의 값을 가지며 데이터 프레임보다 간단하지만, 더 많은 수학적 연산을 제공하고 오버헤드를 덜 발생시킵니다.
또한 알아야 할 몇 개의 또 다른 라이브러리들도 있습니다:
* **[Matplotlib](https://matplotlib.org/)** 은 데이터 시각화 및 플롯 그래프에 사용되는 라이브러리입니다.
* **[SciPy](https://www.scipy.org/)** 는 몇 가지 추가적인 과학적 기능을 가진 라이브러리이다. 우리는 확률과 통계에 대해 이야기할 때 이 라이브러리를 사용합니다.
다음은 파이썬 프로그램 시작 부분에서 이러한 라이브러리를 가져오기 위해 일반적으로 사용하는 코드 일부입니다:
```python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import ... # 필요한 하위 항목을 정확하게 지정해야 합니다.
```
Pandas는 몇 가지 기본적인 개념을 중심으로 합니다.
### 시리즈(Series)
**시리즈(Series)** 은 리스트 또는 numpy 배열과 유사한 일련의 값들입니다. 주요 차이점은 시리즈에도 **색인**이 있고 시리즈에 대해 작업할 때(예: 추가) 인덱스가 고려된다는 것입니다. 인덱스는 정수 행 번호만큼 단순할 수도 있고(목록 또는 배열에서 시리즈를 생성할 때 기본적으로 사용되는 인덱스) 날짜 간격과 같은 복잡한 구조를 가질 수도 있습니다.
> **주의**: 동봉된 [`notebook.ipynb`](notebook.ipynb) 파일에는 몇 가지 Pandas 소개 코드가 있습니다. 여기서는 몇 가지 예시만 간략히 설명하며, 전체 notebook 코드를 확인해 보시기 바랍니다.
예시: 우리는 아이스크림 가게의 매출을 분석하려고 합니다. 일정 기간 동안 일련의 판매 번호(매일 판매되는 품목 수)를 생성해 봅시다.
```python
start_date = "Jan 1, 2020"
end_date = "Mar 31, 2020"
idx = pd.date_range(start_date,end_date)
print(f"Length of index is {len(idx)}")
items_sold = pd.Series(np.random.randint(25,50,size=len(idx)),index=idx)
items_sold.plot()
```
![Time Series Plot](../images/timeseries-1.png)
이제 우리가 매주 친구들을 위한 파티를 준비하고, 파티를 위해 아이스크림 10팩을 추가로 가져간다고 가정해 봅시다. 이것을 증명하기 위해 주간별로 색인화된 또 다른 시리즈를 만들 수 있습니다:
```python
additional_items = pd.Series(10,index=pd.date_range(start_date,end_date,freq="W"))
```
두 시리즈를 더하면 총 갯수(total_items)가 나온다:
```python
total_items = items_sold.add(additional_items,fill_value=0)
total_items.plot()
```
![Time Series Plot](../images/timeseries-2.png)
> **주의** 지금까지 우리는 `total_control+control_control_control` 이라는 간단한 구문을 사용하지 않고 있습니다. 그랬다면 결과 시리즈에서 많은 `NaN` (*숫자가 아님*) 값을 받았을 것입니다. 이는 `additional_items` 시리즈의 일부 인덱스 포인트에 누락된 값이 있고 항목에 `Nan`을 추가하면 `NaN`이 되기 때문입니다. 따라서 추가하는 동안 'fill_value' 매개변수를 지정해야 합니다.
시계열을 사용하면 다른 시간 간격으로 시리즈를 **리샘플링(resample)**할 수도 있습니다. 예를 들어, 월별 평균 판매량을 계산하려고 한다고 가정합니다. 다음 코드를 사용할 수 있습니다:
```python
monthly = total_items.resample("1M").mean()
ax = monthly.plot(kind='bar')
```
![Monthly Time Series Averages](../images/timeseries-3.png)
### 데이터프레임(DataFrame)
데이터프레임(DataFrame)은 기본적으로 동일한 인덱스를 가진 시리즈 모음입니다. 여러 시리즈를 DataFrame으로 결합할 수 있습니다:
```python
a = pd.Series(range(1,10))
b = pd.Series(["I","like","to","play","games","and","will","not","change"],index=range(0,9))
df = pd.DataFrame([a,b])
```
이렇게 하면 다음과 같은 가로 테이블이 생성됩니다:
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| --- | --- | ---- | --- | --- | ------ | --- | ------ | ---- | ---- |
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 1 | I | like | to | use | Python | and | Pandas | very | much |
시리즈를 열로 사용하고 딕셔너리(Dictionary)를 사용하여 열 이름을 지정할 수도 있습니다:
```python
df = pd.DataFrame({ 'A' : a, 'B' : b })
```
위의 코드는 다음과 같은 테이블을 얻을 수 있습니다:
| | A | B |
| --- | --- | ------ |
| 0 | 1 | I |
| 1 | 2 | like |
| 2 | 3 | to |
| 3 | 4 | use |
| 4 | 5 | Python |
| 5 | 6 | and |
| 6 | 7 | Pandas |
| 7 | 8 | very |
| 8 | 9 | much |
**주의** 또한 이전 표를 바꿔서 이 같은 표 레이아웃을 얻을 수 있습니다.
```python
df = pd.DataFrame([a,b]).T..rename(columns={ 0 : 'A', 1 : 'B' })
```
여기서 `.T`는 행과 열을 변경하는 DataFrame을 전치하는 작업, 즉 행과 열을 변경하는 작업을 의미하며 `rename` 작업을 사용하면 이전 예제와 일치하도록 열 이름을 바꿀 수 있습니다.
다음은 DataFrame에서 수행할 수 있는 몇 가지 가장 중요한 작업입니다:
**특정 컬럼 선택(Column selection)**. `df['A']`를 작성하여 개별 열을 선택할 수 있습니다. 이 작업은 시리즈를 반환합니다. 또한 `df[['B','A']]`를 작성하여 열의 하위 집합을 다른 DataFrame으로 선택할 수 있습니다. 그러면 다른 DataFrame이 반환됩니다.
**필터링(Filtering)** 은 기준에 따라 특정 행만 적용합니다. 예를 들어 `A` 열이 5보다 큰 행만 남기려면 `df[df['A']>5]`라고 쓸 수 있습니다.
> **주의**: 필터링이 작동하는 방식은 다음과 같습니다. 표현식 `df['A']<5`는 원래 시리즈 `df['A']`의 각 요소에 대해 표현식이 `True`인지 아니면 `False`인지를 나타내는 `부울(Boolean)` 시리즈를 반환합니다. 부울 계열이 인덱스로 사용되면 DataFrame에서 행의 하위 집합을 반환합니다. 따라서 임의의 Python 부울 표현식을 사용할 수 없습니다. 예를 들어 `df[df['A']>5 및 df['A']<7]`를 작성하는 것은 잘못된 것입니다. 대신, 부울 계열에 특수 `&` 연산을 사용하여 `df[(df['A']>5) & (df['A']<7)]`로 작성해야 합니다(*여기서 대괄호가 중요합니다*).
**새로운 계산 가능한 열 만들기**. 우리는 직관적인 표현을 사용하여 DataFrame에 대한 새로운 계산 가능한 열을 쉽게 만들 수 있습니다.:
```python
df['DivA'] = df['A']-df['A'].mean()
```
이 예제에서는 평균값으로부터 A의 차이를 계산합니다. 여기서 실제로 발생하는 일은 열을 계산하고 왼쪽에 이 열을 할당하여 다른 열을 만드는 것입니다. 따라서 시리즈와 호환되지 않는 연산은 사용할 수 없습니다. 예를 들어 아래와 같은 코드는 잘못되었습니다.:
```python
# 잘못된 코드 -> df['ADescr'] = "Low" if df['A'] < 5 else "Hi"
df['LenB'] = len(df['B']) # <-
```
위의 예제는 문법적으로는 정확하지만, 우리가 의도한 대로 개별 요소의 길이가 아니라 열의 모든 값에 시리즈 `B`의 길이를 할당하기 때문에 잘못된 결과를 도출합니다.
이와 같이 복잡한 표현식을 계산해야 하는 경우 `apply` 함수를 사용할 수 있습니다. 마지막 예제는 다음과 같이 작성할 수 있습니다:
```python
df['LenB'] = df['B'].apply(lambda x : len(x))
# or
df['LenB'] = df['B'].apply(len)
```
위의 작업 후에 다음과 같은 DataFrame이 완성됩니다:
| | A | B | DivA | LenB |
| --- | --- | ------ | ---- | ---- |
| 0 | 1 | I | -4.0 | 1 |
| 1 | 2 | like | -3.0 | 4 |
| 2 | 3 | to | -2.0 | 2 |
| 3 | 4 | use | -1.0 | 3 |
| 4 | 5 | Python | 0.0 | 6 |
| 5 | 6 | and | 1.0 | 3 |
| 6 | 7 | Pandas | 2.0 | 6 |
| 7 | 8 | very | 3.0 | 4 |
| 8 | 9 | much | 4.0 | 4 |
**숫자를 기준으로 행 선택** `iloc(정수 위치:integer location)` 구성을 사용하여 수행할 수 있습니다. 예를 들어 DataFrame에서 처음 5개 행을 선택하려면:
```python
df.iloc[:5]
```
**그룹화(Grouping)** 는 종종 Excel의 *피벗 테이블*과 유사한 결과를 얻는 데 사용됩니다. 주어진 `LenB` 수에 대해 `A` 열의 평균 값을 계산하려고 한다고 가정합니다. 그런 다음 `LenB`로 DataFrame을 그룹화하고 `mean`을 호출할 수 있습니다:
```python
df.groupby(by='LenB').mean()
```
그룹의 요소 수와 평균을 계산해야 하는 경우 더 복잡한 `집계(aggregate)` 함수를 사용할 수 있습니다:
```python
df.groupby(by='LenB') \
.aggregate({ 'DivA' : len, 'A' : lambda x: x.mean() }) \
.rename(columns={ 'DivA' : 'Count', 'A' : 'Mean'})
```
This gives us the following table:
| LenB | Count | Mean |
| ---- | ----- | -------- |
| 1 | 1 | 1.000000 |
| 2 | 1 | 3.000000 |
| 3 | 2 | 5.000000 |
| 4 | 3 | 6.333333 |
| 6 | 2 | 6.000000 |
### 데이터 얻기
우리는 Python 객체에서 시리즈 및 DataFrame을 구성하는 것이 얼마나 쉬운지 보았습니다. 그러나 데이터는 일반적으로 텍스트 파일 또는 Excel 표의 형태로 제공됩니다. 운 좋게도 Pandas는 디스크에서 데이터를 로드하는 간단한 방법을 제공합니다. 예를 들어 CSV 파일을 읽는 것은 다음과 같이 간단합니다:
```python
df = pd.read_csv('file.csv')
```
"도전(Channenge)" 섹션에서 외부 웹 사이트에서 가져오기를 포함하여 데이터를 로드하는 더 많은 예를 볼 수 있습니다.
### 출력(Printing) 및 플로팅(Plotting)
데이터 과학자는 종종 데이터를 탐색해야 하므로 시각화할 수 있는 것이 중요합니다. DataFrame이 클 때 처음 몇 행을 인쇄하여 모든 작업을 올바르게 수행하고 있는지 확인하려는 경우가 많습니다. 이것은 `df.head()`를 호출하여 수행할 수 있습니다. Jupyter Notebook에서 실행하는 경우 DataFrame을 멋진 표 형식으로 인쇄합니다.
또한 일부 열을 시각화하기 위해 'plot' 함수를 사용하는 것을 보았습니다. `plot`은 많은 작업에 매우 유용하고 `kind=` 매개변수를 통해 다양한 그래프 유형을 지원하지만, 항상 원시 `matplotlib` 라이브러리를 사용하여 더 복잡한 것을 그릴 수 있습니다. 데이터 시각화는 별도의 강의에서 자세히 다룰 것입니다.
이 개요는 Pandas의 가장 중요한 개념을 다루지만 Pandas 라이브러리는 매우 풍부하고 이를 사용하여 수행할 수 있는 작업은 무궁무진합니다! 이제 특정 문제를 해결하기 위해 배운 것을 적용해 보겠습니다.
## 🚀 도전과제 1: 코로나 확산 분석
우리가 초점을 맞출 첫 번째 문제는 COVID-19의 전염병 확산 모델링입니다. 이를 위해 [존 홉킨스 대학](https://jhu.edu/)의 [시스템 과학 및 엔지니어링 센터](https://systems.jhu.edu/)(CSSE)에서 제공하는 여러 국가의 감염자 수 데이터를 사용합니다. 이 [GitHub 레포지토리](https://github.com/CSSEGISandData/COVID-19)에서 데이터 세트를 사용할 수 있습니다.
데이터를 다루는 방법을 보여주고 싶기 때문에 `notebook-covidspread.ipynb`(notebook-covidspread.ipynb)를 열고 위에서 아래로 읽으시기 바랍니다. 셀을 실행할 수도 있고 마지막에 남겨둔 몇 가지 과제를 수행할 수도 있습니다.
![COVID Spread](../images/covidspread.png)
> Jupyter Notebook에서 코드를 실행하는 방법을 모르는 경우 [이 기사](https://soshnikov.com/education/how-to-execute-notebooks-from-github/)를 참조하십시오.
## 비정형 데이터 작업
데이터가 표 형식으로 제공되는 경우가 많지만 경우에 따라 텍스트나 이미지와 같이 덜 구조화된 데이터를 처리해야 합니다. 이 경우 위에서 본 데이터 처리 기술을 적용하려면 어떻게든 구조화된 데이터를 **추출(extract)** 해야 합니다. 다음은 몇 가지 예시입니다:
* 텍스트에서 키워드 추출 및 해당 키워드가 나타나는 빈도 확인
* 신경망을 사용하여 그림의 개체에 대한 정보 추출
* 비디오 카메라 피드에서 사람들의 감정에 대한 정보 얻기
## 🚀 도전과제 2: 코로나 논문 분석
이 도전과제에서 우리는 COVID 팬데믹이라는 주제를 계속해서 다룰 것이며 해당 주제에 대한 과학 논문을 처리하는 데 집중할 것입니다. 메타데이터 및 초록과 함께 사용할 수 있는 COVID에 대한 7000개 이상의(작성 당시) 논문이 포함된 [CORD-19 데이터 세트](https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge)가 있습니다(이 중 약 절반에 대해 전체 텍스트도 제공됨).
[건강 인지 서비스를 위한 텍스트 분석](https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health/?WT.mc_id=academic-31812-dmitryso)를 사용하여 이 데이터 세트를 분석하는 전체 예는 이 블로그 게시물에 설명되어 있습니다. 우리는 이 분석의 단순화된 버전에 대해 논의할 것입니다.
> **주의**: 우리는 더이상 데이터 세트의 복사본을 이 리포지토리의 일부로 제공하지 않습니다. 먼저 [Kaggle의 데이터세트](https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge)에서 [`metadata.csv`](https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge?select=metadata.csv) 파일을 다운로드해야 할 수도 있습니다. Kaggle에 가입해야 할 수 있습니다. [여기](https://ai2-semanticscholar-cord-19.s3-us-west-2.amazonaws.com/historical_releases.html)에서 등록 없이 데이터 세트를 다운로드할 수도 있지만 여기에는 메타데이터 파일 외에 모든 전체 텍스트가 포함됩니다.
[`notebook-papers.ipynb`](notebook-papers.ipynb)를 열고 위에서 아래로 읽으십시오. 셀을 실행할 수도 있고 마지막에 남겨둔 몇 가지 과제를 수행할 수도 있습니다.
![Covid Medical Treatment](../images/covidtreat.png)
## 이미지 데이터 처리
최근에는 이미지를 이해할 수 있는 매우 강력한 AI 모델이 개발되었습니다. 사전에 훈련된 신경망이나 클라우드 서비스를 사용하여 해결할 수 있는 작업이 많이 있습니다. 몇 가지 예는 다음과 같습니다:
* **이미지 분류(Image Classification)** 는 이미지를 미리 정의된 클래스 중 하나로 분류하는 데 도움이 됩니다. [Custom Vision](https://azure.microsoft.com/services/cognitive-services/custom-vision-service/?WT.mc_id=academic-31812-dmitryso)과 같은 서비스를 사용하여 자신의 이미지 분류기를 쉽게 훈련할 수 있습니다.
* **물체 검출** 은 이미지에서 다른 물체를 감지합니다. [컴퓨터 비전(Computer vision)](https://azure.microsoft.com/services/cognitive-services/computer-vision/?WT.mc_id=academic-31812-dmitryso)과 같은 서비스는 여러 일반 개체를 감지할 수 있으며 [커스텀 비전(Custom Vision)](https://azure.microsoft.com/services/cognitive-services/custom-vision-service/?WT.mc_id=academic-31812-dmitryso) 모델을 훈련하여 관심 있는 특정 개체를 감지할 수 있습니다.
* **얼굴 인식** 은 연령, 성별 및 감정 감지를 포함합니다. 이것은 [Face API](https://azure.microsoft.com/services/cognitive-services/face/?WT.mc_id=academic-31812-dmitryso)를 통해 수행할 수 있습니다.
이러한 모든 클라우드 서비스는 [Python SDK](https://docs.microsoft.com/samples/azure-samples/cognitive-services-python-sdk-samples/cognitive-services-python-sdk-samples/?WT.mc_id=academic-31812-dmitryso)를 사용하여 호출할 수 있으므로, 데이터 탐색 워크플로에 쉽게 통합할 수 있습니다.
다음은 이미지 데이터 소스에서 데이터를 탐색하는 몇 가지 예입니다:
* 블로그 게시물 중 [코딩 없이 데이터 과학을 배우는 방법](https://soshnikov.com/azure/how-to-learn-data-science-without-coding/)에서 우리는 인스타그램 사진을 살펴보고 사람들이 사진에 더 많은 좋아요를 주는 이유를 이해하려고 합니다. 먼저 [컴퓨터 비전(Computer vision)](https://azure.microsoft.com/services/cognitive-services/computer-vision/?WT.mc_id=academic-31812-dmitryso)을 사용하여 사진에서 최대한 많은 정보를 추출한 다음 [Azure Machine Learning AutoML](https://docs.microsoft.com/azure/machine-learning/concept-automated-ml/?WT.mc_id=academic-31812-dmitryso)을 사용하여 해석 가능한 모델을 빌드합니다.
* [얼굴 연구 워크숍(Facial Studies Workshop)](https://github.com/CloudAdvocacy/FaceStudies)에서는 사람들을 행복하게 만드는 요소를 이해하고자, 이벤트에서 사진에 있는 사람들의 감정을 추출하기 위해 [Face API](https://azure.microsoft.com/services/cognitive-services/face/?WT.mc_id=academic-31812-dmitryso)를 사용합니다.
## 결론
이미 정형 데이터이든 비정형 데이터이든 관계없이 Python을 사용하여 데이터 처리 및 이해와 관련된 모든 단계를 수행할 수 있습니다. 아마도 가장 유연한 데이터 처리 방법일 것이며, 이것이 대부분의 데이터 과학자들이 Python을 기본 도구로 사용하는 이유입니다. 데이터 과학 여정에 대해 진지하게 생각하고 있다면 Python을 깊이 있게 배우는 것이 좋습니다!
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/13)
## 리뷰 & 복습
**책**
* [Wes McKinney. 데이터 분석을 위한 Python: Pandas, NumPy 및 IPython을 사용한 데이터 논쟁(Python for Data Analysis: Data Wrangling with Pandas, NumPy, and IPython)](https://www.amazon.com/gp/product/1491957662)
**온라인 자료**
* 공식 [판다까지 10분(10 minutes to Pandas)](https://pandas.pydata.org/pandas-docs/stable/user_guide/10min.html) tutorial
* [Pandas 시각화에 대한 문서(Documentation on Pandas Visualization)](https://pandas.pydata.org/pandas-docs/stable/user_guide/visualization.html)
**Python 학습**
* [거북이 그래픽과 도형으로 재미있는 방식으로 파이썬 배우기(Learn Python in a Fun Way with Turtle Graphics and Fractals)](https://github.com/shwars/pycourse)
* [파이썬으로 첫걸음(Take your First Steps with Python)](https://docs.microsoft.com/learn/paths/python-first-steps/?WT.mc_id=academic-31812-dmitryso): 관련 강의 [Microsoft 강의](http://learn.microsoft.com/?WT.mc_id=academic-31812-dmitryso)
## 과제
[Perform more detailed data study for the challenges above](../assignment.md)
## 크레딧
본 레슨은 [Dmitry Soshnikov](http://soshnikov.com)님에 의해 작성되었습니다.

@ -1,23 +0,0 @@
# Tâche: Traitement Des Données en Python
Dans cette tâche, développez le code que nous avons commencé dans nos défis. La tâche a deux sections:
## Modélisation de la Propagation de COVID-19
- [ ] Placez les graphiques $R_t$ de 5-6 pays sur une graphe à comparer, ou mettez plusieurs graphiques côte à côte
- [ ] Voiez comment les nombres des morts et guérisons sont liés aux nombres des infectés
- [ ] Trouvez combien de temps une maladie typique dure en mettre en corrélation le taux de l'infection avex le taux du décès et cherchez les anomalies. Peut-être vous avez besoin de regarder les pays différents à le trouver.
- [ ] Calculez le taux du décès et comment il change au fil du temps. *Il se peut que vous voulez prendre en compte la durée de la maladie en jours alors que vous pouvez déplacer une série chronologique avant de faire les calculs*
## Analyse des Articles COVID-19
- [ ] Build co-occurrence matrix of different medications, and see which medications often occur together (i.e. mentioned in one abstract). You can modify the code for building co-occurrence matrix for medications and diagnoses.
- [ ] Visualize this matrix using heatmap.
- [ ] As a stretch goal, visualize the co-occurrence of medications using [chord diagram](https://en.wikipedia.org/wiki/Chord_diagram). [This library](https://pypi.org/project/chord/) may help you draw a chord diagram.
- [ ] As another stretch goal, extract dosages of different medications (such as **400mg** in *take 400mg of chloroquine daily*) using regular expressions, and build dataframe that shows different dosages for different medications. **Note**: consider numeric values that are in close textual vicinity of the medicine name.
## Rubric
Exemplaire | Acceptable | A Besoin Damélioration
--- | --- | -- |
Chaque tâche est complet, illustré, et expliqué, y compris au moins un des deux objectifs | Plus que 5 tâches sont complets, aucun des objectifs sont essayés, ou les résultats ne sont pas évidents | Moins que 5 (mais plus que 3) tâches sont complets, les illustrations n'expliquent pas l'objectif

@ -24,7 +24,7 @@ Depending on its source, raw data may contain some inconsistencies that will cau
- **Formatting**: Depending on the source, data can have inconsistencies in how its presented. This can cause problems in searching for and representing the value, where its seen within the dataset but is not properly represented in visualizations or query results. Common formatting problems involve resolving whitespace, dates, and data types. Resolving formatting issues is typically up to the people who are using the data. For example, standards on how dates and numbers are presented can differ by country.
- **Duplications**: Data that has more than one occurrence can produce inaccurate results and usually should be removed. This can be a common occurrence when joining more two or more datasets together. However, there are instances where duplication in joined datasets contain pieces that can provide additional information and may need to be preserved.
- **Duplications**: Data that has more than one occurrence can produce inaccurate results and usually should be removed. This can be a common occurrence when joining two or more datasets together. However, there are instances where duplication in joined datasets contain pieces that can provide additional information and may need to be preserved.
- **Missing Data**: Missing data can cause inaccuracies as well as weak or biased results. Sometimes these can be resolved by a "reload" of the data, filling in the missing values with computation and code like Python, or simply just removing the value and corresponding data. There are numerous reasons for why data may be missing and the actions that are taken to resolve these missing values can be dependent on how and why they went missing in the first place.
@ -265,7 +265,7 @@ Notice that when a previous value is not available for forward-filling, the null
In addition to missing data, you will often encounter duplicated data in real-world datasets. Fortunately, `pandas` provides an easy means of detecting and removing duplicate entries.
- **Identifying duplicates: `duplicated`**: You can easily spot duplicate values using the `duplicated` method in pandas, which returns a Boolean mask indicating whether an entry in a `DataFrame` is a duplicate of an ealier one. Let's create another example `DataFrame` to see this in action.
- **Identifying duplicates: `duplicated`**: You can easily spot duplicate values using the `duplicated` method in pandas, which returns a Boolean mask indicating whether an entry in a `DataFrame` is a duplicate of an earlier one. Let's create another example `DataFrame` to see this in action.
```python
example4 = pd.DataFrame({'letters': ['A','B'] * 2 + ['B'],
'numbers': [1, 2, 1, 3, 3]})
@ -290,7 +290,7 @@ example4.duplicated()
4 True
dtype: bool
```
- **Dropping duplicates: `drop_duplicates`: `drop_duplicates` simply returns a copy of the data for which all of the `duplicated` values are `False`:
- **Dropping duplicates: `drop_duplicates`:** simply returns a copy of the data for which all of the `duplicated` values are `False`:
```python
example4.drop_duplicates()
```
@ -300,9 +300,9 @@ example4.drop_duplicates()
1 B 2
3 B 3
```
Both `duplicated` and `drop_duplicates` default to consider all columnsm but you can specify that they examine only a subset of columns in your `DataFrame`:
Both `duplicated` and `drop_duplicates` default to consider all columns but you can specify that they examine only a subset of columns in your `DataFrame`:
```python
example6.drop_duplicates(['letters'])
example4.drop_duplicates(['letters'])
```
```
letters numbers
@ -315,7 +315,7 @@ letters numbers
## 🚀 Challenge
All of the discussed materials are provided as a [Jupyter Notebook](https://github.com/microsoft/Data-Science-For-Beginners/blob/main/4-Data-Science-Lifecycle/15-analyzing/notebook.ipynb). Additionally, there are exercises present after each section, give them a try!
All of the discussed materials are provided as a [Jupyter Notebook](https://github.com/microsoft/Data-Science-For-Beginners/blob/main/2-Working-With-Data/08-data-preparation/notebook.ipynb). Additionally, there are exercises present after each section, give them a try!
## [Post-Lecture Quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/15)

@ -12,7 +12,7 @@
"\r\n",
"A client has been testing a [small form](index.html) to gather some basic data about their client-base. They have brought their findings to you to validate the data they have gathered. You can open the `index.html` page in a browser to take a look at the form.\r\n",
"\r\n",
"You have been provided a [dataset of csv records](../../data/form.csv)that contain entries from the form as well as some basic visualizations.The client pointed out that some of the visualizations look incorrect but they're unsure about how to resolve them. You can explore it in the [assignment notebook](assignment.ipynb).\r\n",
"You have been provided a [dataset of csv records](../../data/form.csv) that contain entries from the form as well as some basic visualizations.The client pointed out that some of the visualizations look incorrect but they're unsure about how to resolve them. You can explore it in the [assignment notebook](assignment.ipynb).\r\n",
"\r\n",
"## Instructions\r\n",
"\r\n",
@ -139,4 +139,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

@ -2,7 +2,7 @@
A client has been testing a [small form](index.html) to gather some basic data about their client-base. They have brought their findings to you to validate the data they have gathered. You can open the `index.html` page in the browser to take a look at the form.
You have been provided a [dataset of csv records](../../data/form.csv)that contain entries from the form as well as some basic visualizations.The client pointed out that some of the visualizations look incorrect but they're unsure about how to resolve them. You can explore it in the [assignment notebook](assignment.ipynb).
You have been provided a [dataset of csv records](../../data/form.csv) that contain entries from the form as well as some basic visualizations. The client pointed out that some of the visualizations look incorrect but they're unsure about how to resolve them. You can explore it in the [assignment notebook](assignment.ipynb).
## Instructions

@ -692,12 +692,6 @@
}
]
"execution_count": 6
}
],
"metadata": {
"trusted": false
}
},
{
@ -820,13 +814,6 @@
}
]
"execution_count": 9
}
],
"metadata": {
"trusted": false
}
},
{
"cell_type": "markdown",
@ -849,7 +836,6 @@
"outputId": "fa06495a-0930-4867-87c5-6023031ea8b5"
},
"execution_count": 10,
"source": [
"example2 = np.array([2, np.nan, 6, 8]) \n",
@ -870,12 +856,6 @@
"execution_count": 13
}
]
"execution_count": 10
}
],
"metadata": {
"trusted": false
}
},
{
@ -900,12 +880,7 @@
"collapsed": true,
"trusted": false,
"id": "yan3QRaOgRr_"
},
"source": [
"# What happens if you add np.nan and None together?\n"
],
"execution_count": 14,
"outputs": []
}
},
{
"cell_type": "markdown",
@ -1590,13 +1565,7 @@
"collapsed": true,
"trusted": false,
"id": "ExUwQRxpgRsF"
},
"source": [
"# How might you go about dropping just column 3?\n",
"# Hint: remember that you will need to supply both the axis parameter and the how parameter.\n"
],
"execution_count": 26,
"outputs": []
}
},
{
"cell_type": "markdown",
@ -3818,4 +3787,4 @@
}
]
}
}

@ -0,0 +1,339 @@
# 데이터 작업: 데이터 전처리
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../sketchnotes/08-DataPreparation.png)|
|:---:|
|데이터 전처리 - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/14)
원본에 따라 원시 데이터에는 분석 및 모델링에 문제를 일으킬 수 있는 일부 불일치 요소가 포함될 수 있습니다. 즉, 이 데이터는 "더티"로 분류될 수 있으며 사전에 처리해야 합니다. 이 단원에서는 누락, 혹은 부정확하거나 불완전한 데이터의 문제를 처리하기 위해 데이터를 정리하고 변환하는 기술에 중점을 둡니다. 이 강의에서 다루는 주제는 Python과 Pandas 라이브러리를 활용하며 이 디렉토리의 [notebook](../notebook.ipynb)에서 시연됩니다.
## 정제 데이터의 중요성
- **사용 및 재사용 용이성**: 데이터가 적절하게 구성되고 정규화되면 검색, 사용 및 다른 사람과 공유하기가 더 쉽습니다.
- **일관성**: 데이터 과학은 종종 복수의 데이터셋으로 작업해야 하는데, 서로 다른 소스의 데이터셋은 함께 결합되야 합니다. 각 개별 데이터 세트에 공통 표준화가 적용되도록 하나의 데이터 세트로 병합될 때 더욱 유용합니다.
- **모델 정확도**: 데이터를 정제하면 해당 데이터에 의존하는 모델의 정확도가 향상됩니다.
## 공통 정제 목표 및 전략
- **데이터셋 탐색**: [이후 강의](https://github.com/microsoft/Data-Science-For-Beginners/tree/main/4-Data-Science-Lifecycle/15-analyzing)에서 다룰 데이터 탐색은 정제해야 하는 데이터를 찾는 데 도움이 될 수 있습니다. 데이터셋 내의 값을 시각적으로 관찰하면 나머지 데이터가 어떻게 보일지에 대한 기대치를 설정하거나, 해결할 수 있는 문제에 대한 아이디어를 제공할 수 있습니다. 탐색에는 기본 쿼리, 시각화 및 샘플링이 포함될 수 있습니다.
- **형식화(Formatting)**: 소스에 따라 데이터가 표시되는 방식에 불일치가 있을 수 있습니다. 이로 인해 데이터셋 내에서 표시되지만 시각화 또는 쿼리 결과에 제대로 표시되지 않는 값을 검색하고 표시하는 데 문제가 발생할 수 있습니다. 일반적인 형식화 문제에는 공백, 날짜 및 데이터 유형 해결이 포함되며 이러한 문제를 해결하는 것은 일반적으로 데이터를 사용하는 사람들에게 달려 있습니다. 예를 들어 날짜와 숫자가 표시되는 방식에 대한 표준은 국가마다 다를 수 있습니다.
- **중복**: 두 번 이상 발생하는 데이터는 부정확한 결과를 생성할 수 있으므로 보통 제거해야 합니다. 이는 두 개 이상의 데이터셋을 함께 결합할 때 발생할 수 있습니다. 그러나 결합된 데이터셋의 중복이 추가 정보를 제공할 수 있으며 보존할 필요가 있는 경우도 있습니다.
- **결측치(Missing Data)**: 누락된 데이터는 부정확함과 편향된 결과를 초래할 수 있습니다. 때로는 데이터를 "다시 로드"하여 누락된 값을 Python과 같은 계산 및 코드로 채우거나 단순히 값과 해당 데이터를 제거하여 이러한 문제를 해결할 수 있습니다. 데이터가 누락되는 데는 여러 가지 이유가 있으며 이러한 누락된 값을 해결하기 위한 방법론은 초기 데이터가 누락된 이유에 따라 달라질 수 있습니다.
## DataFrame 정보 탐색
> **학습 목표:** 하위 섹션이 끝날때까지, pandas DataFrame에 저장된 데이터에 대한 정보를 능숙하게 찾을 수 있을 것입니다.
데이터를 pandas에 로드하면 DataFrame에 없을 가능성이 더 높아집니다(이전 [단원](../../07-python/translations/README.ko.md#데이터프레임) 참조. 그러나 DataFrame에 있는 데이터셋에 60,000개의 행과 400개의 열이 있는 경우). 다행스럽게도 [pandas](https://pandas.pydata.org/)는 처음 몇 행과 마지막 몇 행 외에도 DataFrame에 대한 전체 정보를 빠르게 볼 수 있는 몇 가지 편리한 도구를 제공합니다.
이 기능을 살펴보기 위해 Python scikit-learn 라이브러리를 가져오고 상징적인 데이터셋인 **Iris 데이터셋** 을 사용합니다.
```python
import pandas as pd
from sklearn.datasets import load_iris
iris = load_iris()
iris_df = pd.DataFrame(data=iris['data'], columns=iris['feature_names'])
```
| |sepal length (cm)|sepal width (cm)|petal length (cm)|petal width (cm)|
|----------------------------------------|-----------------|----------------|-----------------|----------------|
|0 |5.1 |3.5 |1.4 |0.2 |
|1 |4.9 |3.0 |1.4 |0.2 |
|2 |4.7 |3.2 |1.3 |0.2 |
|3 |4.6 |3.1 |1.5 |0.2 |
|4 |5.0 |3.6 |1.4 |0.2 |
- **DataFrame.info**: 시작하기 앞서, `info()` 메서드를 사용하여 `DataFrame`에 있는 내용의 요약을 프린트합니다. 이 데이터셋을 살펴보고 우리가 가지고 있는 것이 무엇인지 살펴보겠습니다:
```python
iris_df.info()
```
```
RangeIndex: 150 entries, 0 to 149
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 sepal length (cm) 150 non-null float64
1 sepal width (cm) 150 non-null float64
2 petal length (cm) 150 non-null float64
3 petal width (cm) 150 non-null float64
dtypes: float64(4)
memory usage: 4.8 KB
```
이를 통해 *Iris* 데이터셋에는 null 항목이 없는 4개의 열에 150개의 항목이 있음을 알 수 있습니다. 모든 데이터는 64비트 부동 소수점 숫자로 저장됩니다.
- **DataFrame.head()**: 다음으로, `DataFrame`의 실제 내용을 확인하기 위해 `head()` 메소드를 사용합니다. `iris_df`의 처음 몇 행이 어떻게 생겼는지 봅시다:
```python
iris_df.head()
```
```
sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)
0 5.1 3.5 1.4 0.2
1 4.9 3.0 1.4 0.2
2 4.7 3.2 1.3 0.2
3 4.6 3.1 1.5 0.2
4 5.0 3.6 1.4 0.2
```
- **DataFrame.tail()**: Conversely, to check the last few rows of the `DataFrame`, we use the `tail()` method:
```python
iris_df.tail()
```
```
sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)
145 6.7 3.0 5.2 2.3
146 6.3 2.5 5.0 1.9
147 6.5 3.0 5.2 2.0
148 6.2 3.4 5.4 2.3
149 5.9 3.0 5.1 1.8
```
> **추가 팁:** DataFrame의 정보에 대한 메타데이터나 하나의 처음과 마지막 몇 개의 값을 보는 것만으로도 처리 중인 데이터의 크기, 모양 및 내용에 대한 즉각적인 아이디어를 얻을 수 있습니다.
## 결측치 처리
> **학습 목표:** 이 하위 섹션이 끝나면 DataFrame에서 null 값을 대체하거나 제거하는 방법을 배울 수 있습니다.
대부분의 경우 사용하려는(사용해야 하는) 데이터셋은 누락된 값이 있습니다. 누락된 데이터를 처리하는 방법은 최종 분석 및 실제 결과에 영향을 줄 수 있는 미묘한 절충안을 수반합니다.
Pandas는 두 가지 방법으로 결측치를 처리합니다. 이전 섹션에서 본 첫 번째 항목: `NaN` 또는 숫자 아님. 이것은 실제로 IEEE 부동 소수점 사양의 일부인 특수 값이며 누락된 부동 소수점 값을 나타내는 데만 사용됩니다.
float를 제외한 누락된 값의 경우 pandas는 Python `None` 객체를 사용합니다. 본질적으로 같은 두 가지 다른 종류의 값을 만나는 것이 혼란스러울 수 있지만, 이는 합리적인 프로그램적 이유가 있으며 실제로 이 같은 로직을 따를시 Pandas가 대부분의 경우 좋은 절충안을 제공할 수 있습니다. 그럼에도 불구하고 `None``NaN` 모두 사용 방법과 관련하여 유의할 필요가 있습니다.
[Notebook](https://github.com/microsoft/Data-Science-For-Beginners/blob/main/4-Data-Science-Lifecycle/15-analyzing/notebook.ipynb)에서 'NaN' 및 'None'에 대해 자세히 알아보자!
- **null 값 감지**: `pandas`에서 `isnull()``notnull()` 메서드는 null 데이터를 감지하는 기본 메서드입니다. 둘 다 데이터에 부울(bool) 마스크를 반환합니다. `NaN` 값을 받기 위해 `numpy`를 사용할 것입니다:
```python
import numpy as np
example1 = pd.Series([0, np.nan, '', None])
example1.isnull()
```
```
0 False
1 True
2 False
3 True
dtype: bool
```
출력값을 자세히 살펴보세요. 놀랐나요? `0`은 산술 null이지만 그럼에도 불구하고 완벽하게 좋은 정수이고 pandas는 이를 그대로 취급합니다. `''`는 조금 더 미묘합니다. 섹션 1에서 빈 문자열 값을 나타내기 위해 사용했지만 pandas에 관한 한 문자열 개체이며 null 표현이 아닙니다.
이제 이것을 바꿔서 실제로 사용하는 것과 같은 방식으로 이러한 방법을 사용하겠습니다. 부울 마스크를 ``Series`` 또는 ``DataFrame`` 인덱스로 직접 사용할 수 있으며, 이는 분리된 결측(또는 현재)치로 작업하려고 할 때 유용할 수 있습니다.
> **추가 팁**: `isnull()``notnull()` 메서드는 모두 `DataFrame`에서 사용할 때 유사한 결과를 생성합니다. 결과와 해당 결과의 인덱스를 보여주므로 데이터와 씨름할 때 엄청난 도움이 됩니다.
- **null 값 삭제**: 누락된 값을 식별하는 것 외에도 pandas는 `Series``DataFrame`에서 null 값을 제거하는 편리한 수단을 제공합니다. (특히 대용량 데이터 세트의 경우 다른 방법으로 처리하는 것보다 분석에서 누락된 [NA] 값을 제거하는 것이 종종 더 좋습니다.) 실제 사례를 보기위해 `example1`로 돌아가겠습니다:
```python
example1 = example1.dropna()
example1
```
```
0 0
2
dtype: object
```
주목할 점은 `example3[example3.notnull()]`의 출력과 같아야 합니다. 여기서 차이점은 마스킹된 값에 대한 인덱싱뿐만 아니라 `dropna``Series` `example1`에서 누락된 값을 제거했다는 것입니다.
위의 `DataFrame`은 2차원이기 때문에 데이터 삭제를 위한 더 많은 옵션을 제공합니다.
```python
example2 = pd.DataFrame([[1, np.nan, 7],
[2, 5, 8],
[np.nan, 6, 9]])
example2
```
| | 0 | 1 | 2 |
|------|---|---|---|
|0 |1.0|NaN|7 |
|1 |2.0|5.0|8 |
|2 |NaN|6.0|9 |
(Pandas가 `NaN`을 받기 위해 두 개의 열을 float로 업캐스팅한 것을 눈치채셨나요?)
`DataFrame`에서 단일 값을 삭제할 수 없으므로 전체 행이나 열을 삭제해야 합니다. 하고 있는 일에 따라 둘 중 하나를 수행하고 싶을 수 있으므로 pandas는 둘 모두에 대한 옵션을 제공합니다. 데이터 과학에서 열은 일반적으로 변수를 나타내고 행은 관찰을 나타내므로 데이터 행을 삭제할 가능성이 더 큽니다. 'dropna()'의 기본 설정은 null 값을 포함하는 모든 행을 삭제하는 것입니다:
```python
example2.dropna()
```
```
0 1 2
1 2.0 5.0 8
```
필요한 경우 열에서 NA 값을 삭제할 수 있습니다. 이렇게 하려면 `axis=1`을 사용하세요:
```python
example2.dropna(axis='columns')
```
```
2
0 7
1 8
2 9
```
이 경우 특히 소규모 데이터셋에서 보관하고자 하는 많은 데이터가 삭제될 수 있습니다. null 값이 여러 개 또는 모두 포함된 행이나 열을 삭제하려는 경우 어떻게 해야 할까요? `how``thresh` 매개변수를 사용하여 `dropna`에서 이러한 설정을 지정합니다.
기본적으로 `how='any'`(자신을 확인하거나 메소드에 어떤 다른 매개변수가 있는지 확인하려면 코드 셀에서 `example4.dropna?`를 실행하세요). 또는 모든 null 값을 포함하는 행이나 열만 삭제하도록 `how='all'`을 지정할 수 있습니다. 예제 `DataFrame`을 확장하여 이것이 실제로 작동하는지 살펴보겠습니다.
```python
example2[3] = np.nan
example2
```
| |0 |1 |2 |3 |
|------|---|---|---|---|
|0 |1.0|NaN|7 |NaN|
|1 |2.0|5.0|8 |NaN|
|2 |NaN|6.0|9 |NaN|
`thresh` 매개변수는 더 세분화된 컨트롤을 제공합니다. 행 또는 열이 유지하기 위해 가져야 하는 *null이 아닌* 값의 수를 설정합니다:
```python
example2.dropna(axis='rows', thresh=3)
```
```
0 1 2 3
1 2.0 5.0 8 NaN
```
여기에서 첫 번째 행과 마지막 행은 null이 아닌 값이 두 개만 포함되어 있기 때문에 삭제되었습니다.
- **null 값 채우기**: 데이터셋에 따라 null 값을 삭제하는 대신 유효한 값으로 채우는 것이 더 합리적일 수 있습니다. `isnull`을 사용하여 이 작업을 수행할 수 있지만 특히 채울 값이 많은 경우 힘들 수 있습니다. 이것은 데이터 과학에서 일반화된 작업입니다. pandas는 누락된 값이 선택한 값으로 대체된 'Series' 또는 'DataFrame'의 복사본을 반환하는 'fillna'를 제공합니다. 이것이 실제로 어떻게 작동하는지 보기 위해 또 다른 예제 `Series`를 만들어 보겠습니다.
```python
example3 = pd.Series([1, np.nan, 2, None, 3], index=list('abcde'))
example3
```
```
a 1.0
b NaN
c 2.0
d NaN
e 3.0
dtype: float64
```
`0`과 같은 단일 값으로 모든 null 항목을 채울 수 있습니다:
```python
example3.fillna(0)
```
```
a 1.0
b 0.0
c 2.0
d 0.0
e 3.0
dtype: float64
```
결측치를 **정방향 채우기**로 null 값을 채워나갈 수 있습니다. 즉, 마지막 유효 값을 사용하여 null을 채웁니다.
```python
example3.fillna(method='ffill')
```
```
a 1.0
b 1.0
c 2.0
d 2.0
e 3.0
dtype: float64
```
또한 **역방향 채우기**로 null을 채울 수도 있습니다:
```python
example3.fillna(method='bfill')
```
```
a 1.0
b 2.0
c 2.0
d 3.0
e 3.0
dtype: float64
```
짐작할 수 있듯이 이것은 `DataFrame`과 동일하게 작동하지만 null 값을 채울 `axis(축)`을 지정할 수도 있습니다. 이전에 사용한 `example2`를 다시 가져오겠습니다:
```python
example2.fillna(method='ffill', axis=1)
```
```
0 1 2 3
0 1.0 1.0 7.0 7.0
1 2.0 5.0 8.0 8.0
2 NaN 6.0 9.0 9.0
```
정방향 채우기에 이전 값을 사용할 수 없는 경우 null 값이 유지됩니다.
> **추가 팁:** 데이터셋의 결측값을 처리하는 방법에는 여러 가지가 있습니다. 사용하는 특정 전략(제거, 교체 또는 교체 방법)은 해당 데이터의 세부 사항에 따라 결정되어야 합니다. 데이터셋을 처리하고 상호 작용하면 할수록 누락된 값을 처리하는 방법에 대한 더 나은 감각을 개발할 수 있습니다.
## 중복 데이터 제거
> **학습 목표:** 해당 섹션이 끝나고, DataFrames에서 중복 값을 식별하고 제거하는 데 익숙해집니다.
누락된 데이터 외에도 실제 데이터 세트에서 중복 데이터를 자주 접하게 됩니다. 다행히 `pandas`는 중복 항목을 쉽게 감지하고 제거할 수 있는 수단을 제공합니다.
- **중복 식별: `duplicated`**: pandas의 `duplicated` 메서드를 사용하여 중복 값을 쉽게 찾을 수 있습니다. 이 메서드는 `DataFrame`의 항목이 이전 항목의 중복 항목인지 여부를 나타내는 부울 마스크를 반환합니다. 이 동작을 보기 위해 또 다른 예제 `DataFrame`을 만들어 보겠습니다.
```python
example4 = pd.DataFrame({'letters': ['A','B'] * 2 + ['B'],
'numbers': [1, 2, 1, 3, 3]})
example4
```
| |letters|numbers|
|------|-------|-------|
|0 |A |1 |
|1 |B |2 |
|2 |A |1 |
|3 |B |3 |
|4 |B |3 |
```python
example4.duplicated()
```
```
0 False
1 False
2 True
3 False
4 True
dtype: bool
```
- **중복 삭제: `drop_duplicates`:** 모든 `중복된(duplicated)` 값이 `False`인 데이터의 복사본을 반환합니다:
```python
example4.drop_duplicates()
```
```
letters numbers
0 A 1
1 B 2
3 B 3
```
`duplicated``drop_duplicates`는 기본적으로 모든 열을 고려하지만 `DataFrame`에서 열의 하위 집합만 검사하도록 지정할 수 있습니다.:
```python
example4.drop_duplicates(['letters'])
```
```
letters numbers
0 A 1
1 B 2
```
> **추가 팁:** 중복 데이터를 제거하는 것은 거의 모든 데이터 과학 프로젝트에서 필수적인 부분입니다. 중복 데이터는 분석 결과를 변경하고 부정확한 결과를 제공할 수 있습니다!
## 🚀 도전과제
논의된 모든 자료는 [Jupyter Notebook](https://github.com/microsoft/Data-Science-For-Beginners/blob/main/2-Working-With-Data/08-data-preparation/notebook.ipynb)으로 제공됩니다. 또한, 각 섹션 후에 연습 문제가 있으므로 시도해 보세요!
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/15)
## 리뷰 & 복습
분석 및 모델링을 위해 데이터를 준비하고 접근하는 방법에는 여러 가지가 있으며, 데이터 정리는 "실제" 경험인 중요한 단계입니다. 이 강의에서 다루지 않은 기술을 살펴보기 위해 Kaggle의 관련 챌린지를 시도하세요!.
- [데이터 정제 과제: 날짜 구문 분석](https://www.kaggle.com/rtatman/data-cleaning-challenge-parsing-dates/)
- [데이터 정제 과제: 데이터 확장 및 정규화](https://www.kaggle.com/rtatman/data-cleaning-challenge-scale-and-normalize-data)
## 과제
[특정 양식에서의 데이터 평가](../assignment.md)

@ -0,0 +1 @@
<!--add translations to this folder-->

@ -0,0 +1,17 @@
# 데이터작업
![데이터 사랑](../images/data-love.jpg)
> 촬영작가: <a href="https://unsplash.com/@swimstaralex?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Alexander Sinn</a> on <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
이 수업에서는 응용 프로그램에서 데이터를 관리, 조작 및 사용할 수 있는 여러 방법에 대해 배웁니다. 또한 관계형 및 비관계형 데이터베이스에 대해 배우고 데이터가 이러한 데이터베이스에 어떻게 저장되는지 배웁니다. 파이썬으로 데이터를 다루는 기본 원리를 배우며, 이를 통해 데이터를 관리하고 마이닝(data mining) 할 수 있는 다양한 방법을 발견할 수 있을 것입니다.
### 주제
1. [관계형 데이터베이스](../05-relational-databases/translations/README.ko.md)
2. [비관계형 데이터베이스](../06-non-relational/translations/README.ko.md)
3. [Python 활용하기](../07-python/translations/README.ko.md)
4. [데이터 준비](../08-data-preparation/translations/README.ko.md)
### 크레딧
강의를 제작한 분: [Christopher Harrison](https://twitter.com/geektrainer), [Dmitry Soshnikov](https://twitter.com/shwars) 와 [Jasmine Greenaway](https://twitter.com/paladique)

@ -0,0 +1,16 @@
# Werken met gegevens
![data love](images/data-love.jpg)
> 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)

@ -1,17 +1,17 @@
# 处理数据
![data love](images/data-love.jpg)
> 摄影者 <a href="https://unsplash.com/@swimstaralex?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Alexander Sinn</a> on <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
![data love](../images/data-love.jpg)
> 摄影者 <a href="https://unsplash.com/@swimstaralex?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Alexander Sinn</a> <a href="https://unsplash.com/s/photos/data?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
在这些课程中, 你将学习一些数据管理, 数据操作, 和应用中使用的方式. 你将学习关系和非关系数据库, 和数据如何存储在他们中. 你将学习Python的基础, 并且你将发现一些你可以使用Python的方式来管理和挖掘数据.
在这些课程中, 你将学习到一些关于数据管理、数据操作和应用的方式。你将学习关系和非关系数据库,以及数据如何存储在他们中。你将学习 Python 语言的基础知识,同时还会发现一些使用 Python 来管理和挖掘数据的方式。
### 话题
1. [关系数据库](05-relational-databases/README.md)
2. [非关系数据库](06-non-relational/README.md)
3. [使用Python](07-python/README.md)
4. [准备数据](08-data-preparation/README.md)
1. [关系数据库](../05-relational-databases/README.md)
2. [非关系数据库](../06-non-relational/README.md)
3. [使用 Python](../07-python/README.md)
4. [准备数据](../08-data-preparation/README.md)
### 学分
### 致谢
这些课程由 ❤️ [Christopher Harrison](https://twitter.com/geektrainer), [Dmitry Soshnikov](https://twitter.com/shwars) and [Jasmine Greenaway](https://twitter.com/paladique)
这些课程由 [Christopher Harrison](https://twitter.com/geektrainer) [Dmitry Soshnikov](https://twitter.com/shwars) 和 [Jasmine Greenaway](https://twitter.com/paladique) 用 ❤️ 编写

@ -21,7 +21,7 @@ An excellent library to create both simple and sophisticated plots and charts of
If you have a dataset and need to discover how much of a given item is included, one of the first tasks you have at hand will be to inspect its values.
✅ There are very good 'cheat sheets' available for Matplotlib [here](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-1.png) and [here](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-2.png).
✅ There are very good 'cheat sheets' available for Matplotlib [here](https://matplotlib.org/cheatsheets/cheatsheets.pdf).
## Build a line plot about bird wingspan values
@ -52,7 +52,7 @@ Let's start by plotting some of the numeric data using a basic line plot. Suppos
wingspan = birds['MaxWingspan']
wingspan.plot()
```
![Max Wingspan](images/max-wingspan.png)
![Max Wingspan](images/max-wingspan-02.png)
What do you notice immediately? There seems to be at least one outlier - that's quite a wingspan! A 2300 centimeter wingspan equals 23 meters - are there Pterodactyls roaming Minnesota? Let's investigate.
@ -72,7 +72,7 @@ plt.plot(x, y)
plt.show()
```
![wingspan with labels](images/max-wingspan-labels.png)
![wingspan with labels](images/max-wingspan-labels-02.png)
Even with the rotation of the labels set to 45 degrees, there are too many to read. Let's try a different strategy: label only those outliers and set the labels within the chart. You can use a scatter chart to make more room for the labeling:
@ -94,7 +94,7 @@ What's going on here? You used `tick_params` to hide the bottom labels and then
What did you discover?
![outliers](images/labeled-wingspan.png)
![outliers](images/labeled-wingspan-02.png)
## Filter your data
Both the Bald Eagle and the Prairie Falcon, while probably very large birds, appear to be mislabeled, with an extra `0` added to their maximum wingspan. It's unlikely that you'll meet a Bald Eagle with a 25 meter wingspan, but if so, please let us know! Let's create a new dataframe without those two outliers:
@ -114,7 +114,7 @@ plt.show()
By filtering out outliers, your data is now more cohesive and understandable.
![scatterplot of wingspans](images/scatterplot-wingspan.png)
![scatterplot of wingspans](images/scatterplot-wingspan-02.png)
Now that we have a cleaner dataset at least in terms of wingspan, let's discover more about these birds.
@ -140,13 +140,13 @@ birds.plot(x='Category',
title='Birds of Minnesota')
```
![full data as a bar chart](images/full-data-bar.png)
![full data as a bar chart](images/full-data-bar-02.png)
This bar chart, however, is unreadable because there is too much non-grouped data. You need to select only the data that you want to plot, so let's look at the length of birds based on their category.
Filter your data to include only the bird's category.
✅ Notice that that you use Pandas to manage the data, and then let Matplotlib do the charting.
✅ Notice that you use Pandas to manage the data, and then let Matplotlib do the charting.
Since there are many categories, you can display this chart vertically and tweak its height to account for all the data:
@ -155,7 +155,7 @@ category_count = birds.value_counts(birds['Category'].values, sort=True)
plt.rcParams['figure.figsize'] = [6, 12]
category_count.plot.barh()
```
![category and length](images/category-counts.png)
![category and length](images/category-counts-02.png)
This bar chart shows a good view of the number of birds in each category. In a blink of an eye, you see that the largest number of birds in this region are in the Ducks/Geese/Waterfowl category. Minnesota is the 'land of 10,000 lakes' so this isn't surprising!
@ -171,7 +171,7 @@ plt.barh(y=birds['Category'], width=maxlength)
plt.rcParams['figure.figsize'] = [6, 12]
plt.show()
```
![comparing data](images/category-length.png)
![comparing data](images/category-length-02.png)
Nothing is surprising here: hummingbirds have the least MaxLength compared to Pelicans or Geese. It's good when data makes logical sense!
@ -189,7 +189,7 @@ plt.show()
```
In this plot, you can see the range per bird category of the Minimum Length and Maximum length. You can safely say that, given this data, the bigger the bird, the larger its length range. Fascinating!
![superimposed values](images/superimposed.png)
![superimposed values](images/superimposed-02.png)
## 🚀 Challenge

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

@ -21,7 +21,7 @@ Una excelente librería para crear gráficos tanto simples como sofisticados de
Si tienes un conjunto de datos y necesitas descubrir qué cantidad de un elemento determinado está incluido, una de las primeras tareas que tienes que hacer será inspeccionar sus valores.
✅ Hay muy buenas "hojas de trucos" disponibles para Matplotlib [aquí](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-1.png) y [aquí](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-2.png).
✅ Hay muy buenas "hojas de trucos" disponibles para Matplotlib [aquí](https://matplotlib.org/cheatsheets/cheatsheets.pdf).
## Construir un gráfico de líneas sobre los valores de la envergadura de las aves
@ -203,4 +203,4 @@ Este conjunto de datos sobre aves ofrece una gran cantidad de información sobre
Esta primera lección has recibido alguna información sobre cómo utilizar Matplotlib para visualizar cantidades. Investiga sobre otras formas de trabajar con conjuntos de datos para su visualización. [Plotly](https://github.com/plotly/plotly.py) es otra forma que no cubriremos en estas lecciones, así que echa un vistazo a lo que puede ofrecer.
## Asignación
[Líneas, dispersiones y barras](assignment.es.md)
[Líneas, dispersiones y barras](assignment.es.md)

@ -21,7 +21,7 @@
यदि आपके पास एक डेटासेट है और यह पता लगाने की आवश्यकता है कि किसी दिए गए आइटम में से कितना शामिल है, तो आपके पास सबसे पहले कार्यों में से एक इसके मूल्यों का निरीक्षण करना होगा।
✅ माटप्लोटलिब के लिए बहुत अच्छी 'चीट शीट' उपलब्ध हैं [here](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-1.png) and [here](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-2.png).
✅ माटप्लोटलिब के लिए बहुत अच्छी 'चीट शीट' उपलब्ध हैं [here](https://matplotlib.org/cheatsheets/cheatsheets.pdf).
## बर्ड विंगस्पैन मूल्यों के बारे में एक लाइन प्लॉट बनाएं

@ -0,0 +1,203 @@
# 수량 시각화
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../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://matplotlib.org/cheatsheets/cheatsheets.pdf).
## 새 날개 길이 값에 대한 선 그래프 작성하기
이 강의 폴더의 루트에 있는 `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()
```
![Max Wingspan](../images/max-wingspan.png)
여러분은 바로 무언가를 알아차리셨나요? 적어도 하나의 이상값이 있는 것 같은데, 날개 폭이 꽤 넓군요! 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()
```
![wingspan with labels](../images/max-wingspan-labels.png)
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?
![outliers](../images/labeled-wingspan.png)
## 데이터 필터링
대머리 독수리(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()
```
이상치를 필터링함으로써 이제 데이터의 응집력이 높아지고 이해하기 쉬워졌습니다.
![scatterplot of wingspans](../images/scatterplot-wingspan.png)
이제 우리는 적어도 날개 길이 측면에서 더 깨끗한 데이터 셋를 얻었으므로 이 새들에 대해 더 자세히 알아보겠습니다.
선 그래프 및 산점도 그래프는 데이터 값과 그 분포에 대한 정보를 표시할 수 있지만, 이 데이터 셋에 내재된 값에 대해 고려하려고 합니다. 수량에 대한 다음 질문에 답하기 위해 시각화를 만들 수 있습니다.
> 새의 종류는 몇 가지이며 그 수는 얼마인가요?
> 얼마나 많은 새들이 멸종했고, 멸종위기에 처해있고, 희귀하거나 흔할까요?
> Linnaeus의 용어에는 얼마나 많은 다양한 속과 목들이 있나요?
## 막대 차트 탐색
막대형 차트는 데이터 그룹화를 보여줘야 할 때 유용합니다. 이 데이터셋에 있는 새들의 를 탐색하여 숫자로 가장 흔한 새가 무엇인지 알아보겠습니다.
노트북 파일에서 기본 막대 차트를 만듭니다.
✅ 참고, 앞 섹션에서 식별한 두 개의 이상값 새를 필터링하거나, 날개 폭의 오타를 편집하거나, 날개 폭 값에 의존하지 않는 연습에 사용할 수 있습니다.
막대 차트를 만들고 싶다면 초점을 맞출 데이터를 선택하면 됩니다. 원시 데이터로 막대 차트를 만들 수 있습니다.
```python
birds.plot(x='Category',
kind='bar',
stacked=True,
title='Birds of Minnesota')
```
![full data as a bar chart](../images/full-data-bar.png)
그러나 그룹화되지 않은 데이터가 너무 많기 때문에 이 막대 차트를 읽을 수 없습니다. 표시할 데이터만 선택해야 하므로 카테고리를 기준으로 새의 길이를 살펴보겠습니다.
새 카테고리만 포함하도록 데이터를 필터링합니다.
✅ Pandas를 사용하여 데이터를 관리한 다음 Matplotlib으로 차트 작성을 합니다.
카테고리가 많으므로 이 차트를 세로로 표시하고 모든 데이터를 설명하도록 높이를 조정할 수 있습니다.
```python
category_count = birds.value_counts(birds['Category'].values, sort=True)
plt.rcParams['figure.figsize'] = [6, 12]
category_count.plot.barh()
```
![category and length](../images/category-counts.png)
이 막대 차트는 각 카테고리의 새의 수를 잘 보여줍니다. 눈 깜짝할 사이에 이 지역에서 가장 많은 수의 새가 오리(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()
```
![comparing data](../images/category-length.png)
여기서 놀라운 것은 없습니다. 벌새(hummingbirds)는 펠리컨(Pelicans)이나 기러기(Geese)에 비해 MaxLength가 가장 짧습니다. 데이터가 논리적으로 타당할 때 좋습니다!
데이터를 중첩하여 막대 차트에 대한 더 흥미로운 시각화를 만들 수 있습니다. 주어진 새 카테고리에 최소 및 최대 길이를 중첩해 보겠습니다.
```python
minLength = birds['MinLength']
maxLength = birds['MaxLength']
category = birds['Category']
plt.barh(category, maxLength)
plt.barh(category, minLength)
plt.show()
```
이 플롯에서는 최소 길이 및 최대 길이의 새 카테고리당 범위를 볼 수 있습니다. 이 데이터를 고려할 때, 새의 몸길이가 클수록 새의 몸길이는 더 넓어진다고 해도 무방할 것입니다. 신기하지 않나요!
![superimposed values](../images/superimposed.png)
## 🚀 도전
이 새 데이터 셋은 특정 생태계 내의 다양한 종류의 새에 대한 풍부한 정보를 제공합니다. 인터넷을 검색하여 다른 조류 지향 데이터 셋을 찾을 수 있는지 확인해 보세요. 여러분이 깨닫지 못한 사실을 발견하기 위해 이 새들에 대한 차트와 그래프를 만드는 연습을 하세요.
## [이전 강의 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/17)
## 복습 & 자기주도학습
이번 첫번째 강의에서는 Matplotlib을 사용하여 수량을 시각화하는 방법에 대한 몇 가지 정보를 배웠습니다. 시각화를 위해 데이터셋으로 작업할 수 있는 다른 방법에 대해 알아보세요. [Plotly](https://github.com/plotly/plotly.py) 는 이 강의에서 다루지 않을 내용입니다. 어떤 기능을 제공하는지 살펴보세요.
## 과제
[선, 산점도, 막대 그래프](assignment.md)

@ -21,7 +21,7 @@ Uma biblioteca excelente para criar tanto gráficos simples como sofisticados e
Se você tem um dataset e precisa descobrir quanto de um dado elemento está presente, uma das primeiras coisas que você precisará fazer é examinar seus valores.
✅ Existem dicas ('cheat sheets') ótimas disponíveis para o Matplotlib [aqui](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-1.png) e [aqui](https://github.com/matplotlib/cheatsheets/blob/master/cheatsheets-2.png).
✅ Existem dicas ('cheat sheets') ótimas disponíveis para o Matplotlib [aqui](https://matplotlib.org/cheatsheets/cheatsheets.pdf).
## Construindo um gráfico de linhas sobre os valores de envergadura de aves

@ -0,0 +1,11 @@
# 선, 산점도, 막대 그래프
## 지침
이 강의에서는 선형 차트, 산점도 및 막대형 차트를 사용하여 이 데이터 셋에 대한 흥미로운 사실을 보여 주었습니다. 이 과제에서는 데이터셋을 자세히 조사하여 특정 유형의 새에 대한 사실을 발견하는 과정을 진행합니다. 예를 들어, 흰기러기(Snow Geese) 에 대한 모든 흥미로운 데이터를 시각화하는 노트북을 만드는 것이 있습니다. 위에서 언급한 세 가지의 플롯을 사용하여 여러분의 노트북을 만들어보세요.
## 기준표
모범적인 | 적당한 | 개선 필요
--- | --- | -- |
좋은 주석처리, 탄탄한 내용, 매력적인 그래프로 노트북 작성 | 노트북에 다음 요소 중 하나가 없습니다. | 노트북에 요소 중에 두 가지가 없습니다.

@ -20,6 +20,15 @@ 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 |
In general, you can quickly look at the way data is distributed by using a scatter plot as we did in the previous lesson:
```python
@ -31,6 +40,8 @@ plt.xlabel('Max Length')
plt.show()
```
![max length per order](images/scatter-wb.png)
This gives an overview of the general distribution of body length per bird Order, but it is not the optimal way to display true distributions. That task is usually handled by creating a Histogram.
## Working with histograms
@ -40,7 +51,7 @@ Matplotlib offers very good ways to visualize data distribution using Histograms
birds['MaxBodyMass'].plot(kind = 'hist', bins = 10, figsize = (12,12))
plt.show()
```
![distribution over the entire dataset](images/dist1.png)
![distribution over the entire dataset](images/dist1-wb.png)
As you can see, most of the 400+ birds in this dataset fall in the range of under 2000 for their Max Body Mass. Gain more insight into the data by changing the `bins` parameter to a higher number, something like 30:
@ -48,7 +59,7 @@ As you can see, most of the 400+ birds in this dataset fall in the range of unde
birds['MaxBodyMass'].plot(kind = 'hist', bins = 30, figsize = (12,12))
plt.show()
```
![distribution over the entire dataset with larger bins param](images/dist2.png)
![distribution over the entire dataset with larger bins param](images/dist2-wb.png)
This chart shows the distribution in a bit more granular fashion. A chart less skewed to the left could be created by ensuring that you only select data within a given range:
@ -59,7 +70,7 @@ filteredBirds = birds[(birds['MaxBodyMass'] > 1) & (birds['MaxBodyMass'] < 60)]
filteredBirds['MaxBodyMass'].plot(kind = 'hist',bins = 40,figsize = (12,12))
plt.show()
```
![filtered histogram](images/dist3.png)
![filtered histogram](images/dist3-wb.png)
✅ Try some other filters and data points. To see the full distribution of the data, remove the `['MaxBodyMass']` filter to show labeled distributions.
@ -76,7 +87,7 @@ hist = ax.hist2d(x, y)
```
There appears to be an expected correlation between these two elements along an expected axis, with one particularly strong point of convergence:
![2D plot](images/2D.png)
![2D plot](images/2D-wb.png)
Histograms work well by default for numeric data. What if you need to see distributions according to text data?
## Explore the dataset for distributions using text data
@ -115,7 +126,7 @@ plt.gca().set(title='Conservation Status', ylabel='Max Body Mass')
plt.legend();
```
![wingspan and conservation collation](images/histogram-conservation.png)
![wingspan and conservation collation](images/histogram-conservation-wb.png)
There doesn't seem to be a good correlation between minimum wingspan and conservation status. Test other elements of the dataset using this method. You can try different filters as well. Do you find any correlation?

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

@ -0,0 +1,193 @@
# 분포 시각화하기
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../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()
```
![distribution over the entire dataset](images/dist1.png)
보시다시피, 이 데이터셋에 있는 400마리 이상의 새들의 대부분은 최대 체질량에서 2000 미만의 범위에 속합니다. 매개 변수 `bins`를 30과 같이 더 높은 숫자로 변경하여 데이터에 대한 더 깊이 이해하세요:
```python
birds['MaxBodyMass'].plot(kind = 'hist', bins = 30, figsize = (12,12))
plt.show()
```
![distribution over the entire dataset with larger bins param](images/dist2.png)
이 차트는 좀 더 세분화된 방식으로 분포를 보여줍니다. 주어진 범위 내에서만 데이터를 선택하여 왼쪽으로 치우치지 않은 차트를 만들 수 있습니다:
데이터를 필터링하여 체중이 60 미만인 새들만 골라서 40개의 `bins`을 표시합니다:
```python
filteredBirds = birds[(birds['MaxBodyMass'] > 1) & (birds['MaxBodyMass'] < 60)]
filteredBirds['MaxBodyMass'].plot(kind = 'hist',bins = 40,figsize = (12,12))
plt.show()
```
![filtered histogram](images/dist3.png)
✅ 다른 필터와 데이터 포인트를 사용해보세요. 데이터의 전체 분포를 보려면, 라벨링된 분포를 표시하도록 `['MaxBodyMass']` 필터를 제거하세요.
히스토그램에서는 다음과 같은 몇 가지 색상 및 레이블 향상 기능도 제공합니다:
2D 히스토그램을 생성하여 두 분포 간의 관계를 비교합니다. `MaxBodyMass``MaxLength`를 비교해보겠습니다. Matplotlib은 더 밝은 색상을 사용하여 수렴을 보여주는 기본 제공 방법을 제공합니다:
```python
x = filteredBirds['MaxBodyMass']
y = filteredBirds['MaxLength']
fig, ax = plt.subplots(tight_layout=True)
hist = ax.hist2d(x, y)
```
예상되는 축을 따라 이 두 요소 사이에는 다음과 같은 특별한 수렴이 있는 것으로 보입니다:
![2D plot](images/2D.png)
히스토그램은 숫자 데이터에 대해 기본적으로 잘 작동합니다. 텍스트 데이터에 따라 분포를 확인하려면 어떻게 해야 합니까?
## 텍스트 데이터를 사용하여 분포에 대한 데이터셋 탐색하기
이 데이터셋에는 새 카테고리와 속, 종, 과에 대한 좋은 정보와 보존 상태도 포함되어 있습니다. 이 보존 정보를 자세히 살펴봅시다. 새들의 보존 상태에 따라 분포는 어떻게 되나요?
> ✅ 데이터셋에서 보존 상태를 설명하기 위해 여러 약어가 사용됩니다. 이 약어는 종의 상태를 분류하는 기관인 [세계자연보전연맹 멸종위기생물목록 카테고리](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();
```
![wingspan and conservation collation](images/histogram-conservation.png)
최소 날개 길이와 보존 상태 사이에는 좋은 상관 관계가 없어 보입니다. 이 방법을 사용하여 데이터셋의 다른 요소를 테스트합니다. 다른 필터를 시도해 볼 수도 있습니다. 상관관계가 있습니까?
## 밀도분포 그래프
지금까지 살펴본 히스토그램이 '계단형'이며 호를 따라 부드럽게 흐르지 않는다는 것을 눈치채셨을 수도 있습니다. 더 부드러운 밀도 차트를 표시하려면 밀도분포 그래프를 시도할 수 있습니다.
밀도분포 그래프를 사용하려면 새로운 플롯 라이브러리 [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()
```
![Density plot](images/density1.png)
최소 날개 길이 데이터에 대해 이전 그림이 어떻게 반영되는지 확인할 수 있습니다; 조금 더 부드워졌습니다. Seaborn의 문서에 따르면 "히스토그램에 비해 KDE는 특히 다중 분포를 그릴 때 덜 복잡하고 더 해석하기 쉬운 플롯을 생성할 수 있습니다. 그러나 기본 분포가 한정되어 있거나 매끄럽지 않은 경우 왜곡이 있을 가능성이 있습니다. 히스토그램과 마찬가지로 표현의 품질도 좋은 평활화 매개변수(smoothing parameters)의 선택에 따라 달라집니다." [출처](https://seaborn.pydata.org/generated/seaborn.kdeplot.html) 다시 말해, 이상치는 차트를 잘못 작동하게 만듭니다.
두 번째 차트에서 들쭉날쭉한 MaxBodyMass 선을 다시 보고 싶다면, 다음 방법을 사용하여 다시 만들면 매우 부드럽게 만들 수 있습니다:
```python
sns.kdeplot(filteredBirds['MaxBodyMass'])
plt.show()
```
![smooth bodymass line](images/density2.png)
부드럽지만 너무 부드럽지 않은 선을 원하는 경우 `bw_adjust` 매개변수를 편집하세요:
```python
sns.kdeplot(filteredBirds['MaxBodyMass'], bw_adjust=.2)
plt.show()
```
![less smooth bodymass line](images/density3.png)
✅ 이러한 유형의 그림 및 실험에 사용할 수 있는 매개변수에 대해 읽어보세요!
이러한 유형의 차트는 아름답게 설명되는 시각화를 제공합니다. 예를 들어 코드 몇 줄을 사용하여 새 한마리당 최대 체질량 밀도를 표시할 수 있습니다:
```python
sns.kdeplot(
data=filteredBirds, x="MaxBodyMass", hue="Order",
fill=True, common_norm=False, palette="crest",
alpha=.5, linewidth=0,
)
```
![bodymass per order](images/density4.png)
여러 변수의 밀도를 하나의 차트에서 보여줄 수도 있습니다. 새의 보존 상태와 비교하여 새의 MaxLength 및 MinLength 텍스트 입력하세요:
```python
sns.kdeplot(data=filteredBirds, x="MinLength", y="MaxLength", hue="ConservationStatus")
```
![multiple densities, superimposed](images/multi.png)
아마도 이러한 길이에 따른 '취약한' 새들의 무리가 의미가 있는지 없는지 연구해볼 가치가 있을 것입니다.
## 🚀 도전
히스토그램은 기본 산점도, 막대 차트 또는 꺾은선형 차트보다 더 정교한 유형의 차트입니다. 히스토그램 사용의 좋은 예를 찾으려면 인터넷에서 검색해보세요. 어떻게 사용되고, 무엇을 입증하며, 어떤 분야나 조사 분야에서 사용되는 경향이 있습니까?
## [강의 후 퀴즈](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개의 히스토그램을 사용합니다. | 노트북은 불완전한 주석이나 버그가 표시됩니다. | 노트북은 주석 없이 표시되며 버그가 포함되어 있습니다.

@ -57,6 +57,12 @@ Take this data and convert the 'class' column to a category:
cols = mushrooms.select_dtypes(["object"]).columns
mushrooms[cols] = mushrooms[cols].astype('category')
```
```python
edibleclass=mushrooms.groupby(['class']).count()
edibleclass
```
Now, if you print out the mushrooms data, you can see that it has been grouped into categories according to the poisonous/edible class:
@ -78,7 +84,7 @@ 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!
![pie chart](images/pie1.png)
![pie chart](images/pie1-wb.png)
## Donuts!
@ -108,7 +114,7 @@ plt.title('Mushroom Habitats')
plt.show()
```
![donut chart](images/donut.png)
![donut chart](images/donut-wb.png)
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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

@ -0,0 +1,174 @@
# 관계 시각화: 꿀의 모든 것 🍯
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../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);
```
![scatterplot 1](../images/scatter1.png)
이제 동일한 데이터를 꿀 색상 구성표로 표시하여 몇 년 동안 가격이 어떻게 변하는지 보여줍니다. 매년 변경 사항을 표시하기 위해 '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);
```
![scatterplot 2](../images/scatter2.png)
이 색상 구성표 변경을 통해, 여러분은 파운드당 꿀의 가격 측면에서 몇 년 동안 분명히 강력한 발전이 있음을 알 수 있습니다. 실제로 검증할 데이터의 표본 셋(예: 아리조나 주를 선택)을 보면 몇 가지 예외를 제외하고 매년 가격이 상승하는 패턴을 볼 수 있습니다:
| 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);
```
점들의 크기가 점점 커지는 것을 볼 수 있습니다.
![scatterplot 3](../images/scatter3.png)
이것은 단순한 수요와 공급의 경우인가요? 기후 변화 및 봉군 붕괴와 같은 요인으로 인해, 매년 구매할 수 있는 꿀이 줄어들어 가격이 상승하나요?
이 데이터 셋의 일부 변수 간의 상관 관계를 발견하기 위해 몇 가지 꺾은선 그래프를 살펴보겠습니다.
## 꺾은선 그래프
질문: 매년 파운드 당 꿀값이 상승하고 있습니까? 여러분은 단일 꺾은선 그래프를 만들어 가장 쉽게 확인할 수 있습니다:
```python
sns.relplot(x="year", y="priceperlb", kind="line", data=honey);
```
답변: 네, 2003년 경의 일부 예외를 제외하고 그렇습니다:
![line chart 1](../images/line1.png)
✅ Seaborn은 한 선으로 데이터를 집계하기 때문에 "평균을 중심으로 95% 신뢰 구간과 평균을 표시하여 각 x 값에 대한 다중 측정"을 표시합니다. [출처](https://seaborn.pydata.org/tutorial/relational.html). 이 시간 소모적인 동작은 `ci=None`을 추가하여 비활성화할 수 있습니다.
질문: 2003년에도 꿀 공급이 급증하는 것을 볼 수 있습니까? 연간 총 생산량을 보면 어떨까요?
```python
sns.relplot(x="year", y="totalprod", kind="line", data=honey);
```
![line chart 2](../images/line2.png)
답변: 그렇지 않습니다. 총 생산량을 보면 그 해에 실제로 증가한 것으로 보이지만 일반적으로 이 기간 동안 생산되는 꿀의 양은 감소하고 있습니다.
질문: 그렇다면 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개로 감싸진 열로 나란히 비교할 수 있습니다:
![facet grid](../images/facet.png)
이 데이터셋의 경우, 매년 주별로 군집 수와 수확량과 관련하여 특별히 눈에 띄는 것은 없습니다. 이 두 변수 사이의 상관 관계를 찾는 다른 방법이 있습니까?
## 이중 꺾은선 그래프
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();
```
![superimposed plots](../images/dual-line.png)
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,32 @@
# 시각화
![라벤더 꽃 위의 꿀벌](../images/bee.jpg)
> Photo by <a href="https://unsplash.com/@jenna2980?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Jenna Lee</a> on <a href="https://unsplash.com/s/photos/bees-in-a-meadow?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
데이터 시각화는 데이터 과학자의 가장 중요한 작업 중 하나입니다. 이미지는 1000 단어의 가치가 있으며 시각화는 급증, 이상값, 그룹화, 경향 등과 같은 데이터의 모든 흥미로운 부분을 식별하는 데 도움이 되어 데이터가 전달하려는 이야기를 이해하는 데 도움이 됩니다.
이 다섯 개의 수업에서는 자연에서 얻은 데이터를 탐색하고, 다양한 기술을 사용하여 흥미롭고 아름다운 시각화를 만들어봅시다.
### 주제
1. [수량 시각화](../09-visualization-quantities/README.md)
2. [분포 시각화](../10-visualization-distributions/README.md)
3. [비율 시각화](../11-visualization-proportions/README.md)
4. [관계 시각화](../12-visualization-relationships/README.md)
5. [의미있는 시각화 만들기](../13-meaningful-visualizations/README.md)
### 크레딧
강의를 만드신 분: [Jen Looper](https://twitter.com/jenlooper)
🍯 미국 꿀 생산에 대한 데이터는 [Kaggle](https://www.kaggle.com/jessicali9530/honey-production)의 Jessica Li의 프로젝트에서 제공되는 것입니다. 이 [데이터](https://usda.library.cornell.edu/concern/publications/rn301137d)는 [미국 농무부](https://www.nass.usda.gov/About_NASS/index.php)에서 만들어졌습니다.
🍄 버섯에 대한 데이터 역시 [Kaggle](https://www.kaggle.com/hatterasdunton/mushroom-classification-updated-dataset)에서 제공되었고, Hatteras Dunton이 수정했습니다. 이 데이터 셋에는 Agaricus 및 Lepiota 과에 속하는 23종의 주름 버섯목에 해당하는 가상 샘플에 대한 설명이 포함되어 있습니다. 버섯에 대한 정보는 'The Audubon Society Field Guide to North American Mushrooms(1981)'에서 발췌했습니다. 이 데이터 셋은 1987년 UCI ML 27에 기증되었습니다.
🦆 Minnesota 새에 대한 데이터는 Hannah Collins가 [위키피디아](https://en.wikipedia.org/wiki/List_of_birds_of_Minnesota)에서 스크랩한 [Kaggle](https://www.kaggle.com/hannahcollins/minnesota-birds) 데이터 입니다.
모든 데이터 셋에는 [CC0: Creative Commons](https://creativecommons.org/publicdomain/zero/1.0/) 라이선스가 부여됩니다.

@ -0,0 +1,27 @@
# Visualisaties
![Een bij op lavendel](./images/bee.jpg)
> 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 bee on a lavender flower](../images/bee.jpg)
> 拍摄者 <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/) 条款。

@ -28,7 +28,7 @@ Defining the goals of the project will require deeper context into the problem o
Questions a data scientist may ask:
- Has this problem been approached before? What was discovered?
- Is the purpose and goal understood by all involved?
- Where is there ambiguity and how to reduce it?
- Is there ambiguity and how to reduce it?
- What are the constraints?
- What will the end result potentially look like?
- How much resources (time, people, computational) are available?
@ -62,16 +62,18 @@ Considerations of how and where the data is stored can influence the cost of its
Heres some aspects of modern data storage systems that can affect these choices:
**On premise vs off premise vs public or private cloud**
On premise refers to hosting managing the data on your own equipment, like owning a server with hard drives that store the data, while off premise relies on equipment that you dont own, such as a data center. The public cloud is a popular choice for storing data that requires no knowledge of how or where exactly the data is stored, where public refers to a unified underlying infrastructure that is shared by all who use the cloud. Some organizations have strict security policies that require that they have complete access to the equipment where the data is hosted and will rely on a private cloud that provides its own cloud services. Youll learn more about data in the cloud in [later lessons](5-Data-Science-In-Cloud).
**Cold vs hot data**
On premise refers to hosting managing the data on your own equipment, like owning a server with hard drives that store the data, while off premise relies on equipment that you dont own, such as a data center. The public cloud is a popular choice for storing data that requires no knowledge of how or where exactly the data is stored, where public refers to a unified underlying infrastructure that is shared by all who use the cloud. Some organizations have strict security policies that require that they have complete access to the equipment where the data is hosted and will rely on a private cloud that provides its own cloud services. Youll learn more about data in the cloud in [later lessons](https://github.com/microsoft/Data-Science-For-Beginners/tree/main/5-Data-Science-In-Cloud).
**Cold vs hot data**
When training your models, you may require more training data. If youre content with your model, more data will arrive for a model to serve its purpose. In any case the cost of storing and accessing data will increase as you accumulate more of it. Separating rarely used data, known as cold data from frequently accessed hot data can be a cheaper data storage option through hardware or software services. If cold data needs to be accessed, it may take a little longer to retrieve in comparison to hot data.
### Managing Data
As you work with data you may discover that some of the data needs to be cleaned using some of the techniques covered in the lesson focused on [data preparation](2-Working-With-Data\08-data-preparation) to build accurate models. When new data arrives, it will need some of the same applications to maintain consistency in quality. Some projects will involve use of an automated tool for cleansing, aggregation, and compression before the data is moved to its final location. Azure Data Factory is an example of one of these tools.
As you work with data you may discover that some of the data needs to be cleaned using some of the techniques covered in the lesson focused on [data preparation](https://github.com/microsoft/Data-Science-For-Beginners/tree/main/2-Working-With-Data/08-data-preparation) to build accurate models. When new data arrives, it will need some of the same applications to maintain consistency in quality. Some projects will involve use of an automated tool for cleansing, aggregation, and compression before the data is moved to its final location. Azure Data Factory is an example of one of these tools.
### Securing the Data
One of the main goals of securing data is ensuring that those working it are in control of what is collected and in what context it is being used. Keeping data secure involves limiting access to only those who need it, adhering to local laws and regulations, as well as maintaining ethical standards, as covered in the [ethics lesson](1-Introduction\02-ethics).
One of the main goals of securing data is ensuring that those working it are in control of what is collected and in what context it is being used. Keeping data secure involves limiting access to only those who need it, adhering to local laws and regulations, as well as maintaining ethical standards, as covered in the [ethics lesson](https://github.com/microsoft/Data-Science-For-Beginners/tree/main/1-Introduction/02-ethics).
Heres some things that a team may do with security in mind:
- Confirm that all data is encrypted

@ -1,23 +1,23 @@
# 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
--- | --- | -- |
# 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,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)을 참조하십시오.
## 표제
모범 | 충분 | 개선 필요
--- | --- | -- |

@ -34,10 +34,10 @@ General querying of the data can help you answer some general questions and theo
The [`query() `function](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.query.html) in the Pandas library allows you to select columns and receive simple answers about the data through the rows retrieved.
## Exploring with Visualizations
You dont have to wait until the data is thoroughly cleaned and analyzed to start creating visualizations. In fact, having a visual representation while exploring can help identify patterns, relationships, and problems in the data. Furthermore, visualizations provide a means of communication with those who are not involved with managing the data and can be an opportunity to share and clarify additional questions that were not addressed in the capture stage. Refer to the [section on Visualizations](3-Data-Visualization) to learn more about some popular ways to explore visually.
You dont have to wait until the data is thoroughly cleaned and analyzed to start creating visualizations. In fact, having a visual representation while exploring can help identify patterns, relationships, and problems in the data. Furthermore, visualizations provide a means of communication with those who are not involved with managing the data and can be an opportunity to share and clarify additional questions that were not addressed in the capture stage. Refer to the [section on Visualizations](/3-Data-Visualization) to learn more about some popular ways to explore visually.
## Exploring to identify inconsistencies
All the topics in this lesson can help identify missing or inconsistent values, but Pandas provides functions to check for some of these. [isna() or isnull()](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.isna.html) can check for missing values. One important piece of exploring for these values within your data is to explore why they ended up that way in the first place. This can help you decide on what [actions to take to resolve them](2-Working-With-Data\08-data-preparation\notebook.ipynb).
All the topics in this lesson can help identify missing or inconsistent values, but Pandas provides functions to check for some of these. [isna() or isnull()](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.isna.html) can check for missing values. One important piece of exploring for these values within your data is to explore why they ended up that way in the first place. This can help you decide on what [actions to take to resolve them](/2-Working-With-Data/08-data-preparation/notebook.ipynb).
## [Pre-Lecture Quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/27)

@ -1,10 +1,10 @@
# Exploring for answers
This is a continuation of the previous lesson's [assignment](..\14-Introduction\assignment.md), where we briefly took a look at the data set. Now we will be taking a deeper look at the data.
This is a continuation of the previous lesson's [assignment](../14-Introduction/assignment.md), where we briefly took a look at the data set. Now we will be taking a deeper look at the data.
Again, the question the client wants to know: **Do yellow taxi passengers in New York City tip drivers more in the winter or summer?**
Your team is in the [Analyzing](Readme.md) stage of the Data Science Lifecycle, where you are responsible for doing exploratory data analysis on the dataset. You have been provided a notebook and dataset that contains 200 taxi transactions from January and July 2019.
Your team is in the [Analyzing](README.md) stage of the Data Science Lifecycle, where you are responsible for doing exploratory data analysis on the dataset. You have been provided a notebook and dataset that contains 200 taxi transactions from January and July 2019.
## Instructions

@ -0,0 +1,46 @@
# 데이터 과학의 라이프 사이클: 분석하기
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../../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
모범 | 충분 | 개선 필요
--- | --- | -- |

@ -1,6 +1,6 @@
# The Data Science Lifecycle: Communication
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../sketchnotes/16-Communicating.png)|
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev)](../../sketchnotes/16-Communicating.png)|
|:---:|
| Data Science Lifecycle: Communication - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
@ -172,8 +172,6 @@ If Emerson took approach #2, it is much more likely that the team leads will tak
- Use Meaningful Words & Phrases
- Use Emotion
## [Post-Lecture Quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/31)
### Recommended Resources for Self Study
[The Five C's of Storytelling - Articulate Persuasion](http://articulatepersuasion.com/the-five-cs-of-storytelling/)
@ -213,6 +211,13 @@ If Emerson took approach #2, it is much more likely that the team leads will tak
[1. Communicating Data - Communicating Data with Tableau [Book] (oreilly.com)](https://www.oreilly.com/library/view/communicating-data-with/9781449372019/ch01.html)
## [Post-Lecture Quiz](https://red-water-0103e7a0f.azurestaticapps.net/quiz/31)
Review what you've just learned with the Post-Lecture Quiz above!
## Assignment
[Tell a story](assignment.md)
[Market Research](assignment.md)

@ -1,6 +1,6 @@
# डेटा विज्ञान के जीवनचक्र: संचार
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev)](https://github.com/Heril18/Data-Science-For-Beginners/raw/main/sketchnotes/16-Communicating.png)|
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev)](../..//sketchnotes/16-Communicating.png)|
|:---:|
| डेटा विज्ञान के जीवनचक्र: संचार - _[@nitya](https://twitter.com/nitya) द्वारा स्केचनोट_|

@ -0,0 +1,211 @@
# 데이터 사이언스 생활주기(life cycle) : 소통(communication)
|![ Sketchnote by [(@sketchthedocs)](https://sketchthedocs.dev) ](../../sketchnotes/16-Communicating.png)|
|:---:|
| 데이터 사이언스 생활주기 : 소통 - _Sketchnote by [@nitya](https://twitter.com/nitya)_ |
## [강의 전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/30)
위의 사전 강의 퀴즈와 함께 제공되는 내용을 테스트해 보십시오!
# 개요
### 소통이란 무엇인가?
의사소통의 의미를 정의하는 것으로 이 수업을 시작하겠습니다. **소통하는 것은 정보를 전달하거나 교환하는 것입니다.** 정보는 아이디어, 생각, 느낌, 메시지, 은밀한 신호, 데이터 등 **_송신자_** (정보를 보내는 사람)가 **_수신자_** (정보를 받는 사람)에게 이해하길 원하는 모든 것이 될 수 있습니다. 이 과정에서는 송신자를 전달자로, 수신자를 청중으로 언급할 것입니다.
### 데이터 통신 & 스토리텔링
우리는 의사소통의 목적이 정보를 전달하거나 교환하는 것이라는 것을 이해합니다. 하지만 데이터를 전달할 때, 여러분의 목표는 단순히 청중들에게 숫자를 전달하는 것이 아니어야 합니다. 여러분의 목표는 데이터를 통해 정보를 전달하는 것이어야 합니다 - 효과적인 데이터 커뮤니케이션과 스토리텔링이 함께 진행됩니다. 청중들은 여러분이 들려주는 숫자보다 여러분이 들려주는 이야기를 더 잘 기억할 것입니다. 이 레슨의 후반부에서 스토리텔링을 사용하여 데이터를 보다 효과적으로 전달할 수 있는 몇 가지 방법에 대해 살펴보겠습니다.
### 통신의 종류
이 레슨 내내 단방향 통신과 양방향 통신이라는 두 가지 유형의 통신에 대해 논의합니다.
**일방향 통신**은 송신자가 피드백이나 응답 없이 수신자에게 정보를 보낼 때 발생합니다. 우리는 매일 단방향 커뮤니케이션의 예를 볼 수 있습니다 - 크고/많은 이메일, 뉴스가 가장 최신 이야기를 전달할 때, 또는 TV 광고에서 제품이 좋은 이유를 알려줄 때 등. 이러한 각각의 경우, 송신자는 정보의 교환을 추구하지 않습니다. 그들은 단지 정보를 전달하거나 전달하려고 할 뿐이다.
**양방향 커뮤니케이션**은 모든 관련 당사자가 송신자와 수신자 역할을 할 때 발생합니다. 송신자는 수신자와 통신하는 것으로 시작하고 수신자는 피드백 또는 응답을 제공합니다. 쌍방향 커뮤니케이션은 우리가 소통에 대해 이야기할 때 전통적으로 생각하는 것입니다. 우리는 보통 직접 대화하거나 전화 통화, 소셜 미디어 또는 문자 메시지와 같은 방식으로 사람들의 소통 한다고 생각합니다.
데이터를 전달할 때 단방향 커뮤니케이션(직후에 질문이 들어오지 않는 컨퍼런스에서 발표하거나 대규모 그룹을 대상으로 발표할 때)을 사용하는 경우와 양방향 커뮤니케이션(데이터를 사용하여 소수의 이해 관계자를 설득하거나, 팀 동료에게 새로운 것을 구축하는 데 시간과 노력을 투자해야 한다고 설득할 때)을 사용하는 경우가 있습니다.
# 효과적인 커뮤니케이션
### 전달자로서 여러분의 책임
통신을 할 때 수신자가 당신이 원하는 정보를 가져 가는지 확인하는 것이 여러분의 일입니다. 데이터를 주고받을 때 수신자가 번호만 가져가는 것이 아니라 그 데이터를 통해 스토리를 얻을 수 있는 데이터를 수신자가 가져가는 것을 원할 것입니다. 훌륭한 데이터 전달자는 훌륭한 스토리텔러입니다.
데이터를 가지고 어떻게 이야기를 할 수 있을까요? 방법은 무궁무진하지만 아래 6가지에 대해 이 수업에서 설명하겠습니다.
1. 당신의 청중, 매체 및 커뮤니케이션 방법을 이해하십시오.
2. 끝을 염두에 두고 시작하라
3. 실제 이야기처럼 접근하라
4. 의미 있는 단어와 구문을 사용하라
5. 감정을 사용하라
이러한 각 전략은 아래에 자세히 설명되어 있습니다.
### 1. 청중, 채널 및 커뮤니케이션 방법을 이해하십시오.
여러분이 가족과 소통하는 방법은 여러분이 친구들과 소통하는 방법과 다를 수 있습니다. 여러분은 아마도 듣고 있는 사람들이 더 이해하기 쉬운 다른 단어와 구절을 사용할 것입니다. 데이터 통신 시에도 동일한 방법을 사용해야 합니다. 누구와 소통하고 있는지 생각해 보세요. 당신이 설명하려는 상황에 대하여 그들이 가지고 있는 그들의 목표와 전후사정에 대해 생각해보세요.
대부분의 청중을 한 범주 내에 그룹화할 수 있습니다. 'Harvard Business Review' 기사에서 "[데이터로 스토리를 전하는 방법]"(http://blogs.hbr.org/2013/04/how-to-tell-a-story-with-data/),) Dell의 총괄 전략가인 Jim Stikeleather는 5가지 범주의 고객을 파악합니다.
- **초보자(Novice)**: 주제에 대한 첫 노출이지만 지나치게 단순화하는 것을 원치 않습니다.
- **일반인(Generalist)**: 주제를 알고 있지만 개요 이해 및 주요 주제를 찾습니다.
- **관리자(Managerial)**: 세부사항 접근과의 복잡성과 상호 관계에 대한 심층적이고 실행 가능한 이해
- **전문가(Expert)**: 더 많은 탐색과 발견, 매우 상세하고 더 적은 스토리텔링
- **임원(Executive)**: 가중 확률의 중요성과 결론을 얻을 시간만 있습니다.
이러한 카테고리들은 청중에게 데이터를 보여주는 방법을 알려줄 수 있습니다.
청중의 카테고리에 대해 생각하는 것 외에도, 여러분은 청중을 소통하기 위해 사용하고 있는 채널도 고려해야 합니다. 메모나 이메일을 작성하는 경우, 회의나 컨퍼런스에서 발표하거나 하는 경우와는 약간 다르게 접근해야 합니다.
여러분의 청중을 이해하는 것 외에도, 여러분이 그들과 어떻게 의사소통할 것인지(단방향 또는 양방향) 아는 것 또한 중요합니다.
대다수의 초보 청중과 대화하고 일방적인 대화를 사용하는 경우, 먼저 청중을 교육하고 적절한 맥락을 제공해야 합니다. 그런 다음 고객에게 데이터를 제시하고 데이터가 무엇을 의미하는지, 데이터가 중요한 이유를 설명해야 합니다. 이 경우, 청중들은 여러분에게 어떠한 직접적인 질문도 할 수 없기 때문에, 여러분은 명확성을 높이는 것에 초점을 맞추고 싶을지도 모릅니다.
대다수의 관리 대상자와 대화하고 양방향 커뮤니케이션을 사용하는 경우, 청중을 교육하거나 많은 컨텍스트를 제공할 필요가 없습니다. 수집한 데이터와 데이터가 중요한 이유에 대해 바로 논의할 수 있습니다. 그러나 이 시나리오에서는 프레젠테이션 타이밍과 제어에 집중해야 합니다. 양방향 커뮤니케이션을 사용할 때(특히 "세부사항 접근과의 복잡성과 상호 관계에 대한 실행 가능한 이해"를 찾는 관리자와) 대화 중에 토론이 이야기와 관련이 없는 방향으로 진행될 수 있습니다. 이 경우, 조치를 취하여 토론 내용을 다시 본 궤도에 올릴 수 있습니다.
### 2. 끝을 염두에 두고 시작하라
끝에서부터 시작하는 것은 청중과 대화를 시작하기 전에 여러분이 의도한 바를 이해시키는 것을 의미합니다. 청중들이 가져가기를 원하는 것에 대해 미리 생각하는 것은 당신이 청중들이 따라올 수 있는 이야기를 만드는 것에 도움이 됩니다. 단방향 커뮤니케이션과 양방향 커뮤니케이션에 모두 끝부터 시작하는 것이 적절합니다.
끝을 염두에 두고 어떻게 시작할까요? 데이터를 전달하기 전에 중요한 사항을 적어 두십시오. 그리고 나서, 여러분이 데이터를 가지고 하고 싶은 이야기를 준비할 때, 스스로에게 물어보세요. "어떻게 이것이 내가 말하고 있는 이야기와 통합될까?"
주의 목표를 염두에 두고 시작하는 것이 이상적이지만, 의도한 결과를 뒷받침하는 데이터만 전달하고 싶지는 않을 것입니다. 이렇게 하는 것을 체리 픽킹이라고 하는데, 이것은 통신자가 그들이 만들고자 하는 지점을 지원하는 데이터만 주고받고 다른 모든 데이터를 무시할 때 발생합니다.
수집한 모든 데이터가 의도한 결과를 명확하게 뒷받침한다면 매우 좋습니다. 그러나 수집한 데이터가 사용자의 핵심 정보를 지원하지 않거나 핵심 정보에 반대하는 주장을 뒷받침하는 경우 해당 데이터도 전달해야 합니다. 이러한 상황이 발생하면, 모든 데이터가 반드시 여러분의 이야기를 뒷받침하는 것은 아니지만 왜 여러분이 이야기를 고수하기로 선택했는지 청중에게 솔직하게 알리십시오.
### 3. 실제 이야기처럼 접근하라
전통적인 이야기는 5단계로 진행됩니다. 여러분은 Exposition, Rising Action, Clincise, Falling Action 및 Denounation으로 표현된 단계들을 들어본 적이 있을 것입니다. 또는 Context, Conflict, Climax, Closure, Conclusion으로 기억하기 쉽습니다. 데이터와 사례를 전달할 때도 비슷한 방법을 사용할 수 있습니다.
Context에서 시작하여 무대를 설정하고 청중이 모두 같은 페이지에 있는지 확인할 수 있습니다. 그런 다음 Conflict을 소개합니다. 왜 이 데이터를 수집해야 했습니까? 어떤 문제를 해결하려고 했습니까? 그 다음 Climax. 데이터가 무엇입니까? 이 데이터는 무엇을 의미합니까? 데이터에 따르면 우리에게 필요한 솔루션은 무엇입니까? 그런 다음 문제와 제안된 솔루션을 반복할 수 있는 Closure에 도달합니다. 마지막으로, 주요 요점과 팀에게 권장하는 다음 단계를 요약할 수 있는 Conclusion에 도달했습니다.
### 4. 의미 있는 단어와 구문을 사용하라
만약 여러분과 제가 함께 제품을 작업하다가 "우리 사용자들이 플랫폼에 접속하는 데 시간이 오래 걸린다"고 말했다면, 얼마나 걸릴 것 같습니까? 한 시간? 일주일? 잘 모르겠는데요. 만약 제가 모든 청중에게 그렇게 말한다면요? 모든 청중은 사용자가 당사 플랫폼에 탑승하는 데 걸리는 시간에 대해 각기 다른 생각을 하게 될 수 있습니다.
대신, "전체 사용자가 가입하고 플랫폼에 탑승하는 데 평균 3분이 소요됩니다."라고 말한다면 어떨까요?
이 메시지는 더 명확합니다. 데이터를 전달할 때, 청중 모두가 여러분과 같은 생각을 하고 있다고 생각하기 쉽습니다. 하지만 항상 그런 것은 아니다. 데이터와 데이터의 명확성을 높이는 것은 소통자로서 여러분의 책임 중 하나입니다. 만약 데이터나 여러분의 이야기가 명확하지 않다면, 여러분의 청중은 따라가는데 어려움을 겪을 것이고, 그들이 여러분의 주요 요점을 이해하게 될 가능성이 더 적습니다.
모호한 단어 대신 의미 있는 단어와 구문을 사용하면 데이터를 보다 명확하게 전달할 수 있습니다. 다음은 몇 가지 예입니다.
- 우리는 인상적인 한 해를 보냈어요!
- 한 사람은 2% - 3%의 매출증가를, 한 사람은 50% - 60%의 매출증가를 의미한다고 생각할 수 있습니다.
- 사용자의 성공률이 *극적으로* 증가했습니다.
- 급격한 상승폭은 얼마나 큰가?
- 이 사업은 *중대한* 노력이 필요합니다.
- 얼마나 많은 노력이 중요한가?
모호한 단어를 사용하면 앞으로 다가올 더 많은 데이터를 소개하거나 방금 말한 내용을 요약하는 데 유용할 수 있습니다. 하지만 청중들을 위해 프레젠테이션의 모든 부분이 명확하도록 하는 것을 고려하십시오.
### 5. 감정을 사용하라
감정은 이야기를 하는 데 핵심입니다. 데이터를 사용하여 이야기를 할 때는 더욱 중요합니다. 데이터를 전달할 때는 모든 것이 요점에 집중됩니다. 청중을 위해 감정을 불러일으킬 때, 그것은 그들이 공감하도록 돕고, 그들이 행동을 취하도록 더 쉽게 만듭니다. 감정은 또한 청중이 당신의 메시지를 기억할 가능성을 증가시킵니다.
여러분은 이것을 전에 TV 광고에서 본 적이 있을 것입니다. 어떤 광고는 매우 침울하고 슬픈 감정을 사용하여 청중들과 소통하고 그들이 제시하는 데이터를 매우 두드러지게 만듭니다. 또는, 어떤 광고들은 매우 낙관적이고 여러분이 그들의 데이터를 행복한 느낌과 연관시키도록 만들 수도 있습니다.
데이터를 전달할 때 감정을 어떻게 사용합니까? 다음은 몇 가지 방법입니다.
- 사용후기 및 개인 이야기 사용
- 데이터를 수집할 때는 양적 및 질적 데이터를 모두 수집하고, 커뮤니케이션 시에는 두 가지 유형의 데이터를 통합하도록 노력합니다. 데이터가 주로 양적인 경우, 데이터를 통해 얻은 경험에 대해 자세히 알아볼 수 있는 개인의 사례를 찾아보십시오.
- 비유 사용
- 비유는 청중들이 상황 속의 자신을 볼 수 있도록 도와줍니다. 비유를
사용하면, 당신이 느끼는 감정을 청중도 느끼게 할 수 있습니다.
그들이 여러분의 데이터에 대해 알아야 합니다.
- 색상 사용
- 색깔마다 다른 감정을 불러일으킵니다. 인기 있는 색깔과 그들이 불러일으키는 감정은 다음과 같습니다. 색깔이 다른 문화에서 다른 의미를 가질 수 있다는 것을 알아두세요.
- 파란색은 보통 평화와 신뢰의 감정을 불러일으킨다.
- 녹색은 대개 자연 및 환경과 관련이 있다.
- 빨간색은 대개 열정과 흥분이다.
- 노란색은 보통 낙관적이고 행복하다.
# 커뮤니케이션 사례 연구
Emerson은 모바일 앱의 제품 관리자입니다. Emerson은 고객들이 주말에 42% 더 많은 불만사항과 버그 보고서를 제출한다는 것을 알게 되었습니다. 에머슨은 또한 48시간 후에 답변되지 않는 불만 사항을 제출하는 고객들이 앱스토어에서 1, 2점을 받을 가능성이 32% 더 높다는 것을 알아챘습니다.
조사를 한 후, 에머슨은 이 문제를 해결할 몇 가지 해결책을 찾았습니다. Emerson은 데이터와 제안된 솔루션을 전달하기 위해 3사 리더들과 30분간 미팅을 갖습니다.
이 미팅에서 에머슨의 목표는 아래 두 가지 솔루션이 앱의 등급을 향상시킬 수 있다는 점을 이해시켜 수익을 높일 수 있도록 하는 것입니다.
**해상도 1.** 주말에 일할 고객 서비스 담당자 고용
**솔루션 2.** 고객 서비스 담당자가 가장 오래 대기한 불만 사항을 쉽게 식별할 수 있는 새로운 고객 서비스 티켓팅 시스템을 구입하여 어떤 불만 사항을 가장 빨리 해결해야 하는지 알 수 있습니다.
미팅에서 에머슨은 5분 동안 앱스토어에서 낮은 점수를 받는 것이 나쁜 이유에 대해 설명하고, 10분 동안 조사 과정과 동향을 파악한 방법에 대해 설명하고, 10분 동안 최근의 고객 불만 사항을 살펴보고, 마지막 5분 동안 2가지 잠재적인 해결책을 둘러댔습니다.
이것이 에머슨에게 회의에서 의사소통을 하기 위한 효과적인 방법이었을까요?
회의 중에 첫번째 회사의 책임자는 에머슨이 겪은 10분간의 고객 불만 사항에 대해 집중했습니다. 회의 후, 그가 기억하는 것은 불만 사항들뿐이었습니다. 두번째 회사의 책임자는 주로 에머슨이 연구 과정을 설명하는 데 초점을 맞췄고, 세 번째 회사 책임자는 에머슨이 제안한 솔루션을 기억했지만 이러한 솔루션이 어떻게 구현될 수 있을지는 확신하지 못했습니다.
위의 상황에서, 여러분은 에머슨이 책임자들에게 무엇을 알아차리길 원했는지와 그들이 회의에서 무엇을 얻어 갔는지 사이에 상당한 차이가 있다는 것을 알 수 있습니다. 다음은 에머슨이 고려할 수 있는 또 다른 접근법입니다.
에머슨은 어떻게 이 접근법을 개선할 수 있었을까요?
Context(상황), Conflict(갈등), Climax(절정), Closure(종결), Conclusion(결론)
**Context** - Emerson은 처음 5분 동안 전체 상황을 소개하고 해당 문제가 수익과 같이 회사에 중요한 지표에 어떤 영향을 미치는지 책임자들이 이해하도록 해야합니다.
"현재 앱스토어에서 우리 앱의 등급은 2.5점입니다. 앱 스토어의 등급은 앱 스토어 최적화에 매우 중요한데, 이는 검색에서 앱을 보는 사용자 수와 앱이 사용자를 바라보는 시각에 영향을 미칩니다. 또한, 우리가 가지고 있는 사용자 수는 수익과 직접적으로 관련이 있습니다."
**Conflict** 에머슨은 앞으로 5분 정도 분쟁에 대해 이야기할 수 있습니다.
"사용자들은 주말에 42% 더 많은 불만사항과 버그 보고서를 제출할 수 있습니다. 48시간 후에 답변이 없는 불만 사항을 제출한 고객은 앱스토어에서 2점 이상의 점수를 받을 가능성이 32% 이상 낮습니다. 앱스토어에서 앱의 등급을 4점으로 개선하면 가시성이 20-30% 향상될 것이며, 이를 통해 수익은 10% 증가할 것으로 예상됩니다." 물론 에머슨은 이 숫자들을 정당화할 준비를 해야 합니다.
**Climax** 기반을 다진 후, 에머슨은 클라이맥스를 5분 정도 진행할 수 있습니다.
Emerson은 제안된 솔루션을 소개하고, 솔루션이 요약된 문제를 어떻게 해결할 것인지, 이러한 솔루션이 기존 워크플로우에 어떻게 구현될 수 있는지, 솔루션 비용, 솔루션의 ROI를 제시할 수 있으며, 구현될 경우 솔루션이 어떻게 보일지 스크린샷이나 와이어프레임을 보여줄 수도 있습니다. 에머슨은 또한 48시간 이상 걸려 불만을 해결한 사용자들의 후기와 현재 발권 시스템에 대한 의견을 가진 회사 내 고객 서비스 담당자의 후기를 공유할 수 있습니다.
**Closure** 이제 Emerson은 회사가 직면한 문제를 5분 동안 재점검하고 제안된 솔루션을 다시 살펴보고 해당 솔루션이 적합한 이유를 검토할 수 있습니다.
**Conclusion** 이 회의는 쌍방향 커뮤니케이션이 사용되는 소수의 이해 관계자와의 회의이므로, 회의 종료 전에 팀 책임자들은 혼란스러운 사항을 명확히 하기 위해 10분간 Emerson에게 질문을 할 수 있습니다.
Emerson이 #2번 접근 방식을 택했다면, 팀 책임자는 Emerson이 의도했던 대로 미팅이 끝나고 불만사항과 버그를 처리하는 방식을 개선할 수 있으며, 이러한 개선을 실현하기 위해 두 가지 솔루션을 사용할 수 있습니다. 이 접근법은 에머슨이 전달하고자 하는 데이터와 이야기를 전달하는데 훨씬 더 효과적인 접근법이 될 것입니다.
# 결론
### 요점 요약
- 의사소통이란 정보를 전달하거나 교환하는 것입니다.
- 데이터를 전달할 때, 여러분의 목표는 단순히 청중들에게 숫자를 전달하는 것이 아니어야 합니다. 여러분의 목표는 데이터로 얻을 수 있는 이야기를 전달하는 것이어야 합니다.
- 단방향 통신(응답의사가 없는 정보 전달)과 양방향 통신(정보가 앞뒤로 전달된다) 두 가지가 있습니다.
- 데이터를 사용하여 이야기를 들려주기 위해 사용할 수 있는 여러 가지 전략이 있습니다. 살펴본 5가지 전략은 다음과 같습니다.
- 청중, 매체 및 커뮤니케이션 방법 이해
- 끝을 염두에 두고 시작
- 실제 이야기처럼 접근하기
- 의미 있는 단어와 구문을 사용
- 감정 사용
## [강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/31)
### 자습을 위한 추천 자료
[스토리텔링의 5대 C - 분명한 설득](http://articulatepersuasion.com/the-five-cs-of-storytelling/)
[1.4 커뮤니케이터로서의 책임 성공을 위한 비즈니스 커뮤니케이션(umn.edu)](https://open.lib.umn.edu/businesscommunication/chapter/1-4-your-responsibilities-as-a-communicator/))
[데이터로 이야기를 하는 방법(hbr.org)](https://hbr.org/2013/04/how-to-tell-a-story-with-data)
[양방향 커뮤니케이션: 더 많은 업무를 위한 4가지 팁(yourthoughtpartner.com)](https://www.yourthoughtpartner.com/blog/bid/59576/4-steps-to-increase-employee-engagement-through-two-way-communication)
[훌륭한 데이터 스토리텔링을 위한 6가지 간단한 단계 - BarnRaiser, LLC(barnraisersllc.com)](https://barnraisersllc.com/2021/05/02/6-succinct-steps-to-great-data-storytelling/)
[데이터로 이야기를 하는 방법 | 루시드차트 블로그](https://www.lucidchart.com/blog/how-to-tell-a-story-with-data)
[6C의 효과적인 소셜 미디어 스토리텔링 | 더 멋진 통찰력](https://coolerinsights.com/2018/06/effective-storytelling-social-media/)
[프레젠테이션에서 감정의 중요성 | Ethos3 - 프리젠테이션 교육 및 디자인 기관](https://ethos3.com/2015/02/the-importance-of-emotions-in-presentations/)
[데이터 스토리텔링: 감정과 합리적인 의사 결정 연결(toucantoco.com)](https://www.toucantoco.com/en/blog/data-storytelling-dataviz)
[감성 광고: 브랜드가 감정을 이용해 사람들을 매수하는 방법(hubspot.com)](https://blog.hubspot.com/marketing/emotions-in-advertising-examples)
[프레젠테이션 슬라이드의 색상 선택 | 슬라이드 밖에서 생각하십시오](https://www.thinkoutsidetheslide.com/choosing-colors-for-your-presentation-slides/)
[데이터 제시 방법 [10가지 전문가 팁] | 관찰 포인트](https://resources.observepoint.com/blog/10-tips-for-presenting-data)
[Microsoft Word - 설득 지침.doc(tpsnva.org)](https://www.tpsnva.org/teach/lq/016/persinstr.pdf)
[데이터를 위한 스토리의 힘(thinkhdi.com)](https://www.thinkhdi.com/library/supportworld/2019/power-story-your-data.aspx)
[데이터 프레젠테이션(perceptualedge.com)의 일반적인 실수](https://www.perceptualedge.com/articles/ie/data_presentation.pdf)
[인포그래픽: 다음은 피해야 할 15가지 일반적인 데이터 오류(visualcapitalist.com)](https://www.visualcapitalist.com/here-are-15-common-data-fallacies-to-avoid/)
[체리 피킹: 사람들이 싫어하는 증거를 무시할 때 효과학](https://effectiviology.com/cherry-picking/#How_to_avoid_cherry_picking)
[데이터로 이야기를 하다: 데이터 과학에서의 소통 | Sonali Verghese | 데이터 과학을 향해서](https://towardsdatascience.com/tell-stories-with-data-communication-in-data-science-5266f7671d7)
[1. 데이터 통신 - Tableau와 데이터 통신 [Book] (oreilly.com)](https://www.oreilly.com/library/view/communicating-data-with/9781449372019/ch01.html))
## 과제
[이야기를 들려주세요](assignment.md)

@ -8,7 +8,7 @@ In these lessons, you'll explore some of the aspects of the Data Science lifecyc
### Topics
1. [Introduction](14-Introduction/README.md)
2. [Analyzing](15-Analyzing/README.md)
2. [Analyzing](15-analyzing/README.md)
3. [Communication](16-communication/README.md)
### Credits

@ -0,0 +1,16 @@
# O ciclo de vida da Ciência de Dados
![communication](../images/communication.jpg)
> Foto por <a href="https://unsplash.com/@headwayio?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Headway</a> em <a href="https://unsplash.com/s/photos/communication?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Nessas lições, você explorará alguns dos aspectos do ciclo de vida da ciência de dados, incluindo análise e comunicação em torno de dados.
### Tópicos
1. [Introdução](14-Introduction/README.md)
2. [Analisando](15-Analyzing/README.md)
3. [Comunicação](16-communication/README.md)
### Créditos
Estas lições foram escritas com ❤️ por [Jalen McGee](https://twitter.com/JalenMCG) e [Jasmine Greenaway](https://twitter.com/paladique)

@ -0,0 +1,16 @@
# 数据科学的生命周期
![communication](../images/communication.jpg)
> 拍摄者 <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) 用 ❤️ 编写

@ -0,0 +1,99 @@
# 클라우드에서의 데이터 사이언스 소개
|![ [(@sketchthedocs)의 스케치노트](https://sketchthedocs.dev) ](../../../sketchnotes/17-DataScience-Cloud.png)|
|:---:|
| 클라우드의 데이터 사이언스: 소개 - _[@nitya](https://twitter.com/nitya)_ 의 스케치노트 |
이 강의에서는 클라우드의 기본 원칙을 배운 다음 클라우드 서비스를 사용하여 데이터 사이언스 프로젝트를 실행하는 것이 왜 흥미로운지 알게 되고, 클라우드에서 실행되는 데이터 사이언스 프로젝트들 중 몇가지 예시를 보게 될 것이다.
## [강의전 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/32)
## 클라우드란?
클라우드 또는 클라우드 컴퓨팅은 인터넷을 통해 인프라에서 호스팅되는 다양한 종량제 컴퓨팅 서비스를 제공하는 것입니다. 서비스에는 스토리지, 데이터베이스, 네트워킹, 소프트웨어, 분석 및 지능형 서비스와 같은 솔루션이 포함됩니다.
일반적으로 다음과 같이 퍼블릭, 프라이빗 및 하이브리드 클라우드를 구분합니다.
* 퍼블릭 클라우드: 퍼블릭 클라우드는 인터넷을 통해 대중에게 컴퓨팅 리소스를 제공하는 타사 클라우드 서비스 제공업체가 소유하고 운영합니다.
* 프라이빗 클라우드: 단일 기업이나 조직에서 독점적으로 사용하는 클라우드 컴퓨팅 자원을 말하며, 사설망에서 서비스와 인프라를 유지 관리합니다.
* 하이브리드 클라우드: 하이브리드 클라우드는 퍼블릭 클라우드와 프라이빗 클라우드를 결합한 시스템입니다. 사용자는 온프레미스 데이터 센터를 선택하는 동시에 데이터와 애플리케이션을 하나 이상의 퍼블릭 클라우드에서 실행할 수 있습니다.
대부분의 클라우드 컴퓨팅 서비스는 IaaS(Infrastructure as a Service), PaaS(Platform as a Service) 및 SaaS(Software as a Service)의 세 가지 범주로 나뉩니다.
* IaaS(Infrastructure as a Service): 사용자는 서버 및 가상 머신(VM), 스토리지, 네트워크, 운영 체제와 같은 IT 인프라를 임대합니다.
* PaaS(Platform as a Service): 사용자는 소프트웨어 애플리케이션을 개발, 테스트, 제공 및 관리하기 위한 환경을 임대합니다. 사용자는 개발에 필요한 서버, 스토리지, 네트워크 및 데이터베이스의 기본 인프라를 설정하거나 관리하는 것에 대해 걱정할 필요가 없습니다.
* SaaS(Software as a Service): 사용자는 주문형 및 일반적으로 구독 기반으로 인터넷을 통해 소프트웨어 응용 프로그램에 액세스할 수 있습니다. 사용자는 소프트웨어 업그레이드 및 보안 패치와 같은 유지 관리, 기본 인프라 또는 소프트웨어 애플리케이션의 호스팅 및 관리에 대해 걱정할 필요가 없습니다.
가장 큰 클라우드 제공업체로는 Amazon Web Services, Google Cloud Platform 및 Microsoft Azure가 있습니다.
## 데이터 사이언스을 위해 클라우드를 선택하는 이유는 무엇입니까?
개발자와 IT 전문가는 다음을 비롯한 여러 가지 이유로 클라우드와 함께 작업하기로 결정했습니다.
* 혁신: 클라우드 공급자가 만든 혁신적인 서비스를 앱에 직접 통합하여 애플리케이션을 강화할 수 있습니다.
* 유연성: 필요한 서비스에 대해서만 비용을 지불하고 다양한 서비스 중에서 선택할 수 있습니다. 일반적으로 사용한 만큼 지불하고, 진화하는 요구 사항에 따라 서비스를 조정합니다.
* 예산: 하드웨어 및 소프트웨어 구입, 현장 데이터 센터 설정 및 실행을 위해 초기 투자를 할 필요가 없으며 사용한 만큼만 비용을 지불하면 됩니다.
* 확장성: 리소스는 프로젝트의 요구 사항에 따라 확장될 수 있습니다. 즉, 앱은 주어진 시간에 외부 요인에 적응하여 컴퓨팅 성능, 스토리지 및 대역폭을 어느 정도 사용할 수 있습니다.
* 생산성: 데이터 센터 관리와 같이 다른 사람이 관리할 수 있는 작업에 시간을 할애하지 않고 비즈니스에 집중할 수 있습니다.
* 안정성: 클라우드 컴퓨팅은 데이터를 지속적으로 백업할 수 있는 여러 가지 방법을 제공하며 위기 상황에서도 비즈니스와 서비스를 계속 운영할 수 있도록 재해 복구 계획을 세울 수 있습니다.
* 보안: 프로젝트 보안을 강화하는 정책, 기술 및 제어의 이점을 누릴 수 있습니다.
사람들이 클라우드 서비스를 선택하는 가장 일반적인 이유 중 일부는 다음과 같습니다. 이제 클라우드가 무엇이고 주요 이점이 무엇인지 더 잘 이해했으므로 데이터를 다루는 데이터 과학자 및 개발자의 작업과, 그들이 직면할 수 있는 여러 문제를 클라우드가 어떻게 도울 수 있는지 자세히 살펴보겠습니다.
* 대용량 데이터 저장: 대용량 서버를 구입, 관리 및 보호하는 대신 Azure Cosmos DB, Azure SQL Database 및 Azure Data Lake Storage와 같은 솔루션을 사용하여 클라우드에 직접 데이터를 저장할 수 있습니다.
* 데이터 통합 ​​수행: 데이터 통합은 데이터 수집에서 데이터 변환을 수행할 수 있도록 변환해주는 데이터 사이언스의 필수 부분입니다. 클라우드에서 제공되는 데이터 통합 ​​서비스를 사용하면 Data Factory를 사용하여 다양한 소스의 데이터를 수집, 변환 및 단일 데이터 웨어하우스로 통합할 수 있습니다.
* 데이터 처리: 방대한 양의 데이터를 처리하려면 많은 컴퓨팅 성능이 필요하며 모든 사람이 그에 적합한 강력한 시스템에 액세스할 수 있는 것은 아닙니다. 그래서 많은 사람들이 클라우드의 엄청난 컴퓨팅 성능을 직접 활용하여 솔루션을 실행하고 배포하는 방법을 선택합니다.
* 데이터 분석 서비스 사용: 데이터를 실행 가능한 통찰력으로 전환하는 데 도움이 되는 Azure Synapse Analytics, Azure Stream Analytics 및 Azure Databricks와 같은 클라우드 서비스가 있습니다.
* 기계 학습 및 데이터 인텔리전스(data intelligence) 서비스 사용: 처음부터 시작하는 대신 AzureML과 같은 서비스와 함께 클라우드 공급자가 제공하는 기계 학습 알고리즘을 사용할 수 있습니다. 또한 음성을 텍스트로 변환, 텍스트를 음성으로 변환, 컴퓨터 비전 등과 같은 인지 서비스를 사용할 수 있습니다.
## 클라우드 데이터 사이언스의 예
몇 가지 시나리오를 살펴봄으로 더 확실히 이해해봅시다.
### 실시간 소셜 미디어 감성 분석
기계 학습을 시작하는 사람들이 일반적으로 연구하는 시나리오인 실시간 소셜 미디어 감정 분석부터 시작하겠습니다.
뉴스 미디어 웹사이트를 운영 중이고 실시간 데이터를 활용하여 독자들이 어떤 콘텐츠에 관심을 가질 수 있는지 이해하고 싶다고 가정해 보겠습니다. 이에 대해 자세히 알아보기 위해, 독자와 관련된 주제에 대해, Twitter 출판물의 데이터에 대한 실시간 감정 분석을 수행하는 프로그램을 구축할 수 있습니다.
주요 지표는 특정 주제(해시태그)에 대한 트윗의 양과 특정 주제에 대한 감정 분석을 수행하는 분석 도구를 사용하여 설정한 감정입니다.
이 프로젝트를 만드는 데 필요한 단계는 다음과 같습니다.
* Twitter에서 데이터를 수집할 스트리밍 입력을 위한 이벤트 허브 만들기
* Twitter 스트리밍 API를 호출할 Twitter 클라이언트 애플리케이션 구성 및 시작
* Stream Analytics 작업 만들기
* 작업 입력 및 쿼리 지정
* 출력 싱크 생성 및 작업 출력 지정
* Job 실행
전체 프로세스를 보려면 [문서](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-twitter-sentiment-analysis-trends?WT.mc_id=academic-40229-cxa&ocid)를 확인하세요. =AID30411099).
### 과학 논문 분석
이 커리큘럼의 저자 중 한 명인 [Dmitry Soshnikov](http://soshnikov.com)가 만든 프로젝트의 또 다른 예를 들어보겠습니다.
Dmitry는 COVID 논문을 분석하는 도구를 만들었습니다. 이 프로젝트를 검토하면 과학 논문에서 지식을 추출하고 통찰력을 얻으며 연구자가 효율적인 방식으로 방대한 논문 컬렉션을 탐색하는 데 도움이 되는 도구를 만드는 방법을 알 수 있습니다.
이를 위해 사용된 다양한 단계를 살펴보겠습니다.
* [Text Analytics for Health](https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?WT.mc_id=academic-40229-cxa&ocid=AID3041109)로 정보 추출 및 전처리
* [Azure ML](https://azure.microsoft.com/services/machine-learning?WT.mc_id=academic-40229-cxa&ocid=AID3041109)을 사용하여 처리 병렬화
* [Cosmos DB](https://azure.microsoft.com/services/cosmos-db?WT.mc_id=academic-40229-cxa&ocid=AID3041109)로 정보 저장 및 조회
* Power BI를 사용하여 데이터 탐색 및 시각화를 위한 대화형 대시보드 만들기
전체 과정을 보려면 [Dmitry의 블로그](https://soshnikov.com/science/analyzing-medical-papers-with-azure-and-text-analytics-for-health/)를 방문하세요.
보시다시피 클라우드 서비스를 다양한 방식으로 활용하여 데이터 사이언스을 수행할 수 있습니다.
## 각주
출처:
* https://azure.microsoft.com/overview/what-is-cloud-computing?ocid=AID3041109
* https://docs.microsoft.com/azure/stream-analytics/stream-analytics-twitter-sentiment-analysis-trends?ocid=AID3041109
* https://soshnikov.com/science/analyzing-medical-papers-with-azure-and-text-analytics-for-health/
## 강의 후 퀴즈
[강의 후 퀴즈](https://red-water-0103e7a0f.azurestaticapps.net/quiz/33)
## 과제
[시장조사](./assignment.ko.md)

@ -0,0 +1,10 @@
# 시장 조사
## 지침
이 학습에서는 몇 가지 중요한 클라우드 제공자가 있다는 것을 배웠습니다. 시장 조사를 통해 각각이 데이터 과학자에게 무엇을 제공할 수 있는지 알아보세요. 제공하는 것들이 비교될 수 있습니까? 3개 이상의 클라우드 제공업체가 제공하는 서비스를 설명하는 문서를 작성하십시오.
## 기준표
모범 | 충분 | 개선 필요
--- | --- | -- |
한 페이지짜리 문서에서는 세 가지 클라우드 제공업체의 데이터 과학 제품에 대해 설명하고 이를 구분합니다. | 더 짧은 논문이 제시됩니다 | 분석을 완료하지 않고 논문을 발표함

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save