AI流程和常见的机器学习算法

AI流程和常见的机器学习算法

AI操作流程
1 通常的机器学习算法流程如下:
选择模型函数mx_fun,mx_fun是我们自定义的机器学习函数借口把训练的特征集x_train和对于的特征结果数据集y_train输入到模型函数mx_fun中。系统内置的机器学习函数,会自动分析特征数据与结果数据之间的关系,这样的一个过程就是机器学习的过程,也是算法建模的过程。通过对训练数据的机器学习和数据分析,系统会生成一个AI机器学习模型,我们将其保持到mx中把测试数据x_test输入到模型变量mx中,mx会调用内置的分析函数predict,生成的最终分析结果y_pred。如果是实盘,输入最新的数据,,系统会自动生成相关的预测数据,在运行实盘之前,我们会对y_pred和正确的y_test进行对比,以判断模型的准确度,并通过一些优化措施和结果调整参数进行迭代算法或者其他模型提高最终结果的准确度。
2 流程图
PHN2ZyBpZD0iZHlkbDRncmhkZTQiIHdpZHRoPSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJtYXgtd2lkdGg6IDIyNy4zMTI1cHg7IiB2aWV3Qm94PSIwIDAgMjI3LjMxMjUgNDgzLjY4NzUiPjxzdHlsZT4KCgojZHlkbDRncmhkZTQgLmxhYmVsIHsKICBmb250LWZhbWlseTogJ3RyZWJ1Y2hldCBtcycsIHZlcmRhbmEsIGFyaWFsOwogIGNvbG9yOiAjMzMzOyB9CgojZHlkbDRncmhkZTQgLm5vZGUgcmVjdCwKI2R5ZGw0Z3JoZGU0IC5ub2RlIGNpcmNsZSwKI2R5ZGw0Z3JoZGU0IC5ub2RlIGVsbGlwc2UsCiNkeWRsNGdyaGRlNCAubm9kZSBwb2x5Z29uIHsKICBmaWxsOiAjRUNFQ0ZGOwogIHN0cm9rZTogIzkzNzBEQjsKICBzdHJva2Utd2lkdGg6IDFweDsgfQoKI2R5ZGw0Z3JoZGU0IC5ub2RlLmNsaWNrYWJsZSB7CiAgY3Vyc29yOiBwb2ludGVyOyB9CgojZHlkbDRncmhkZTQgLmFycm93aGVhZFBhdGggewogIGZpbGw6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yYW5zZm9ybT0idHJhbnNsYXRlKDAsMCkiPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC02MS44MTI1LC04LjE0MDYyNSkiPjx0ZXh0Pjx0c3BhbiB4bWw6c3BhY2U9InByZXNlcnZlIiBkeT0iMWVtIiB4PSIxIj7nlJ/miJDliIbmnpDnu5Pmnpx5X3ByZWQ8L3RzcGFuPjwvdGV4dD48L2c+PC9nPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=
3 sklearn中经典的机器学习算法
算法sklern函数说明线性回归LinearRegression朴素贝叶斯MultinomialnbKNN k近邻KNeighborsClassifier逻辑回归LogisticRegression随机森林RandomForestClassifier决策树tree.DecisionTreeClassifierGBDT迭代决策树GradientBoostingClassifierSVM向量支持机SVCSVM-Croess向量机交叉算法SVC
4 数据分割函数
对于小型的数据而言,Sklearn内置的train_test_split函数可以对数据进行分割,这属于数据预处理阶段。

Numpy学习笔记

1 numpy
import numpy as np
array = np.array([[1,2,3],[2,3,4]]) #列表转化为矩阵
print(array)
“””
array([[1, 2, 3],
[2, 3, 4]])
“””
print(‘number of dim:’,array.ndim) # 维度
# number of dim: 2
print(‘shape :’,array.shape) # 行数和列数
# shape : (2, 3)
print(‘size:’,array.size) # 元素个数
# size: 6

1.1 Numpy 的创建 array
array:创建数组dtype:指定数据类型zeros:创建数据全为0ones:创建数据全为1empty:创建数据接近0arrange:按指定范围创建数据linspace:创建线段#创建数组
a = np.array([2,23,4]) # list 1d
print(a)
# [2 23 4]
#指定数据 dtype
a = np.array([2,23,4],dtype=np.int)
print(a.dtype)
# int 64
a = np.array([2,23,4],dtype=np.int32)
print(a.dtype)
# int32
a = np.array([2,23,4],dtype=np.float)
print(a.dtype)
# float64
a = np.array([2,23,4],dtype=np.float32)
print(a.dtype)
# float32
#创建特定数据
a = np.array([[2,23,4],[2,32,4]]) # 2d 矩阵 2行3列
print(a)
“””
[[ 2 23 4]
[ 2 32 4]]
“””
#创建全零数组

a = np.zeros((3,4)) # 数据全为0,3行4列
“””
array([[ 0., 0., 0., 0.],
[ 0., 0., 0., 0.],
[ 0., 0., 0., 0.]])
“””
#创建全一数组, 同时也能指定这些特定数据的 dtype:

a = np.ones((3,4),dtype = np.int) # 数据为1,3行4列
“””
array([[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1]])
“””
#创建全空数组, 其实每个值都是接近于零的数:

a = np.empty((3,4)) # 数据为empty,3行4列
“””
array([[ 0.00000000e+000, 4.94065646e-324, 9.88131292e-324,
1.48219694e-323],
[ 1.97626258e-323, 2.47032823e-323, 2.96439388e-323,
3.45845952e-323],
[ 3.95252517e-323, 4.44659081e-323, 4.94065646e-323,
5.43472210e-323]])
“””
#用 arange 创建连续数组:

a = np.arange(10,20,2) # 10-19 的数据,2步长
“””
array([10, 12, 14, 16, 18])
“””
#使用 reshape 改变数据的形状

a = np.arange(12).reshape((3,4)) # 3行4列,0到11
“””
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]])
“””
#用 linspace 创建线段型数据:

a = np.linspace(1,10,20) # 开始端1,结束端10,且分割成20个数据,生成线段
“””
array([ 1. , 1.47368421, 1.94736842, 2.42105263,
2.89473684, 3.36842105, 3.84210526, 4.31578947,
4.78947368, 5.26315789, 5.73684211, 6.21052632,
6.68421053, 7.15789474, 7.63157895, 8.10526316,
8.57894737, 9.05263158, 9.52631579, 10. ])
“””
#同样也能进行 reshape 工作:

a = np.linspace(1,10,20).reshape((5,4)) # 更改shape
“””
array([[ 1. , 1.47368421, 1.94736842, 2.42105263],
[ 2.89473684, 3.36842105, 3.84210526, 4.31578947],
[ 4.78947368, 5.26315789, 5.73684211, 6.21052632],
[ 6.68421053, 7.15789474, 7.63157895, 8.10526316],
[ 8.57894737, 9.05263158, 9.52631579, 10. ]])
“””

1.2 Numpy 基础运算1

个人面试总结

朴素贝叶斯为什么被称为“朴素”?
朴素贝叶斯中的“朴素”二字突出了这个算法的简易性。朴素贝叶斯的简易性表现该算法基于一个很朴素的假设:所有的变量都是相互独立的,假设各特征之间相互独立,各特征属性是条件独立的。请详细介绍一下朴素贝叶斯分类器(2)。什么是深度学习?深度学习和机器学习的区别是什么?解释下python中的可变对象和不可变对象。你在python中使用过什么数据结构?(2)解释一下支持向量机(SVM)如何学习非线性边界。什么是精确率(precision)和召回率(recall)?在医疗诊断中,你认为哪个更重要?解释一下精确率和召回率。如何绘制受试者工作特征曲线 (ROC曲线)?ROC曲线下面积是什么意思?如何为多类别分类任务绘制ROC曲线?列举多类别分类任务其他的度量标准。什么是灵敏度(sensitivity)和特异度(specificity)?随机森林中的“随机”指什么?如何进行文本分类?(文本分类的方法有哪些?你会怎么做分类?2)当神经网络由线性节点构成时,神经网络如何学习非线性形状?它学习非线性边界的原因是什么?训练决策树时,其参数是什么?在决策树的某个节点处进行分割,其分割标准是什么?基尼系数的计算公式是什么?熵的计算公式是什么?决策树如何决定在哪个特征处必须进行分割?如何利用数学计算收集来的信息?简述随机森林的优点。简述boosting算法。梯度提升算法(gradient boosting)是怎样工作的?简述AdaBoost算法工作原理。SVM中用到了哪些内核?SVM的优化技术有哪些?SVM如何学习超平面?论述下其数学运算细节。谈一谈无监督学习?都有哪些算法?如何定义K-Means聚类算法中K的值?列举至少3中定义K-Means聚类算法中K的方法。除此之外你还知道哪些聚类算法?简述下分层凝聚聚类(Hierarchical Agglomerativeclustering)的工作原理。解释一下主成分分析算法(PCA),简述下使用PCA算法的数学步骤。使用 PCA算法有哪些缺点?谈谈卷积神经网络的工作原理?详细说明其实现细节。解释一下卷积神经网络中的反向传播。你如何部署机器学习模型?我们大部分情况下都要用C++从零开始搭建一个机器学习模型,这一点你能做到吗?Sigmoid 函数的范围是什么?说出scikit-learn能够实现逻辑回归的包的名称。标准正态分布的均值和方差分别是多少?如何设计一个神经网络?如何做到“深度”?这是一个基础的神经网络问题。如何获取Python列表中元素的索引?如果合并两个pandas数据集?决策树和随机森林,你更喜欢哪一个?逻辑回归和随机森林有什么区别?你会用决策树还是随机森林来解决分类问题?随机森林有什么优点?来自 https://blog.csdn.net/lingpy/article/details/80466783