示例#1
0
	def summary_stat_of_accuracy_ls(self, acc_ls):
		"""
		11-17-05
			get average, standard deviation from acc_ls
		"""
		accuracy_ls, no_of_predictions_ls, no_of_genes_ls = [], [], []
		for row in acc_ls:
			accuracy_ls.append(row[0])
			no_of_predictions_ls.append(row[2])
			no_of_genes_ls.append(row[3])
		no_of_samples = float(len(acc_ls))
		accuracy_avg = sum(accuracy_ls)/no_of_samples
		accuracy_std = r.sqrt(r.var(accuracy_ls)/no_of_samples)
		no_of_predictions_avg = sum(no_of_predictions_ls)/no_of_samples
		no_of_predictions_std = r.sqrt(r.var(no_of_predictions_ls)/no_of_samples)
		no_of_genes_avg = sum(no_of_genes_ls)/no_of_samples
		no_of_genes_std = r.sqrt(r.var(no_of_genes_ls)/no_of_samples)
		return [accuracy_avg,accuracy_std,no_of_predictions_avg,no_of_predictions_std,no_of_genes_avg,no_of_genes_std]
示例#2
0
	def run(self):
		for df in range(self.df_lower, self.df_upper+1):
			cor_list = []
			for p_value in self.p_value_list:
				t=r.qt(p_value,df,lower_tail=r.FALSE)
				cor = r.sqrt(t*t/(t*t+df))
				cor_list.append(cor)
			self.result_array.append(cor_list)
		#output the table and plot a sample
		self.output()