![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
机器学习实战
马小歪丷
We are the best!
展开
-
TypeError: can't multiply sequence by non-int of type 'numpy.float64'
机器学习实战随机梯度上升TypeError: can't multiply sequence by non-int of type 'numpy.float64'原始代码def stocgradAscent0(dataMatrix, classLabels): m, n = dataMatrix.shape alpha = 0.01 weights = np.on...原创 2019-11-21 15:15:09 · 2391 阅读 · 1 评论 -
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 884: invalid start byte
机器学习实战第四章emailText = open('email/ham/6.txt').read()出现以下错误UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 884: invalid start byteemailText = open('email/ham/6.txt',encoding='...原创 2019-11-20 11:13:29 · 874 阅读 · 3 评论 -
python字典items函数的用法
python字典items函数的用法dict = {'Google': 'www.google.com', 'Runoob': 'www.runoob.com', 'taobao': 'www.taobao.com'} print "字典值 : %s" % dict.items() # 遍历字典列表for key,values in dict.items(): print ...原创 2019-11-06 14:17:26 · 1323 阅读 · 1 评论 -
Python字典-dict.get()的用法
Python字典-dict.get()的用法dict_name.get(key, default = None)# key: 要设置默认值的Key# default: 要返回key的值,可以是任何值,如整形、字符串、列表、字典等# return: 如果字典中key本来有值,那么返回的是字典中Key所对应的值,如果没有,那么返回“default”中的值。例子dict = {'1': 1...原创 2019-11-06 13:49:23 · 10163 阅读 · 0 评论 -
numpy:np.argsort()
numpy.argsort(a, axis=-1, kind=’quicksort’, order=None)parameter:a: 需排序的数组axis:排序的维数kind:排序算法的选择argsort函数是将a中的元素从小到大排列,提取其对应的index(索引),然后输出example:import numpy as npx=np.array([1,3,2,-1,6,9])...原创 2019-08-13 21:24:05 · 113 阅读 · 0 评论 -
机器学习实战
Python3.6 下出现AttributeError: ‘dict’ object has no attribute 'iteritems’错误:解决方案:python3中已经没有iteritems这个模块了将这行代码:`sortedClassCount = sorted(classCount.iteritems(), key=operator.itemgetter(1), revers...原创 2019-08-13 11:27:52 · 98 阅读 · 0 评论 -
机器学习从业者必知的5种回归损失函数
转载:机器学习从业者必知的5种回归损失函数原创 2019-08-30 08:58:47 · 94 阅读 · 0 评论 -
多线程冲突: "RuntimeError: main thread is not in main loop"
https://www.jianshu.com/p/1f7c8f2e802e原创 2019-08-30 10:57:14 · 3764 阅读 · 0 评论