如下所示:
創(chuàng)新互聯(lián)服務(wù)項目包括正定網(wǎng)站建設(shè)、正定網(wǎng)站制作、正定網(wǎng)頁制作以及正定網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,正定網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到正定省份的部分城市,未來相信會繼續(xù)擴大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!from numpy import * import numpy as np import matplotlib.pyplot as plt plt.close() fig=plt.figure() plt.grid(True) plt.axis([0,10,0,8]) #列出數(shù)據(jù) point=[[1,2],[2,3],[3,6],[4,7],[6,5],[7,3],[8,2]] plt.xlabel("X") plt.ylabel("Y") #用于求出矩陣中各點的值 XSum = 0.0 X2Sum = 0.0 X3Sum = 0.0 X4Sum = 0.0 ISum = 0.0 YSum = 0.0 XYSum = 0.0 X2YSum = 0.0 #列出各點的位置 for i in range(0,len(point)): xi=point[i][0] yi=point[i][1] plt.scatter(xi,yi,color="red") show_point = "("+ str(xi) +","+ str(yi) + ")" plt.text(xi,yi,show_point) XSum = XSum+xi X2Sum = X2Sum+xi**2 X3Sum = X3Sum + xi**3 X4Sum = X4Sum + xi**4 ISum = ISum+1 YSum = YSum+yi XYSum = XYSum+xi*yi X2YSum = X2YSum + xi**2*yi # 進行矩陣運算 # _mat1 設(shè)為 mat1 的逆矩陣 m1=[[ISum,XSum, X2Sum],[XSum, X2Sum, X3Sum],[X2Sum, X3Sum, X4Sum]] mat1 = np.matrix(m1) m2=[[YSum], [XYSum], [X2YSum]] mat2 = np.matrix(m2) _mat1 =mat1.getI() mat3 = _mat1*mat2 # 用list來提取矩陣數(shù)據(jù) m3=mat3.tolist() a = m3[0][0] b = m3[1][0] c = m3[2][0] # 繪制回歸線 x = np.linspace(0,10) y = a + b*x + c*x**2 plt.plot(x,y) show_line = "y="+str(a)+"+("+str(b)+"x)"+"+("+str(c)+"x2)"; plt.title(show_line) plt.show()