mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-12 19:00:43 -04:00
chore(i18n,learn): processed translations (#54077)
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
This commit is contained in:
committed by
GitHub
parent
c742a22ac2
commit
cc87f4455d
@@ -18,7 +18,7 @@ Python カリキュラムの対話式教育コンテンツを引き続き開発
|
||||
|
||||
# --instructions--
|
||||
|
||||
このプロジェクトでは、Matplotlib、Seaborn、Pandas を使用して診察データを可視化し、計算を行います。 データセットの値は診察時に収集されたものです。
|
||||
In this project, you will visualize and make calculations from medical examination data using `matplotlib`, `seaborn`, and `pandas`. データセットの値は診察時に収集されたものです。
|
||||
|
||||
## データの説明
|
||||
|
||||
@@ -43,23 +43,49 @@ Python カリキュラムの対話式教育コンテンツを引き続き開発
|
||||
|
||||
## タスク
|
||||
|
||||
`examples/Figure_1.png` のようなグラフを作成してください。この例では、患者の `cholesterol`、`gluc`、`alco`、`active`、`smoke` について良い結果と悪い結果の数を示し、cardio=1 の場合と cardio=0 の場合を別々のパネルに表示しています。
|
||||
Create a chart similar to `examples/Figure_1.png`, where we show the counts of good and bad outcomes for the `cholesterol`, `gluc`, `alco`, `active`, and `smoke` variables for patients with `cardio=1` and `cardio=0` in different panels.
|
||||
|
||||
`medical_data_visualizer.py` で、データを使用して次のタスクを完了してください。
|
||||
|
||||
- データに `overweight` 列を追加します。 overweight (太りすぎ) かどうかを判断するには、まず、体重 (キログラム単位) を身長 (メートル単位) の 2 乗で割って BMI (ボディマス指数) を計算します。 その値が 25 より大きい場合、その人は太りすぎです。 太りすぎではない場合は値 0 を使用し、太りすぎの場合は値 1 を使用します。
|
||||
- 0 を常に良とし、1 を常に悪としてデータを正規化します。 `cholesterol` または `gluc` の値が 1 の場合は、この値を 0 にします。 値が 1 より大きい場合は、値を 1 とします。
|
||||
- データをロング形式 (long-form) に変換し、seabornの `catplot()` を使用して、カテゴリ特徴の値の数を示すグラフを作成します。 データセットは 'Cardio' 別に分割し、`cardio` の値ごとに 1 つずつグラフを作成します。 `examples/Figure_1.png` のようなグラフを表示する必要があります。
|
||||
- データに `overweight` 列を追加します。 overweight (太りすぎ) かどうかを判断するには、まず、体重 (キログラム単位) を身長 (メートル単位) の 2 乗で割って BMI (ボディマス指数) を計算します。 その値が 25 より大きい場合、その人は太りすぎです。 Use the value `0` for NOT overweight and the value `1` for overweight.
|
||||
- Normalize the data by making `0` always good and `1` always bad. If the value of `cholesterol` or `gluc` is `1`, make the value `0`. If the value is more than `1`, make the value `1`.
|
||||
- Convert the data into long format and create a chart that shows the value counts of the categorical features using `seaborn`'s `catplot()`. The dataset should be split by `Cardio` so there is one chart for each `cardio` value. `examples/Figure_1.png` のようなグラフを表示する必要があります。
|
||||
- データをクリーニングします。 正しくないデータを表す次の患者セグメントを除外します。
|
||||
- 最低血圧が最高血圧よりも高い (`(df['ap_lo'] <= df['ap_hi'])`) で正しいデータを保持できます)
|
||||
- 身長が 2.5 パーセンタイルを下回る (`(df['height'] >= df['height'].quantile(0.025))` で正しいデータを保持できます)
|
||||
- 身長が 97.5 パーセンタイルを上回る
|
||||
- 体重が 2.5 パーセンタイルを下回る
|
||||
- 体重が 97.5 パーセンタイルを上回る
|
||||
- データセットを使用して相関行列を作成します。 seabornの `heatmap()` を使用して相関行列をプロットします。 上側の三角形をマスク処理します。 `examples/Figure_2.png` のようなグラフを表示する必要があります。
|
||||
- データセットを使用して相関行列を作成します。 Plot the correlation matrix using `seaborn`'s `heatmap()`. 上側の三角形をマスク処理します。 `examples/Figure_2.png` のようなグラフを表示する必要があります。
|
||||
|
||||
変数が `None`に設定された場合は、必ず正しいコードに設定してください。
|
||||
|
||||
Unit tests are written for you under `test_module.py`.
|
||||
|
||||
## Instructions
|
||||
By each number in the `medical_data_visualizer.py` file, add the code from the associated instruction number below.
|
||||
|
||||
1. Import the data from `medical_examination.csv` and assign it to the `df` variable
|
||||
2. Create the `overweight` column in the `df` variable
|
||||
3. Normalize data by making `0` always good and `1` always bad. If the value of `cholesterol` or `gluc` is 1, set the value to `0`. If the value is more than `1`, set the value to `1`.
|
||||
4. Draw the Categorical Plot in the `draw_cat_plot` function
|
||||
5. Create a DataFrame for the cat plot using `pd.melt` with values from `cholesterol`, `gluc`, `smoke`, `alco`, `active`, and `overweight` in the `df_cat` variable.
|
||||
6. Group and reformat the data in `df_cat` to split it by `cardio`. Show the counts of each feature. You will have to rename one of the columns for the `catplot` to work correctly.
|
||||
7. Convert the data into `long` format and create a chart that shows the value counts of the categorical features using the following method provided by the seaborn library import : `sns.catplot()`
|
||||
8. Get the figure for the output and store it in the `fig` variable
|
||||
9. Do not modify the next two lines
|
||||
10. Draw the Heat Map in the `draw_heat_map` function
|
||||
11. Clean the data in the `df_heat` variable by filtering out the following patient segments that represent incorrect data:
|
||||
- height is less than the 2.5th percentile (Keep the correct data with `(df['height'] >= df['height'].quantile(0.025))`)
|
||||
- height is more than the 97.5th percentile
|
||||
- weight is less than the 2.5th percentile
|
||||
- weight is more than the 97.5th percentile
|
||||
12. Calculate the correlation matrix and store it in the `corr` variable
|
||||
13. Generate a mask for the upper triangle and store it in the `mask` variable
|
||||
14. Set up the `matplotlib` figure
|
||||
15. Plot the correlation matrix using the method provided by the `seaborn` library import: `sns.heatmap()`
|
||||
16. Do not modify the next two lines
|
||||
|
||||
## 開発
|
||||
|
||||
Write your code in `medical_data_visualizer.py`. For development, you can use `main.py` to test your code.
|
||||
|
||||
Reference in New Issue
Block a user