Flourish での可視化途中にデータの乱れを見つけてしまった。
データ分析において、データクリーニングが8割。身をもって体感です。今回は趣味だからいいものの。人が入力してるリアルタイム更新データ、いい反省体験になりました。
カテゴリー分けの名前に重複
カテゴリが重複しているんですよね。半角スペースの有り無し、略語とか。日本語と違うややこしさたるや。以下に図(見やすいようyearを添えて)
- 「NON-CRIMINAL」/「NON - CRIMINAL」:ハイフン前後の半角スペース
- 「NON-CRIMINAL(SUBJECT SPECIFIED)」:複数容疑でメーンに据えたと思われ。
- 「CRIMINAL SEXUIAL ASSAULT」/「CRIM SEXUAL ASSAULT」:略語?
ハイフン前後の半角スペース
「NON-CRIMINAL」/「NON - CRIMINAL」/「NON-CRIMINAL(SUBJECT SPECIFIED)」わーそっくり(はよ気づけ)。「NON-CRIMINAL」が3つあるということか…
総数に対して数が十分に少ないので、結果に影響はしないけども。
CRIMINALとCRIM
これは同じ意味のようで。略やアナグラムかとかじゃなく通常使う常識のような。
crim
in American English
criminal
Webster’s New World College Dictionary,4th
(https://www.collinsdictionary.com/jp/dictionary/english/crim)
これはそこそこ数あります。2019年は同じくらいになって、2020年は逆転している。え。入力する人変わった…?
クリーニングの重要性
分析するときはほんっとにデータソースを精査しておかないと、こういうことになる。公開データでもこうなるので、社内とか個人とか、どうなることやら。
日本人は几帳面だから、なんて通じない。というか日本の統計データはエクセルで見目好く作るためにセル統合駆使してて、分析以前に取り込みが苦です。ヘッダーに使う行が多すぎる。Rで統計データ取り込み用パッケージがあるくらいです。
うーん、今回は趣味だからよかったようなものの。性格的には見過ごせない。。反省。
気付けたのはExploratryのおかげです。データラングリング機能がほんとに便利で。後日記述するFlourishのためのデータを整えるためにも使いました。画像はExploratryの作業画面からスクショ。
次回はFroulishでの可視化を書きますが、今回はこのままいきます。もし仕事だったらクライアントと共有して判断を仰ぐ。この場合おそらく統合していいと思うけど、自己判断は危険です。
********
During the visualisation process in Flourish, we found data corruption.
In data analysis, data cleaning is 80%. This time it is a hobby, but not a good one. This is real-time updated data with human input. It was a good reflective experience.
Duplicate names for categorisation
Duplicate categories. With or without half-width spaces, abbreviations, etc. Complications that differ from the Japanese language. Here is a diagram (with year for easy reference)
- "NON-CRIMINAL" / "NON - CRIMINAL": one-byte spaces before and after a hyphen
- "NON-CRIMINAL (SUBJECT SPECIFIED)": probably the main one on multiple charges.
- "CRIMINAL SEXUIAL ASSAULT'" / "CRIM SEXUAL ASSAULT": abbreviation?
Half-width space before and after a hyphen
”NON-CRIMINAL"/"NON - CRIMINAL"/"NON-CRIMINAL(SUBJECT SPECIFIED)" Wow, that looks like it (come on, notice). So there are three "NON-CRIMINAL"...
The numbers are sufficiently small in relation to the total number that it does not affect the results.
CRIMINAL and CRIM.
This seems to mean the same thing. It is not an abbreviation or an anagram, but a common sense that is usually used.
This is a large number. It does not affect the top positions.
In 2019 they will be more or less the same, and in 2020 they be reversed. The people entering the data have changed?
The importance of data-cleaning
This is what happens when you don't properly check the data source when analysing it. This happens even with public data, so it's even more difficult with corporate or personal data.
The Japanese are meticulous. But that is no reason to believe the data.
Japanese statistical data is Excel-based and appearance-oriented, making full use of cell integration, and it is difficult to import the data before analysing it. Too many rows are used for headings.
There are even packages for collecting statistical data in R.
Well, this time it's a hobby, so it's a good thing... I can't overlook it because of my personality.
It was thanks to Exploratry that I realised this. The data wrangling feature was really useful. I also used it to prepare the data for Flourish, which I will describe later. The image is a screenshot of the Exploratry workspace.
Next time I'll write about visualisation in Flourish, but for now I'll leave it at that. If this were a job, I would share it with the client and make a decision. In this case I can probably integrate it, but self-judgment is dangerous.
0コメント