コード例 #1
0
ファイル: old__main__.py プロジェクト: Nerolex/garrulous-woof
def appendTimeStatistics(raw_output, _CLASSIFIER, clf, timeFit, x_test, y_test):
    _timeFitLin = clf.time_fit_lin  # SS_MSMS
    _timeFitGauss = clf.time_fit_gauss  # MM:SS
    _timeFitOver = clf.time_overhead  # MSMS
    _timeTotal = _timeFitLin + _timeFitGauss + _timeFitOver

    _score = clf.score(x_test, y_test)
    _error = round((1 - _score) * 100, 2)

    _timePredict = clf.time_predict  ## SS_MSMS

    _percentGaussTotal = round((_timeFitGauss / _timeTotal) * 100, 2)
    _percentLinTotal = round((_timeFitLin / _timeTotal * 100), 2)
    _percentOverTotal = round((_timeFitOver / _timeTotal * 100), 2)

    # Bring Time data in readable format
    _timeFit = Conversions.secondsToHourMin(_timeTotal)
    _timeFitLin = Conversions.secondsToSecMilsec(_timeFitLin)
    _timeFitGauss = Conversions.secondsToMinSec(_timeFitGauss)
    _timeFitOver = Conversions.secondsToMilsec(_timeFitOver)
    _timePredict = Conversions.secondsToSecMilsec(_timePredict)

    raw_output[7].append(str(_timeTotal).replace(".", ",") + "s;")
    # raw_output[8].append(_timeFitGauss + "\t(" + str(_percentGaussTotal) + "%)" + ";")
    raw_output[8].append(_timeFitGauss + ";")
    # raw_output[9].append(_timeFitLin + "\t(" + str(_percentLinTotal) + "%)" + ";")
    raw_output[9].append(_timeFitLin + ";")
    # raw_output[10].append(_timeFitOver + "\t(" + str(_percentOverTotal) + "%)" + ";")
    raw_output[10].append(_timeFitOver + ";")
    raw_output[11].append(_timePredict + ";")
    raw_output[12].append(str(_error) + "%;")

    return raw_output