def over_sampling(self): N=int(self.N/100) self.synthetic = np.zeros((self.n_samples * N, self.n_attrs)) neighbors=NearestNeighbors(n_neighbors=self.k).fit(self.samples) print ('neighbors',neighbors) for i in range(len(self.samples)): print('samples',self.samples[i]) nnarray=neighbors.kneighbors(self.samples[i].reshape((1,-1)),return_distance=False)[0] #Finds the K-neighbors of a point. print ('nna',nnarray) self._populate(N,i,nnarray) return self.synthetic返回值是什么
时间: 2023-12-06 08:43:28 浏览: 150
LHS.zip_ARGUMENT!_LHS matlab_LHS采样_dist.m_拉丁 抽样
该函数的返回值是生成的合成样本数组 `self.synthetic`。其中,`self.synthetic` 的维度为 `(self.n_samples * N, self.n_attrs)`,即生成了 `self.n_samples * N` 个样本,每个样本有 `self.n_attrs` 个属性。
阅读全文