Пример #1
0
def parseLines(feats, group):
    lines = []
    collectedFeats = model.collectPerfFeats(feats)

    # names = "group\t" + "\t".join(collectedFeats.keys())
    # lines.append(names)

    valueLines = zip(*collectedFeats.values())  # [(feat1, feat2), (feat1, feat2)]
    for line in valueLines:
        lineStr = map(str, list(line))
        # lines.append('\t'.join(lineStr) + "\n")
        lines.append(group + "\t" + "\t".join(lineStr))

    return lines
Пример #2
0
def parseLines(feats, group):
    lines = []
    collectedFeats = model.collectPerfFeats(feats)

    #names = "group\t" + "\t".join(collectedFeats.keys())
    #lines.append(names)

    valueLines = zip(
        *collectedFeats.values())  #[(feat1, feat2), (feat1, feat2)]
    for line in valueLines:
        lineStr = map(str, list(line))
        #lines.append('\t'.join(lineStr) + "\n")
        lines.append(group + '\t' + '\t'.join(lineStr))

    return lines
Пример #3
0
def parseColNames(feats):
    collectedFeats = model.collectPerfFeats(feats)

    return ["group\t" + "\t".join(collectedFeats.keys())
            ]  # each line is a vector
Пример #4
0
import model
import config 
import featureManager 

trainFeats = featureManager.loadJson(config.defaultTrainFeatsFilename)
print(model.collectScoreFeats(trainFeats))
print(model.collectPerfFeats(trainFeats))

model = model.trainMultiLinearRegress(trainFeats, config.defaultModelFilename)
print(model)

def dummyFunc():
   print("this is a function for type(dummyFunc) comparison")

#for mode in ['train', 'gen']:
#   print(model.getModelFunc(mode))
#   assert type(model.getModelFunc(mode)) == type(dummyFunc), 'getModelFunc() returned a non-function object'
#
Пример #5
0
import model
import config
import featureManager

trainFeats = featureManager.loadJson(config.defaultTrainFeatsFilename)
print(model.collectScoreFeats(trainFeats))
print(model.collectPerfFeats(trainFeats))

model = model.trainMultiLinearRegress(trainFeats, config.defaultModelFilename)
print(model)


def dummyFunc():
    print("this is a function for type(dummyFunc) comparison")


#for mode in ['train', 'gen']:
#   print(model.getModelFunc(mode))
#   assert type(model.getModelFunc(mode)) == type(dummyFunc), 'getModelFunc() returned a non-function object'
#
Пример #6
0
def parseColNames(feats):
    collectedFeats = model.collectPerfFeats(feats)

    return ["group\t" + "\t".join(collectedFeats.keys())]  # each line is a vector