當前位置: 首頁>>代碼示例>>Python>>正文


Python Fitter.summary方法代碼示例

本文整理匯總了Python中fitter.Fitter.summary方法的典型用法代碼示例。如果您正苦於以下問題:Python Fitter.summary方法的具體用法?Python Fitter.summary怎麽用?Python Fitter.summary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在fitter.Fitter的用法示例。


在下文中一共展示了Fitter.summary方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_gamma

# 需要導入模塊: from fitter import Fitter [as 別名]
# 或者: from fitter.Fitter import summary [as 別名]
def test_gamma():
    from scipy import stats
    data = stats.gamma.rvs(2, loc=1.5, scale=2, size=100000)


    f = Fitter(data, bins=100)
    f.xmin = -10 #should have no effect
    f.xmax = 1000000 # no effet
    f.xmin=0.1
    f.xmax=10
    f.distributions = f.distributions[:3:]
    f.fit()
    f.summary()

    f.plot_pdf(names=['anglit', 'alpha'])
開發者ID:Data-drone,項目名稱:fitter,代碼行數:17,代碼來源:test_fitter.py

示例2: test_fitter

# 需要導入模塊: from fitter import Fitter [as 別名]
# 或者: from fitter.Fitter import summary [as 別名]
def test_fitter():
    f = Fitter([1,1,1,2,2,2,2,2,3,3,3,3], distributions=['gamma'], xmin=0, xmax=4)
    f.fit()
    f.summary()
    assert f.xmin == 0
    assert f.xmax == 4

    # reset the range:
    f.xmin = None
    f.xmax = None
    assert f.xmin == 1
    assert f.xmax == 3
    

    f = Fitter([1,1,1,2,2,2,2,2,3,3,3,3], distributions=['gamma'])
    f.fit()
    f.summary()
    assert f.xmin == 1
    assert f.xmax == 3
開發者ID:Data-drone,項目名稱:fitter,代碼行數:21,代碼來源:test_fitter.py

示例3: test_gamma

# 需要導入模塊: from fitter import Fitter [as 別名]
# 或者: from fitter.Fitter import summary [as 別名]
def test_gamma():
    from scipy import stats
    data = stats.gamma.rvs(2, loc=1.5, scale=2, size=10000)


    f = Fitter(data, bins=100)
    f.xmin = -10 #should have no effect
    f.xmax = 1000000 # no effet
    f.xmin=0.1
    f.xmax=10
    f.distributions = ['gamma', "alpha"]
    f.fit()
    df = f.summary()
    assert len(df)

    f.plot_pdf(names=["gamma"])
    f.plot_pdf(names="gamma")

    res = f.get_best()
    assert "gamma" in res.keys()
開發者ID:cokelaer,項目名稱:fitter,代碼行數:22,代碼來源:test_fitter.py

示例4: print

# 需要導入模塊: from fitter import Fitter [as 別名]
# 或者: from fitter.Fitter import summary [as 別名]
    print(header)
    for h in header[1:]:
        allele_variants[h] = []
    for row in rows[1:]:
        for i in range(1,len(row)):
            allele_variants[header[i]].append(int(float(row[i])))

#print(allele_variants)
output = {}

for av in allele_variants:
    allele_variants[av] = np.array(allele_variants[av])
    print("Now working with %s" % (av))
    f = Fitter(allele_variants[av],bins=max(allele_variants[av])-min(allele_variants[av]))
    #f.distributions = f.distributions[0:10] + ['gamma']
    f.fit()
    #array = f.fitted_pdf[f.get_best().keys()[0]]
    #print(f.get_best())
    #generate_histogram(av, allele_variants[av], array, f._get_xmin(), f._get_xmax(), )
    f.summary(Nbest=1)
    output[av] = f.get_best()
    print(output[av])
    plt.savefig("img/"+av+".png")
    print("Finished!")
    a,b,c = output[av]['tukeylambda']
    broj = tukeylambda.rvs(a,b,c, size=1)
    print('random number %d' % int(broj))
    exit()

print(output)
開發者ID:dinkoosmankovic,項目名稱:INGEB,代碼行數:32,代碼來源:freqs.py


注:本文中的fitter.Fitter.summary方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。