Mercurial > hg > plosone_underreview
comparison notebooks/test_hubness.ipynb @ 71:04fc6e809a42 branch-tests
notebooks
author | mpanteli <m.x.panteli@gmail.com> |
---|---|
date | Fri, 22 Sep 2017 18:03:41 +0100 |
parents | b0e194bfb71d |
children | 930c35ab894c |
comparison
equal
deleted
inserted
replaced
65:9b10b688c2ac | 71:04fc6e809a42 |
---|---|
1 { | 1 { |
2 "cells": [ | 2 "cells": [ |
3 { | 3 { |
4 "cell_type": "code", | 4 "cell_type": "code", |
5 "execution_count": 1, | 5 "execution_count": 16, |
6 "metadata": { | 6 "metadata": {}, |
7 "collapsed": true | 7 "outputs": [ |
8 }, | 8 { |
9 "outputs": [], | 9 "name": "stdout", |
10 "output_type": "stream", | |
11 "text": [ | |
12 "The autoreload extension is already loaded. To reload it, use:\n", | |
13 " %reload_ext autoreload\n" | |
14 ] | |
15 } | |
16 ], | |
10 "source": [ | 17 "source": [ |
11 "import numpy as np\n", | 18 "import numpy as np\n", |
12 "import pickle\n", | 19 "import pickle\n", |
13 "from scipy.stats import pearsonr\n", | 20 "from scipy.stats import pearsonr\n", |
14 "from scipy.stats import skew\n", | 21 "from scipy.stats import skew\n", |
26 "import scripts.utils as utils" | 33 "import scripts.utils as utils" |
27 ] | 34 ] |
28 }, | 35 }, |
29 { | 36 { |
30 "cell_type": "code", | 37 "cell_type": "code", |
31 "execution_count": 3, | 38 "execution_count": 17, |
32 "metadata": { | 39 "metadata": { |
33 "collapsed": true | 40 "collapsed": true |
34 }, | 41 }, |
35 "outputs": [], | 42 "outputs": [], |
36 "source": [ | 43 "source": [ |
44 "#df_global, threshold, MD = outliers.get_outliers_df(X, Y, chi2thr=0.999)" | 51 "#df_global, threshold, MD = outliers.get_outliers_df(X, Y, chi2thr=0.999)" |
45 ] | 52 ] |
46 }, | 53 }, |
47 { | 54 { |
48 "cell_type": "code", | 55 "cell_type": "code", |
49 "execution_count": 4, | 56 "execution_count": 18, |
50 "metadata": {}, | 57 "metadata": {}, |
51 "outputs": [ | 58 "outputs": [ |
52 { | 59 { |
53 "data": { | 60 "data": { |
54 "text/plain": [ | 61 "text/plain": [ |
55 "(8200, 380)" | 62 "(8200, 380)" |
56 ] | 63 ] |
57 }, | 64 }, |
58 "execution_count": 4, | 65 "execution_count": 18, |
59 "metadata": {}, | 66 "metadata": {}, |
60 "output_type": "execute_result" | 67 "output_type": "execute_result" |
61 } | 68 } |
62 ], | 69 ], |
63 "source": [ | 70 "source": [ |
77 "metadata": { | 84 "metadata": { |
78 "collapsed": true | 85 "collapsed": true |
79 }, | 86 }, |
80 "outputs": [], | 87 "outputs": [], |
81 "source": [ | 88 "source": [ |
82 "D = pairwise_distances(X, metric='mahalanobis')" | 89 "D = pairwise_distances(X, metric='mahalanobis')\n", |
83 ] | 90 "np.savetxt('../data/D_mahal.csv', D)" |
84 }, | 91 ] |
85 { | 92 }, |
86 "cell_type": "code", | 93 { |
87 "execution_count": 5, | 94 "cell_type": "code", |
95 "execution_count": 19, | |
88 "metadata": {}, | 96 "metadata": {}, |
89 "outputs": [ | 97 "outputs": [ |
90 { | 98 { |
91 "data": { | 99 "data": { |
92 "text/plain": [ | 100 "text/plain": [ |
93 "(8200, 8200)" | 101 "(8200, 8200)" |
94 ] | 102 ] |
95 }, | 103 }, |
96 "execution_count": 5, | 104 "execution_count": 19, |
97 "metadata": {}, | 105 "metadata": {}, |
98 "output_type": "execute_result" | 106 "output_type": "execute_result" |
99 } | 107 } |
100 ], | 108 ], |
101 "source": [ | 109 "source": [ |
102 "np.savetxt('../data/D_mahal.csv', D)\n", | |
103 "D = np.loadtxt('../data/D_mahal.csv')\n", | 110 "D = np.loadtxt('../data/D_mahal.csv')\n", |
104 "D.shape" | 111 "D.shape" |
105 ] | 112 ] |
106 }, | 113 }, |
107 { | 114 { |