\n",
" \n",
- " | 0 | \n",
- " I was bothered by things that usually donât bo... | \n",
- " 4 | \n",
- "
\n",
- " \n",
- " | 1 | \n",
- " I did not feel like eating; my appetite was poor. | \n",
- " 2 | \n",
- "
\n",
- " \n",
- " | 2 | \n",
- " I felt that I could not shake off the blues ev... | \n",
- " 2 | \n",
- "
\n",
- " \n",
- " | 3 | \n",
- " I felt I was just as good as other people. | \n",
- " 3 | \n",
- "
\n",
- " \n",
- " | 4 | \n",
- " I had trouble keeping my mind on what I was do... | \n",
- " 2 | \n",
- "
\n",
- " \n",
- " | 5 | \n",
- " I felt depressed. | \n",
- " 1 | \n",
- "
\n",
- " \n",
- " | 6 | \n",
- " I felt that everything I did was an effort. | \n",
- " 2 | \n",
- "
\n",
- " \n",
- " | 7 | \n",
- " I felt hopeful about the future. | \n",
- " 3 | \n",
- "
\n",
- " \n",
- " | 8 | \n",
- " I thought my life had been a failure. | \n",
- " 2 | \n",
- "
\n",
- " \n",
- " | 9 | \n",
- " I felt fearful. | \n",
- " 1 | \n",
- "
\n",
- " \n",
- " | 10 | \n",
- " My sleep was restless. | \n",
- " 0 | \n",
- "
\n",
- " \n",
- " | 11 | \n",
- " I was happy. | \n",
- " 3 | \n",
- "
\n",
- " \n",
- " | 12 | \n",
- " I talked less than usual. | \n",
- " 2 | \n",
- "
\n",
- " \n",
- " | 13 | \n",
- " I felt lonely. | \n",
- " 2 | \n",
- "
\n",
- " \n",
- " | 14 | \n",
- " People were unfriendly. | \n",
- " 4 | \n",
- "
\n",
- " \n",
- " | 15 | \n",
- " I enjoyed life. | \n",
- " 3 | \n",
- "
\n",
- " \n",
- " | 16 | \n",
- " I had crying spells. | \n",
- " 1 | \n",
- "
\n",
- " \n",
- " | 17 | \n",
- " I felt sad. | \n",
- " 1 | \n",
+ " CES_D English | \n",
+ " 1.000000 | \n",
+ " 0.675000 | \n",
+ " 0.550000 | \n",
"
\n",
" \n",
- " | 18 | \n",
- " I felt that people dislike me. | \n",
- " 2 | \n",
+ " GAD-7 Portuguese | \n",
+ " 0.675000 | \n",
+ " 1.000000 | \n",
+ " 0.642857 | \n",
"
\n",
" \n",
- " | 19 | \n",
- " I could not get âgoing.â | \n",
- " 2 | \n",
- "
\n",
- " \n",
- " | 20 | \n",
- " Sentir-se nervoso/a, ansioso/a ou muito tenso/a | \n",
- " 1 | \n",
- "
\n",
- " \n",
- " | 21 | \n",
- " NĂŁo ser capaz de impedir ou de controlar as pr... | \n",
- " 4 | \n",
- "
\n",
- " \n",
- " | 22 | \n",
- " Preocupar-se muito com diversas coisas | \n",
- " 4 | \n",
- "
\n",
- " \n",
- " | 23 | \n",
- " Dificuldade para relaxar | \n",
- " 4 | \n",
- "
\n",
- " \n",
- " | 24 | \n",
- " Ficar tĂŁo agitado/a que se torna difĂcil perma... | \n",
- " 1 | \n",
- "
\n",
- " \n",
- " | 25 | \n",
- " Ficar facilmente aborrecido/a ou irritado/a | \n",
- " 4 | \n",
- "
\n",
- " \n",
- " | 26 | \n",
- " Sentir medo como se algo horrĂvel fosse acontecer | \n",
- " 1 | \n",
- "
\n",
- " \n",
- " | 27 | \n",
- " FĂžlt deg nervĂžs, engstelig eller veldig stresset | \n",
- " 1 | \n",
- "
\n",
- " \n",
- " | 28 | \n",
- " Ikke klart Ă„ slutte Ă„ bekymre deg eller kontro... | \n",
- " 4 | \n",
+ " GAD-7 Norwegian | \n",
+ " 0.550000 | \n",
+ " 0.642857 | \n",
+ " 1.000000 | \n",
"
\n",
" \n",
"\n",
""
],
"text/plain": [
- " question_text cluster_number\n",
- "0 I was bothered by things that usually donât bo... 4\n",
- "1 I did not feel like eating; my appetite was poor. 2\n",
- "2 I felt that I could not shake off the blues ev... 2\n",
- "3 I felt I was just as good as other people. 3\n",
- "4 I had trouble keeping my mind on what I was do... 2\n",
- "5 I felt depressed. 1\n",
- "6 I felt that everything I did was an effort. 2\n",
- "7 I felt hopeful about the future. 3\n",
- "8 I thought my life had been a failure. 2\n",
- "9 I felt fearful. 1\n",
- "10 My sleep was restless. 0\n",
- "11 I was happy. 3\n",
- "12 I talked less than usual. 2\n",
- "13 I felt lonely. 2\n",
- "14 People were unfriendly. 4\n",
- "15 I enjoyed life. 3\n",
- "16 I had crying spells. 1\n",
- "17 I felt sad. 1\n",
- "18 I felt that people dislike me. 2\n",
- "19 I could not get âgoing.â 2\n",
- "20 Sentir-se nervoso/a, ansioso/a ou muito tenso/a 1\n",
- "21 NĂŁo ser capaz de impedir ou de controlar as pr... 4\n",
- "22 Preocupar-se muito com diversas coisas 4\n",
- "23 Dificuldade para relaxar 4\n",
- "24 Ficar tĂŁo agitado/a que se torna difĂcil perma... 1\n",
- "25 Ficar facilmente aborrecido/a ou irritado/a 4\n",
- "26 Sentir medo como se algo horrĂvel fosse acontecer 1\n",
- "27 FĂžlt deg nervĂžs, engstelig eller veldig stresset 1\n",
- "28 Ikke klart Ă„ slutte Ă„ bekymre deg eller kontro... 4"
+ " CES_D English GAD-7 Portuguese GAD-7 Norwegian\n",
+ "CES_D English 1.000000 0.675000 0.550000\n",
+ "GAD-7 Portuguese 0.675000 1.000000 0.642857\n",
+ "GAD-7 Norwegian 0.550000 0.642857 1.000000"
]
},
- "execution_count": 18,
+ "execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "from harmony import cluster_questions\n",
- "df, score = cluster_questions(match_response.questions, num_clusters = 5, is_show_graph = True)\n",
- "\n",
- "print (f\"Score = {score}\")\n",
- "\n",
- "df"
+ "harmony.util.convert_matches_to_dataframe(match_response)"
]
},
{
"cell_type": "markdown",
- "id": "066f21a1-8106-4062-8d00-cef33d65ebb0",
+ "id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
"metadata": {},
"source": [
"# Display the similarities between instruments"