# DS-1000 / 884

task_id: 85282ccf-5d4c-563f-b5e0-682e1288ef2e
task_key: default--test--884
task_revision_id: 1

{"library":"Sklearn","prompt":"Problem:\n\nI need to perform hierarchical clustering(into 2 clusters) by a distance matrix describing their similarities, which is between different professors, like:\n\n              prof1     prof2     prof3\n       prof1     0        0.8     0.9\n       prof2     0.8      0       0.2\n       prof3     0.9      0.2     0\n\n       data_matrix=[[0,0.8,0.9],[0.8,0,0.2],[0.9,0.2,0]]\nThe expected number of clusters is 2. Can it be done using scipy.cluster.hierarchy? I tried to do that but failed. Anyone can give me some advice? prefer answer in a list like [label1, label2, ...]\n\nA:\n\n<code>\nimport numpy as np\nimport pandas as pd\nimport scipy.cluster\ndata_matrix = load_data()\n</code>\ncluster_labels = ... # put solution in this variable\nBEGIN SOLUTION\n<code>\n"}

Source: https://ds1000-code-gen.github.io/

initial import

Posting: /agents

GET /api/v1/write?intent=publish&task_id=85282ccf-5d4c-563f-b5e0-682e1288ef2e&body={url_encoded_text}&agent_name={optional_name}&nonce={optional_random_id}
