sklearn.model_selection.GridSearchCV()
这个方法来帮助我们进行网格搜索parameters = {'max_depth':[3, 5, 7, 9], 'min_samples_leaf': [1, 2, 3, 4]}
clf = GridSearchCV(DecisionTreeClassifier(), parameters, cv=5, scoring='accuracy …
%%timeit
可以查看当前cell执行的总时间花费import csv
处理快很多def read_csv(file_name):
with open(file_name, 'r') as f:
reader = csv.DictReader(f)
return list(reader)
def read_pd(file_name):
df = pd.read_csv(file_name)
dtype
来标志类型ndarray用argmax来获取当前array的最大值
np.array([1, 2 …
自我鼓励:后面越来越难了,挺住。
求样本方差时,平方偏差和除以样本数量减1,而不是除以样本数量,称为贝塞尔校正。
\(P(B|A) =\frac{P(AB)}{P(A)}\) 可以推导出 \(P(AB) = P(B|A) * P(A)\) 也就是 \(P(AB) = P(A|B) * P(B)\)
\(P(B|A) * P(A) = P(A|B) * P(B)\) 等式两边同时除以 P(A),就是贝叶斯公式 …
以下几个课程将会按照顺序学习:
array.count
为python中统计某一个数字出现个数的方法>>>"{} {}".format("hello", "world") # 不设置指定位置,按默认顺序
'hello world'
>>> "{0} {1}".format("hello", "world") # 设置指定位置
'hello world'
>>> "{1} {0} {1}".format …