def test_estimators_news_3cl(self): graphs, Gs, info = Datasets().news_3cl_1 (A, gt), G = graphs[0], Gs[0] K = logComm_K(A).get_K(0.5) for estimator in tqdm(self.estimators): km = estimator(n_clusters=3) km.predict(K, G=G)
def test_compare_CT_and_Resistance(self): graphs, Gs, info = Datasets().news_2cl_1 A, y_true = graphs[0] D_CT = CT_D(A).get_D(-1) D_R = H_to_D(CT_H(A).get_K(-1)) D_CT /= np.average(D_CT) D_R /= np.average(D_R) self.assertTrue(np.allclose(D_CT, D_R))
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.etalon = { 'news_2cl_1': (.845, .807, .831, .652, .816), 'news_2cl_2': (.587, .587, .588, .512, .568), 'news_2cl_3': (.810, .811, .750, .859, .796), 'news_3cl_1': (.766, .762, .754, .742, .773), 'news_3cl_2': (.770, .783, .755, .626, .730), 'news_3cl_3': (.765, .770, .744, .715, .759), 'news_5cl_1': (.696, .690, .604, .681, .668), 'news_5cl_2': (.640, .646, .587, .596, .604), 'news_5cl_3': (.612, .616, .573, .478, .573), } self.datasets = Datasets()
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.datasets = Datasets() self.estimators = [ # KKMeans, KKMeans, KKMeans_iterative, # KKMeans_kernlab, KWard, SpectralClustering_rubanov, # SpectralClustering_sklearn, # SpectralClustering_kernlab, KMeans_sklearn, Ward_sklearn, ]
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) util.configure_logging() self.etalon = { # CCT, FE, logFor, RSP, SCT, SP 'football': (.7928, .9061, .9028, .9092, .8115, .8575), 'karate': (1., 1., 1., 1., 1., 1.), 'polblogs': (.5525, .5813, .5811, .5815, .5757, .5605), 'news_2cl_1': (.7944, .8050, .8381, .7966, .8174, .6540), 'news_2cl_2': (.5819, .5909, .5844, .5797, .5523, .5159), 'news_2cl_3': (.7577, .8107, .7482, .7962, .7857, .8592), 'news_3cl_1': (.7785, .7810, .7530, .7810, .7730, .7426), 'news_3cl_2': (.7616, .7968, .7585, .7761, .7282, .6246), 'news_3cl_3': (.7455, .7707, .7487, .7300, .7627, .7203), 'news_5cl_1': (.6701, .6922, .6143, .7078, .6658, .6815), 'news_5cl_2': (.6177, .6401, .5977, .6243, .6154, .5970), 'news_5cl_3': (.6269, .6065, .5729, .5750, .5712, .4801) } self.datasets = Datasets()
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) util.configure_logging() self.etalon = { # SCT CCT FE RSP SP Com For Heat Walk lCom lFor lHeat lWalk LVN 'football': (0.908, 0.889, 0.884, 0.884, 0.812, 0.545, 0.293, 0.492, 0.749, 0.598, 0.424, 0.583, 0.249, 0.698), 'lfr1': (0.976, 0.990, 0.981, 0.983, 0.890, 0.052, 0.027, 0.051, 0.003, 0.475, 0.500, 0.511, 0.485, 0.962), 'lfr2': (1.000, 1.000, 1.000, 1.000, 0.986, 0.147, 0.164, 0.266, 0.694, 0.481, 0.478, 0.449, 0.682, 0.823), 'lfr3': (1.000, 0.997, 1.000, 1.000, 0.989, 0.087, 0.130, 0.159, 0.502, 0.520, 0.379, 0.376, 0.729, 0.827), 'news_2cl_1': (0.608, 0.638, 0.584, 0.581, 0.434, 0.018, 0.032, 0.032, 0.249, 0.291, 0.243, 0.253, 0.462, 0.573), 'news_2cl_2': (0.356, 0.396, 0.359, 0.346, 0.296, 0.008, 0.027, 0.100, 0.394, 0.584, 0.123, 0.207, 0.233, 0.432), 'news_2cl_3': (0.579, 0.584, 0.590, 0.598, 0.616, 0.333, 0.053, 0.117, 0.357, 0.682, 0.553, 0.611, 0.496, 0.586), 'news_3cl_1': (0.697, 0.706, 0.702, 0.696, 0.660, 0.096, 0.032, 0.125, 0.245, 0.489, 0.471, 0.478, 0.748, 0.699), 'news_3cl_2': (0.656, 0.689, 0.711, 0.706, 0.572, 0.068, 0.035, 0.040, 0.294, 0.345, 0.343, 0.281, 0.572, 0.661), 'news_3cl_3': (0.642, 0.605, 0.681, 0.678, 0.720, 0.067, 0.031, 0.033, 0.380, 0.295, 0.255, 0.248, 0.423, 0.673), 'news_5cl_1': (0.641, 0.643, 0.648, 0.651, 0.614, 0.087, 0.019, 0.032, 0.284, 0.259, 0.273, 0.291, 0.504, 0.684), 'news_5cl_2': (0.616, 0.630, 0.643, 0.633, 0.596, 0.185, 0.026, 0.024, 0.291, 0.345, 0.214, 0.234, 0.374, 0.634), 'news_5cl_3': (0.573, 0.624, 0.615, 0.571, 0.480, 0.034, 0.021, 0.021, 0.369, 0.300, 0.337, 0.281, 0.383, 0.572), 'polblogs': (0.556, 0.556, 0.567, 0.568, 0.549, 0.423, 0.322, 0.641, 0.298, 0.511, 0.550, 0.527, 0.577, 0.597), 'karate': (0.832, 0.724, 0.838, 0.832, 1.000, 0.262, 0.395, 1.000, 0.875, 1.000, 0.866, 1.000, 0.697, 0.982) } self.datasets = Datasets()
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.datasets = Datasets()
def perform(): for dataset_name in dataset_names: graphs, info = Datasets()[dataset_name] perform_column(dataset_name, graphs, info['k'])
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) util.configure_logging() graph, _, info = Datasets().karate self.graph, self.y_true = graph[0]