本文整理汇总了Python中SampleData.dataframe_from_weights方法的典型用法代码示例。如果您正苦于以下问题:Python SampleData.dataframe_from_weights方法的具体用法?Python SampleData.dataframe_from_weights怎么用?Python SampleData.dataframe_from_weights使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SampleData
的用法示例。
在下文中一共展示了SampleData.dataframe_from_weights方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_load_model
# 需要导入模块: import SampleData [as 别名]
# 或者: from SampleData import dataframe_from_weights [as 别名]
def test_load_model(self):
snp_model = PredictionModel.load_model("tests/_td/dbs/test_1.db")
e_e = SampleData.dataframe_from_extra(SampleData.sample_extra_2())
numpy.testing.assert_array_equal(snp_model.extra[PredictionModel.WDBEQF.K_GENE], e_e[PredictionModel.WDBEQF.K_GENE])
numpy.testing.assert_array_equal(snp_model.extra[PredictionModel.WDBEQF.K_GENE_NAME], e_e[PredictionModel.WDBEQF.K_GENE_NAME])
numpy.testing.assert_array_equal(snp_model.extra[PredictionModel.WDBEQF.K_N_SNP_IN_MODEL], e_e[PredictionModel.WDBEQF.K_N_SNP_IN_MODEL])
numpy.testing.assert_array_equal(snp_model.extra[PredictionModel.WDBEQF.K_PRED_PERF_R2], e_e[PredictionModel.WDBEQF.K_PRED_PERF_R2])
numpy.testing.assert_array_equal(snp_model.extra[PredictionModel.WDBEQF.K_PRED_PERF_PVAL], e_e[PredictionModel.WDBEQF.K_PRED_PERF_PVAL])
numpy.testing.assert_array_equal(snp_model.extra[PredictionModel.WDBEQF.K_PRED_PERF_QVAL], e_e[PredictionModel.WDBEQF.K_PRED_PERF_QVAL])
e_w = SampleData.dataframe_from_weights(SampleData.sample_weights_2())
numpy.testing.assert_array_equal(snp_model.weights[PredictionModel.WDBQF.K_RSID], e_w[PredictionModel.WDBQF.K_RSID])
numpy.testing.assert_array_equal(snp_model.weights[PredictionModel.WDBQF.K_GENE], e_w[PredictionModel.WDBQF.K_GENE])
numpy.testing.assert_array_equal(snp_model.weights[PredictionModel.WDBQF.K_WEIGHT], e_w[PredictionModel.WDBQF.K_WEIGHT])
numpy.testing.assert_array_equal(snp_model.weights[PredictionModel.WDBQF.K_NON_EFFECT_ALLELE], e_w[PredictionModel.WDBQF.K_NON_EFFECT_ALLELE])
numpy.testing.assert_array_equal(snp_model.weights[PredictionModel.WDBQF.K_EFFECT_ALLELE], e_w[PredictionModel.WDBQF.K_EFFECT_ALLELE])
示例2: _prediction_model
# 需要导入模块: import SampleData [as 别名]
# 或者: from SampleData import dataframe_from_weights [as 别名]
def _prediction_model():
e = SampleData.dataframe_from_extra(SampleData.sample_extra_1())
w = SampleData.dataframe_from_weights(SampleData.sample_weights_1())
p = PredictionModel.Model(w,e)
return p