深度学习------神经网络图像识别(tensorflow实现) 本指南将训练一个神经网络模型,对运动鞋和衬衫等服装图像进行分类。即使您不理解所有细节也没关系;这只是对完整 TensorFlow 程序的快速概述,详细内容会在您实际操作的同时进行介绍。本指南使用了 tf.keras,它是 TensorFlow 中用来构建和训练模型的高级 API。
用python计算矩阵特征值和特征向量 import numpy as npA = np.array([[1, -1, 3],[-5, 3, 9],[1, 0, -2]])eigenvalue, featurevector = np.linalg.eig(A)print(eigenvalue)print(featurevector)<<<[-3.27491722 1. 4.27491722][[ 0.43401893 0.6882472 -0.33619158][ 0.83410767 0.6
机器学习决策树 决策树(DTs)是一种用于分类和回归的非参数有监督学习方法。其目标是创建一个模型,通过学习从数据特性中推断出的简单决策规则来预测目标变量的值。决策树的一些优点:1.易于理解和解释。树可以被可视化。2.能够处理多输出问题。3.使用白盒模型。如果给定的情况在模型中是可以观察到的,那么对条件的解释就很容易用布尔逻辑来解释。相反,在黑箱模型中(例如,在人工神经网络中),结果可能很难解释。4.可以使用统计测试验证模型。这样就有可能对模型的可靠性作出解释。5.即使它的假设在某种程度上被生成数据的真实模型所违
使用SQL Server创建一个表 CREATE TABLE website ( id int NOT NULl, name varchar(20) NOT NULL, url varchar(30), age tinyint NOT NULL, alexa int NOT NULL, PRIMARY KEY (id));--创建一个表sp_help website;--查看表的结构
用python matplotlib进行绘图 Errorbar limit selectionIllustration of selectively drawing lower and/or upper limit symbols on errorbars using the parameters , of errorbar.uplimslolimsAlternatively, you can use 2xN values to draw errorbars in only one direction.Similarly and can be u
python scipy.optimize least_squares实现最小二乘法 Least-squares minimization (least_squares)The code below implements least-squares estimation of and finally plots the original data and the fitted model function:X
python scipy.optimize curve_fit拟合非线性函数 # -*- coding: utf-8 -*-"""Created on Wed Dec 1 23:27:21 2021@author: Machi"""import matplotlib.pyplot as pltimport numpy as npfrom scipy.optimize import curve_fitimport seaborn as snssns.set(color_codes=True)np.random.seed(20211201)e = np.r
用python进行时间序列分析 import pandas as pdimport numpy as npimport matplotlib.pyplot as pltimport seaborn as sns from statsmodels.graphics.tsaplots import plot_acf from statsmodels.tsa.stattools import adfuller as ADF from statsmodels.graphics.tsaplots import plot_pa
用python画散点图 # -*- coding: utf-8 -*-"""Created on Tue Nov 16 20:38:41 2021@author: Machi"""import numpy as npimport matplotlib.pyplot as plt# Fixing random state for reproducibility%config InlineBackend.figure_format = 'retina'np.random.seed(19680801)N =
利用python,使用直方图绘制累积分布图 import numpy as npimport matplotlib.pyplot as plt%config InlineBackend.figure_format = 'retina'np.random.seed(190801)mu = 200sigma = 25n_bins = 50x = np.random.normal(mu, sigma, size=100)fig, ax = plt.subplots(figsize=(8, 4))# plot the cumulat
用python进行方差分析(简单版) from scipy.stats import f_onewayimport numpy as npx = np.random.normal(10, 5, 20)y = np.random.normal(10, 5, 20)result = f_oneway(x,y)print(result)F_onewayResult(statistic=0.05215619706951725, pvalue=0.8205774635543236)
利用python的matplotlib库进行简单的绘图 # -*- coding: utf-8 -*-"""Created on Mon Nov 15 21:19:53 2021@author: Machi"""import matplotlib.pyplot as pltimport numpy as np%config InlineBackend.figure_format = 'retina'x = np.linspace(0, 2, 100)# Note that even in the OO-style, we use `.py
用python进行方差分析 # -*- coding: utf-8 -*-"""Created on Sun Nov 14 11:09:44 2021@author: Machi"""import numpy as npimport pandas as pdimport seaborn as snsimport matplotlib.pyplot as pltfrom statsmodels.formula.api import olsfrom statsmodels.stats.anova import an
用r语言进行方差分析 a = rnorm(200)b = rnorm(200)table = data.frame( x = c(a), y = c(b) )aov.manu <- aov(y ~ x, data=table)summary(aov.manu)
用python实现牛顿法,求解非线性方程的解 # -*- coding: utf-8 -*-"""Created on Sat Nov 13 09:29:27 2021@author: Machi"""import sympy as spx = sp.symbols('x')def f(x): return x**3 - xdef df_value(x,x_value): dy = sp.diff(f(x),x) y_value = float(dy.evalf(
r语言拟合MA模型,及时序图,自相关图,偏自相关图 e<-rnorm(100)x1<-filter(e,filter = c(1,-0.5),method = "convolution",circular = T)plot(x1)acf(x1)pacf(x1)
用python求导 # -*- coding: utf-8 -*-"""Created on Mon Nov 8 21:36:35 2021@author: Machi"""import sympy as spx, y, z = sp.symbols('x y z')func = z * sp.sin(2 * sp.pi ** x + x ** y / 5)func_x = sp.diff(func, x)func_y = sp.diff(func, y)func_z = sp.diff(func,
用python求cdf和分位数 # -*- coding: utf-8 -*-"""Created on Fri Nov 5 21:44:19 2021@author: Machi"""from scipy.stats import normq = norm.cdf(0,0,1) print(q)print(norm.ppf(q,0,1)) 0.50.0
正态性检验(偏度和峰度)python # -*- coding: utf-8 -*-"""Created on Mon Nov 1 20:20:05 2021@author: 86158"""import numpy as npfrom scipy.stats import normaltestv = np.random.normal(size=100)print(normaltest(v))结果:NormaltestResult(statistic=0.2786470828038562, pvalue=0.86