背景故事
我使用的Hexo在GitHub Pages搭建的blog中,使用主题为Yilia,其自带的是Mathjax,页面无法正常渲染出数学公式
解决方法
首先下载pandoc
1 | brew install Pandoc |
接着安装 hexo-renderer-pandoc
1 | npm uninstall hexo-renderer-marked --save |
安装完成后,重新生成文件
1 | hexo generate |
此时公式显示正常
more >>Keep curious to the world, and do cool things that matter.
我使用的Hexo在GitHub Pages搭建的blog中,使用主题为Yilia,其自带的是Mathjax,页面无法正常渲染出数学公式
首先下载pandoc
1 | brew install Pandoc |
接着安装 hexo-renderer-pandoc
1 | npm uninstall hexo-renderer-marked --save |
安装完成后,重新生成文件
1 | hexo generate |
此时公式显示正常
more >>学习器的实际预测输出与样本的真实输出之间的差异
可能将训练样本自身的一些特点当做了所有潜在样本都会具有的一般性质,导致泛化性能下降
无法避免,只能缓解,或者减小其风险
指对训练样本的一般性质尚未学好
由Datawhale组织的「一周算法实践」活动,通过短期实践一个比较完整的数据挖掘项目,迅速了解相关实际过程
GitHub - Datawhale Datamining Practice - awyd234
【任务3 - 模型调优】使用网格搜索法对7个模型进行调优(调参时采用五折交叉验证的方式),并进行模型评估,记得展示代码的运行结果~
此处需要用到sklearn中的GridSearchCV
1 | from sklearn.model_selection import GridSearchCV |
修改fit_and_evaluate_model函数,将model修改为带入参数的GridSearchCV
more >>由Datawhale组织的「一周算法实践」活动,通过短期实践一个比较完整的数据挖掘项目,迅速了解相关实际过程
GitHub - Datawhale Datamining Practice - awyd234
【任务2 - 模型评估】记录7个模型(在Task1的基础上)关于accuracy、precision,recall和F1-score、auc值的评分表格,并画出Roc曲线。
对二分类问题常用的评估指标是精度(precision)、召回率(recall)、F1值(F1-score),通常以关注的类为正类,其他类为负类
画ROC曲线需要用到matplotlib
more >>link: https://leetcode.com/problems/course-schedule/
There are a total of n courses you have to take, labeled
from 0
to n-1
.
Some courses may have prerequisites, for example to take course 0 you
have to first take course 1, which is expressed as a pair:
[0,1]
Given the total number of courses and a list of prerequisite pairs, is it possible for you to finish all courses?
Example 1:
1 | Input: 2, [[1,0]] |
Example 2:
1 | Input: 2, [[1,0],[0,1]] |
由Datawhale组织的「一周算法实践」活动,通过短期实践一个比较完整的数据挖掘项目,迅速了解相关实际过程
GitHub - Datawhale Datamining Practice - awyd234
【任务1.2 - 模型构建】构建随机森林、GBDT、XGBoost和LightGBM这4个模型,评分方式任意。
1 | from sklearn.ensemble import RandomForestClassifier |
Output
1 | RandomForest fit finished, score: 0.7694463910301331 |
由Datawhale组织的「一周算法实践」活动,通过短期实践一个比较完整的数据挖掘项目,迅速了解相关实际过程
GitHub - Datawhale Datamining Practice - awyd234
【任务1.1 - 模型构建】给定数据集,数据三七分,随机种子2018。(在任务1中什么都不用考虑,即不需数据处理和模型调参)调用sklearn的包,简单构建逻辑回归、SVM和决策树3个模型,评分方式任意(e.g. 准确度和auc值)。
1 | virtualenv --python=python3.6 --prompt='(datawhale_dm_practice)' .env |
link: https://leetcode.com/problems/search-in-rotated-sorted-array/
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).
You are given a target value to search. If found in the array return its index, otherwise return -1.
You may assume no duplicate exists in the array.
Your algorithm's runtime complexity must be in the order of O(log n).
Example 1:
1 | Input: nums = [4,5,6,7,0,1,2], target = 0 |
In general, given the preorder traversal sequence and postorder traversal sequence of a binary tree, we cannot determine the binary tree.
Figure 1
In Figure 1 for example, although they are two different binary tree, their preorder traversal sequence and postorder traversal sequence are both of the same.
But for one proper binary tree, in which each internal node has two sons, we can uniquely determine it through its given preorder traversal sequence and postorder traversal sequence.
Label n nodes in one binary tree using the integers in [1, n], we would like to output the inorder traversal sequence of a binary tree through its preorder and postorder traversal sequence.
The 1st line is an integer n, i.e., the number of nodes in one given binary tree,
more >>由存储引擎层实现
索引的优点:
一般没有特定指明类型时,多半是B-Tree索引;除了Archive引擎,大多数引擎都支持B-Tree
NDB集群存储引擎内部实际使用T-Tree结构存储,InnoDB则使用B+Tree
MyISAM使用前缀压缩技术使索引更小,InnoDB则按原数据格式进行存储
B-Tree对索引列是顺序组织存储的,所以很适合查找范围数据,适合于全键值、键值范围或键前缀查找,其中键前缀查找只适用于根据最左前缀的查找
more >>tag:
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent: meta: false pages: false posts: title: true date: true path: true text: false raw: false content: false slug: false updated: false comments: false link: false permalink: false excerpt: false categories: false tags: true