Python代码

    技术2022-07-11  84

    hello world!!!

    import numpy as np from sklearn import linear_model from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt xx, yy = np.meshgrid(np.linspace(0,10,10), np.linspace(0,100,10)) zz = 1.0 * xx + 3.5 * yy + np.random.randint(0,100,(10,10)) # 构建成特征、值的形式 X, Z = np.column_stack((xx.flatten(),yy.flatten())), zz.flatten() # 建立线性回归模型 regr = linear_model.LinearRegression() # 拟合 regr.fit(X, Z) # 不难得到平面的系数、截距 a, b = regr.coef_, regr.intercept_ # 给出待预测的一个特征 x = np.array([[5.8, 78.3]]) # 方式1:根据线性方程计算待预测的特征x对应的值z(注意:np.sum) print(np.sum(a * x) + b) # 方式2:根据predict方法预测的值z print(regr.predict(x)) # 画图 fig = plt.figure() ax = fig.gca(projection='3d') # 1.画出真实的点 ax.scatter(xx, yy, zz) # 2.画出拟合的平面 ax.plot_wireframe(xx, yy, regr.predict(X).reshape(10,10)) ax.plot_surface(xx, yy, regr.predict(X).reshape(10,10), alpha=0.3) plt.show() 张三 李四 王五 你好!李四, 最近怎么样? 你最近怎么样,王五? 我很好,谢谢! 我很好,谢谢! 李四想了很长时间, 文字太长了 不适合放在一行. 打量着王五... 很好... 王五, 你怎么样? 张三 李四 王五

    参考文档

    链接 长方形 圆 圆角长方形 菱形

    参考文档

    Created with Raphaël 2.2.0 开始 我的操作 确认? 结束 yes no

    参考文档

    Gamma公式展示 Γ ( n ) = ( n − 1 ) ! ∀ n ∈ N \Gamma(n) = (n-1)!\quad\forall n\in\mathbb N Γ(n)=(n1)!nN 是通过 Euler integral

    Γ ( z ) = ∫ 0 ∞ t z − 1 e − t d t   . \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,. Γ(z)=0tz1etdt.

    Mon 06 Mon 13 已完成 进行中 计划中 现有任务 Adding GANTT diagram functionality to mermaid
    Processed: 0.010, SQL: 9