收藏夹

机器学习算法

整体

贝叶斯

SVM

  • Linear SVM 和 LR 有什么异同?
    • LInear SVM和LR都是线性分类器,都是判别模型
  • Linear SVM部直接依赖数据分布,分类平面不受一类点影响;LR则受所有数据点的影响,如果数据不同类别非常不平衡,则需要处理平衡
  • Linear SVM依赖数据表达的距离测度,所以需要先对数据normalization;LR不受影响
  • Linear SVM依赖惩罚的系数,实验中需要验证
  • Linear SVM和LR都会收到outlier的影响,但敏感程度没有明确结论
  • Linear 只输出类别,LR输出概率。

深度学习

强化学习

其它

matplotlib添加中文英文为宋体及Times New Roman

  1. 1
    2
    import matplotlib
    matplotlib.matplotlib_fname() #将会获得matplotlib文件路径
  2. 修改配置文件,取消两行注释,并在第二行添加Times New Roman, SimSun,

    1
    2
    3
    font.family         : sans-serif
    font.sans-serif : Times New Roman, SimSun,...
    axes.unicode_minus : True # 显示负号
  3. SimSun.ttf字体文件放入到./fonts/ttf文件夹下

  4. 通过以下命令找到缓存文件并删除

    1
    2
    import matplotlib
    print(matplotlib.get_configdir())
  1. 重启kernel

    如果需要修改公式字体则修改mathtext.fontset : custom.

    Times New Roman 偏黑,使用宋体SinSun很像没有加粗的TimesNewRoman

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    > import matplotlib.pyplot as plt
    > import numpy as np
    >
    > from matplotlib.font_manager import _rebuild
    > # _rebuild() #如果修改了matplotlibrc而不想手动删除缓存 则用代码reload一下
    >
    > csfont = {'fontname':'SimSun', 'fontsize': 10}
    >
    > x = [0.2,0.3,0.4,0.5,0.6]
    > y = [36,21,15,12,10]
    >
    > plt.figure(dpi=180)
    > plt.plot(x, y, label='$n_e(0)$')
    >
    > plt.xlabel(u'休眠参数'+r'$\theta$', **csfont)
    > plt.ylabel(u'休眠状态下云用户最优接入阈值'+r'$G_{soc}$', **csfont)
    > plt.legend()
    >

    python matplotlib 中文显示参数设置

推荐软件

  • typora:强大的Markdown编辑器
  • Mathpix Snippiong:截图识别Latex公式,效果非常棒
  • 下载工具FDM(Free Download Manager):无广告,支持.torrent文件
  • f.lux 好像和win10兼容性差
  • AxMath: 强大的公式编辑工具,word中比MathType好用且便宜,已入正版
  • Github插件:

Jupyter Lab

在WSL下,给jupyter lab添加插件支持

在WSL Ubuntu下使用sudo apt install nodejs 后,很容易出现 node -vnpm -v找不到命令。尤其是npm会出现/mnt/c/Program Files/nodejs/npm: Syntax error: word unexpected(expecting "in")

参考 WSL install Node

首先安装nodejs

1
2
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs

然后修改~/.profile中的PATH

1
PATH="$HOME/bin:$HOME/.local/bin:/usr/bin:$PATH"

刷新下~/.profile

1
source ~/.profile

这时候再查看npm定位

1
2
$ which npm
/usr/bin/npm

其实目的就是在PATH中添加/usr/bin,并且保证其是首选项

1
2
$ whereis npm
npm: /usr/bin/npm /mnt/c/Program Files/nodejs/npm /mnt/c/Program Files/nodejs/npm.cmd

OK, Done!