comparison notebooks/test_hubness.ipynb @ 18:ed109218dd4b branch-tests

rename result scripts and more tests
author Maria Panteli
date Tue, 12 Sep 2017 23:18:19 +0100
parents ff18f364bbac
children 29b5ee381305 bd284065aeb6
comparison
equal deleted inserted replaced
17:2e487b9c0a7b 18:ed109218dd4b
17 "\n", 17 "\n",
18 "%load_ext autoreload\n", 18 "%load_ext autoreload\n",
19 "%autoreload 2\n", 19 "%autoreload 2\n",
20 "\n", 20 "\n",
21 "sys.path.append('../')\n", 21 "sys.path.append('../')\n",
22 "import scripts.results as results\n", 22 "import scripts.outliers as outliers\n",
23 "import scripts.utils_spatial as utils_spatial" 23 "import scripts.utils_spatial as utils_spatial"
24 ] 24 ]
25 }, 25 },
26 { 26 {
27 "cell_type": "code", 27 "cell_type": "code",
66 ] 66 ]
67 } 67 }
68 ], 68 ],
69 "source": [ 69 "source": [
70 "X_list, Y, Yaudio = pickle.load(open('../data/lda_data_melodia_8.pickle','rb'))\n", 70 "X_list, Y, Yaudio = pickle.load(open('../data/lda_data_melodia_8.pickle','rb'))\n",
71 "ddf = results.load_metadata(Yaudio, metadata_file='../data/metadata.csv')\n", 71 "ddf = outliers.load_metadata(Yaudio, metadata_file='../data/metadata.csv')\n",
72 "w, data_countries = utils_spatial.get_neighbors_for_countries_in_dataset(Y)\n", 72 "w, data_countries = utils_spatial.get_neighbors_for_countries_in_dataset(Y)\n",
73 "w_dict = utils_spatial.from_weights_to_dict(w, data_countries)\n", 73 "w_dict = utils_spatial.from_weights_to_dict(w, data_countries)\n",
74 "Xrhy, Xmel, Xmfc, Xchr = X_list\n", 74 "Xrhy, Xmel, Xmfc, Xchr = X_list\n",
75 "X = np.concatenate((Xrhy, Xmel, Xmfc, Xchr), axis=1)\n", 75 "X = np.concatenate((Xrhy, Xmel, Xmfc, Xchr), axis=1)\n",
76 "\n", 76 "\n",
77 "# global outliers\n", 77 "# global outliers\n",
78 "df_global, threshold, MD = results.get_outliers_df(X, Y, chi2thr=0.999)" 78 "df_global, threshold, MD = outliers.get_outliers_df(X, Y, chi2thr=0.999)"
79 ] 79 ]
80 }, 80 },
81 { 81 {
82 "cell_type": "code", 82 "cell_type": "code",
83 "execution_count": 3, 83 "execution_count": 3,