Beispiel #1
0
def failingPeaks(path):
    from DataLoader import getData

    data = getData(path, None, True)

    samples = tls.getDictArray(data.Features)

    people = dict()
    peaks = dict()

    i = 0
    for sample in samples:
        for f in sample.keys():
            countedPeaks = []
            if sample[f] is None:
                peak = f.split('.')[1]
                countedPeaks += peak
                if `i` in people:
                    people[`i`] += 1
                else:
                    people[`i`] = 1

                if f in peaks:
                    peaks[peak] += 1
                else:
                    peaks[peak] = 1
        i += 1
Beispiel #2
0
def classifyData(data, classifyTrained, classifySurface,
            classifierClass, featuresSelect,scaling=False):
    features = tls.getDictArray(data.Features)
    [samples, featureNames,imputer,scaler] = extractData(features,scaling=scaling)
    [classifications, classNames] = selectClassifications(data,
                                    classifyTrained, classifySurface)

    if (not 'all' in featuresSelect):
        [samples, featureNames] = selectFeatures(samples,
                    classifications, featureNames,
                    classifierClass, featuresSelect)
    else:
        print('Using all features')
    classifier = classifierClass(samples, featureNames,
                                 classifications, classNames)
    classifier.setTransformOperators(imputer,scaler)

    return classifier