机器学习
机器学习
长沙有肥鱼
这个作者很懒,什么都没留下…
展开
-
ModuleNotFoundError: No module named requests
当出现了这个报错的时候,说明没有安装相应的库:ModuleNotFoundError: No module named requests安装方法是在Anaconda或者miniconda的环境里安装requests pip install requests -i https://pypi.douban.com/simple/原创 2022-03-11 08:56:14 · 1238 阅读 · 0 评论 -
ModuleNotFoundError: No module named ‘sklearn‘
---------------------------------------------------------------------------ModuleNotFoundError Traceback (most recent call last)~\AppData\Local\Temp/ipykernel_14052/3342078676.py in <module>----> 1 from sklearn import pr..原创 2022-03-10 22:53:06 · 2300 阅读 · 0 评论 -
机器学习——逻辑回归
概念逻辑回归属于分类算法。线性逻辑回归logistic_regression.pyimport numpy as npfrom scipy.optimize import minimizefrom utils.features import prepare_for_trainingfrom utils.hypothesis import sigmoidclass LogisticRegression: def __init__(s...原创 2022-02-27 11:11:55 · 4028 阅读 · 14 评论 -
python——linspace函数
def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0): """ Return evenly spaced numbers over a specified interval. Returns `num` evenly spaced samples, calculated over the interval [`start`, `st..原创 2022-02-27 10:30:55 · 6384 阅读 · 0 评论 -
python——empty函数
def empty(shape, dtype=None, order='C', *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ """ empty(shape, dtype=float, order='C', *, like=None) Return a new array of given shape and type, without in..原创 2022-02-27 09:02:39 · 4043 阅读 · 0 评论 -
python——argmax函数
def argmax(a, axis=None, out=None, *, keepdims=np._NoValue): """ Returns the indices of the maximum values along an axis. Parameters ---------- a : array_like Input array. axis : int, optional By default, the inde..原创 2022-02-27 08:49:57 · 4228 阅读 · 0 评论 -
机器学习——线性回归实践
主要内容:线性回归方程实现 梯度下降效果 对比不同梯度下降策略 建模曲线分析 过拟合与欠拟合 正则化的作用 提前停止策略1.实验目标分析import numpy as npimport os%matplotlib inlineimport matplotlibimport matplotlib.pyplot as pltplt.rcParams['axes.labelsize'] = 14plt.rcParams['xtick.labelsize'] = 12..原创 2022-02-24 17:21:24 · 2108 阅读 · 0 评论 -
python——线性回归实例实战
MultivariateLinearRegression.pyimport numpy as npimport pandas as pdimport matplotlib.pyplot as pltimport plotlyimport plotly.graph_objs as go# https://plotly.com/python/line-and-scatter/# https://plotly.com/python/# plotly.offline.init_not...原创 2022-02-22 15:56:45 · 3136 阅读 · 6 评论 -
python——array_split函数
@array_function_dispatch(_array_split_dispatcher)def array_split(ary, indices_or_sections, axis=0): """ Split an array into multiple sub-arrays. Please refer to the ``split`` documentation. The only difference between these functions is.原创 2022-02-22 14:55:08 · 3407 阅读 · 0 评论 -
python——drop函数
函数定义:def drop( self, labels=None, axis: Axis = 0, index=None, columns=None, level: Level | None = None, inplace: bool = False, errors: str = "raise", ):注解: """ Drop spec.原创 2022-02-21 15:03:24 · 7367 阅读 · 0 评论 -
机器学习——线性回归
线性回归 梯度下降目标函数: 线性回归 寻找山谷的最低点,也就是我们的目标函数终点 (什么样的参数能使得目标函数达到极值点) 下山分几步走呢?(更新参数)(1):找到当前最合适的方向(2):走那么一小步,走快了该”跌倒 ”了这里相当于要对梯度进行小范围的计算,如果计算的大范围容易不收敛。...原创 2022-02-19 22:48:48 · 291 阅读 · 0 评论