根据个人经验总结的深度学习入门路线(简单快速)
https://blog.csdn.net/weixin_44414948/article/details/109704871
深度学习入门一阶段demo练习:
https://blog.csdn.net/weixin_44414948/article/details/109864551
demo任务:
利用线性回归算法,在波士顿房价数据集上实现预测任务,要求不调用现成的线性回归库函数,利用numpy编写线性回归算法,并通过梯度下降的方式迭代更新线性回归的参数(不直接使用正规方程求解),准确率达到85%以上。
波士顿房价数据集部分数据如下图所示:
示例代码(不调用现成的线性回归函数库):
import numpy as np
import math
def load_boston_dataset(path = r'./housing.data'):
'''
:param: path
:return: training_data,test_data
'''
data = np.fromfile(path,sep=' ',count=-1)
# print(data.shape)
feature_name = ['CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', 'RM', 'AGE',
'DIS', 'RAD', 'TAX', 'PTRATIO', 'B', 'LSTAT', 'MEDV']
data = data.reshape(math.ceil(data.shape[0]/len(feature_name)),len(feature_name))
# print(data.shape)
# Training set---> 80% and test set--->20%
ratio = 0.8
training_data = data[:int(ratio*data.shape[0])]
test_data = data[int(ratio*data.shape[0]):]
# print(traning_data)
# Min-max normalization
maximums = training_data.max(axis=0)