forked from xlu29466/PyGibbCAMP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDREAM8-CellLine-specific.py
30 lines (23 loc) · 987 Bytes
/
DREAM8-CellLine-specific.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 4 11:33:32 2013
@author: xinghualu
"""
import cPickle
from PyGibbCAMP import PyGibbCAMP
import os
import numpy as np
dataDir = 'ProcessedData/cellline.specific.tables/UACC812/'
nodeFile = "ProcessedData/name.matching.csv"
dataMatrix = dataDir + "data.matrix.csv"
perturbMatrix = dataDir + "perturbation.table.csv"
if os.path.exists(dataDir + "missDataMatrix.csv"):
missDataMatrix = dataDir + "missDataMatrix.csv"
else:
missDataMatrix = None
nParents = 2
for alpha in np.arange(1., .4, -0.1, dtype=np.float):
for i in range(5):
pickleFileName = dataMatrix + ".chain" + str(i) + ".nParents" + str(nParents) + ".alpha-" + str(alpha) + ".pickle"
net = PyGibbCAMP(nodeFile = nodeFile, dataMatrixFile = dataMatrix, perturbMatrix = perturbMatrix, missingDataMatrix= missDataMatrix)
net.trainGibbsEM(pickleDumpFile = pickleFileName, nParents = nParents, nChains = 1, alpha=alpha, maxIter = 500)