- 博客(16)
- 收藏
- 关注
原创 达观杯-文本智能处理挑战赛-06
任务: 【Task4 模型优化】:(2天) 1)进一步通过网格搜索法对3个模型进行调优(用5000条数据,调参时采用五折交叉验证的方式),并进行模型评估,展示代码的运行结果。(可以尝试使用其他模型) 2)模型融合,模型融合方式任意,并结合之前的任务给出你的最优结果。 例如Stacking融合,用你目前评分最高的模型作为基准模型,和其他模型进行stacking融合,得到最终模型及评分结果。 模型结果...
2019-04-15 21:53:11
194
原创 达观杯-文本智能处理挑战赛-05
一、LightGBM原理简介 传统的boosting算法(如GBDT和XGBoost)已经有相当好的效率,但是在如今的大样本和高维度的环境下,传统的boosting似乎在效率和可扩展性上不能满足现在的需求了,主要的原因就是传统的boosting算法需要对每一个特征都要扫描所有的样本点来选择最好的切分点,这是非常的耗时。为了解决这种在大样本高纬度数据的环境下耗时的问题,Lightgbm使用了如下两种...
2019-04-13 21:05:29
276
原创 达观杯-文本智能处理挑战赛-04
LR+SVM模型实现 逻辑回归: lr = LogisticRegression(C = 120, dual = True) lr.fit(X_train, y_train) y_test_predict = lr.predict(X_test) f1_score_lr = f1_score(y_test, y_test_predict, average = 'micro') print('LR模...
2019-04-11 21:08:57
184
原创 达观杯-文本智能处理挑战赛-03
word2vec原理及实践 一、概述 word2vec其实就是训练词向量的一种方法。因为从语言学的角度,一句话中两个词越近,其联系就会越强。而之前常见的one-hot训练词向量的方法,则割裂了语言之间的相关性。one-hot是映射到一维空间的一个点,word2vec是把词映射到高维空间,相近的词出现的位置相近。接下来,词都表示成向量,再根据余弦距离、曼哈顿距离等计算向量之间的相似性。再考虑怎么把词...
2019-04-09 21:17:38
214
原创 达观杯-文本智能处理挑战赛-02
TFIDF原理及实践 一、词袋模型 原理: 将每篇文章看成一袋子词,并忽略每个词出现的顺序。即将整段文本以词为单位切分开,然后每篇文章可以表示成一个长向量,向量中的每一维代表一个单词,而该维对应的权重则反映了这个词在原文章中的重要程度。权重与词在文本中出现的频率有关,而其中不考虑词与词之间的上下文关系。 词袋模型的三步骤: 分词——统计修订词特征值——标准化 二、TF-IDF概述 公式为:TF-I...
2019-04-07 12:36:39
196
原创 达观杯-文本智能处理挑战赛-初识数据
赛题目标: 建立模型通过长文本数据正文,预测文本对应的类别 数据准备: train_set.csv 用于模型训练 test_set.csv 用于模型预测 读取前5000条数据: import pandas as pd import numpy as np from sklearn.model_selection import train_test_split my_data = pd.read...
2019-04-05 17:36:55
283
原创 数据处理——特征选择
数据处理——特征选择 参考博文: https://blog.youkuaiyun.com/coffee_cream/article/details/61423223 http://www.cnblogs.com/heaad/archive/2011/01/02/1924088.html https://blog.youkuaiyun.com/kebu12345678/article/details/78437118 ...
2019-03-09 14:50:21
447
原创 LeetCode(771)——Jewels and Stones
题目: You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the...
2019-02-28 19:05:58
110
原创 python——numpy中的transpose
1)是重塑的一种特殊形式,返回的是源数据的视图(不会进行任何复制操作) 2)需要一个由轴编号组成的元组才能对这些轴进行转置 以三维数组为例: 假设shape(z, x, y) 1)shape的x轴和y轴的转换(跟二维数组一样) In [27]: arr.transpose((0, 2, 1)) Out[27]: array([[[ 0, 4], [ 1, 5], ...
2019-02-28 09:22:05
296
原创 LeetCode(198)——House Robber
题目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent h...
2019-02-27 17:07:36
107
原创 ix-loc-iloc三者的区别——python
1)loc:通过行标签索引行数据 2)iloc:通过行号索引行数据 3)ix:通过行标签或者行号索引行数据 例如: datas = [[1,2,3],[4,5,6]] index = ['a','b'] columns = ['c','d','e'] df = pd.DataFrame(datas, index = index, columns = columns) df.loc['a'] d...
2019-02-26 16:48:40
200
原创 leetcode——Maximum Product of Three Numbers(python)
leetcode——Maximum Product of Three Numbers 题目: Given an integer array, find three numbers whose product is maximum and output the maximum product. 大致思路: 1)计算最小的两个负数以及最大的正数之间的乘积; 2)计算最大的三个正数之间的乘积 3)比较选...
2019-02-24 20:52:24
135
原创 leetcode——Rotting Oranges
leetcode——Rotting Oranges(python) 题目: In a given grid, each cell can have one of three values: the value 0 representing an empty cell; the value 1 representing a fresh orange; the value 2 representing...
2019-02-24 20:30:26
228
原创 leetcode——Longest Uncommon Subsequence I
python——Longest Uncommon Subsequence I 题目: Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defined as ...
2019-02-23 11:45:36
113
原创 leetcode——1-bit and 2-bit Characters
leetcode——1-bit and 2-bit Characters 大致思路: 从数组第一位开始遍历,所第i为值为1,则一定和下一位一起组成2bits,则i向后移动两位。 若最后i移动到了最后一位(即i==len(bits)-1),则最后一位为1bit 代码如下: class Solution(object): def isOneBitCharacter(self, bits): ...
2019-02-22 20:55:44
187
原创 java学习——GetType和typeof的区别
java学习——GetType和typeof的区别 区别: 1、Typeof()是运算符而GetType是方法; 2、GetType()是基类System.Object的方法,因此只有建立一个实例之后才能被调用(初始化以后); 3、Typeof()的参数只能是int,String,自定义类型,且不能是实例 4、Typeof():得到一个Class的Type; GetType():得到一个Class...
2018-11-26 22:40:07
15321
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人