コード例 #1
0
ファイル: findpara.py プロジェクト: pmhgms/dataScript
def oneee(filename,filenamet,fealist,numfu0,numfue):
    pre=[]
    for i in range(numfu0,numfue):
        X,y=loadd.onest(filename,i,fealist,6)
        Xt,yt=loadd.onest(filenamet,i,fealist,6)
        theta,J_his=logi.grandient(X,y,0.5,1000)
        try:
            pren,rig=logi.predict(X,y,theta)
            pre.append(pren)
        except ZeroDivisionError:
            break
    print pre.index(max(pre)),max(pre)
    return pre
コード例 #2
0
ファイル: shreshold.py プロジェクト: pmhgms/dataScript
def howrare(theta,speCol=None,speStar=0):
    X=[] 
    ma=0   
    for onefile in files:
        x,y=loadd.onest(onefile,2,[8],6,speCol,speStar)
        X.append(x)
        ma+=len(y)
    b=[]
    for thre in a:
        p1a1=0
        for x in X:
            m=len(x)
            for i in range(m):
                if x[i]*theta>thre:
                    p1a1+=1
        b.append(p1a1/float(ma))
    plot(a[:len(b)],b)
    return b
コード例 #3
0
ファイル: shreshold.py プロジェクト: pmhgms/dataScript
def curforrig(theta,fealist,cond):
    for onefile in files:
        x,y=loadd.onest(onefile,2,fealist,6)
        if len(y)>cond:
            b=rigmax(x,y,theta)
            plot(a[:len(b)],b)