- 博客(18)
- 资源 (8)
- 收藏
- 关注
原创 sklearn中的TfidfVectorizer中计算TF-IDF的过程(详解)
Sklearn中的Tf-idf原理(source code):https://github.com/scikit-learn/scikit-learn/blob/f0ab589f1541b1ca4570177d93fd7979613497e3/sklearn/feature_extraction/text.pyTf-idf训练Fit_transform学习到一个字典,并返回Documen...
2018-08-24 11:30:57
35746
6
原创 找出数组中重复的数字
在一个长度为n的数组里的所有数字都在0到n-1的范围内。 数组中某些数字是重复的,但不知道有几个数字是重复的。也不知道每个数字重复几次。请找出数组中任意一个重复的数字。 例如,如果输入长度为7的数组{2,3,1,0,2,5,3},那么对应的输出是第一个重复的数字2。package example3;import java.util.HashMap;public cl
2017-07-01 15:58:36
2197
原创 大富翁游戏
大富翁游戏,玩家根据骰子的点数决定走的步数,即骰子点数为1时可以走一步,点数为2时可以走两步,点数为n时可以走n步。求玩家走到第n步(nimport java.util.Scanner;public class Conclusion { /** * @param args */ public static int getConclusion(int n){
2017-06-26 19:52:30
1189
原创 拼凑钱币
给你六种面额 1、5、10、20、50、100 元的纸币,假设每种币值的数量都足够多,编写程序求组成N元(N为0~10000的非负整数)的不同组合的个数。 输入描述:输入包括一个整数n(1 ≤ n ≤ 10000)输出描述:输出一个整数,表示不同的组合方案数输入例子:1输出例子:1import java.util.Scanner;import java
2017-06-26 19:50:18
1582
原创 TF-IDF
# -*- coding:utf-8 -*-__author__ = "dongluyu"from sklearn.feature_extraction.text import TfidfTransformerfrom sklearn.feature_extraction.text import CountVectorizerif __name__ == "__main__":
2017-06-14 18:34:20
324
原创 leetcode_Palindrome Number
问题描述:Determine whether an integer is a palindrome. Do this without extra space. 判断一个整数是不是回文数,并且不借助额外的空间解决思路:一个回文数反转之后还是它本身package com.main;package com.main;public class Palin
2017-06-11 11:45:43
207
原创 leetcode_Reverse Integer
问题描述:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321The input is assumed to be a 32-bit signed integer. Your function should return 0 when the rever
2017-06-11 11:06:35
254
原创 leetcode_Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same
2017-06-09 10:39:28
236
原创 面试例题—sizeof(2)
例题:what is the output of the following code?// sizof2.cpp : Defines the entry point for the console application.//#include "stdafx.h"#includeusing namespace std;class A{};class A2{ char d,e
2017-05-31 10:12:24
361
原创 面试例题6-sizeof
例题: what is the output of the following code?// sizeof.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include #includeusing namespace std;struct{ s
2017-05-31 09:57:36
413
原创 面试例题5—感知器实现and函数
用感知器实现and函数参考博客:https://www.zybuluo.com/hanbingtao/note/433855点击打开链接and 运算时一个二元运算,它的真值表如下:x1x2y000010100111Python:class Percep
2017-05-25 17:27:25
1404
原创 面试例题4—main函数执行完毕后,是否会再执行一段代码
atexit()函数 函数名: atexit 头文件:#include 功 能: 注册终止函数(即main执行结束后调用的函数) 用 法: int atexit(void (*func)(void)); 注意:按照ISO C的规定,一个进程可以登记多达32个函数,这些函数将由exit自动调用。atexit()注册的函数类型应为不接
2017-05-22 11:12:27
454
原创 面试例题-3 编辑距离
编辑距离(Edit Distance),又称Levenshtein距离,是指两个字串之间,由一个转成另一个所需的最少编辑操作次数。许可的编辑操作包括将一个字符替换成另一个字符,插入一个字符,删除一个字符。一般来说,编辑距离越小,两个串的相似度越大。例如将kitten转成sitting:kitten->sitten (k→s)sitten->sittin (e→i)sitti
2017-05-19 10:02:32
424
原创 面试题2—交换a和b
题目:将a,b的值进行交换,并且不适用任何中间变量思路:异或运算c语言:// Change.cpp : Defines the entry point for the console application.//#include "stdafx.h"#includevoid change(int a, int b){a = a ^ b;b = a ^ b;a = a ^
2017-05-16 18:20:14
726
原创 .ipynb文件转换成HTML文件出现找不到python kernel的解决方案
将.ipynb文件转换成HTML格式报错:jupyter_client.kernelspec.NoSuchKernel: No such kernel named Python解决方法:在命令中制定执行的kernel_namejupyter nbconvert WebReport_Bixby_Unpack_final_Chinese.ipynb --to=html --Exec
2017-05-16 16:13:18
977
原创 面试题-螺旋队列
21 22............20 7 8 9 1019 6 1 2 1118 5 4 3 1217 16 15 14 13设1的坐标是(0,0),x方向向右为正,y方向向下为正,例如,7的坐标为(-1,-1),2的坐标为(1,0)。编程实现输入任意一
2017-05-16 14:05:34
418
原创 Finding Deceptive Opinoin Spam by Any Stretch of the Imagination (Myle Ott Yjin Choi)
摘要在这篇论文中,我们主要研究虚假评论垃圾信息,即是故意撰写的评论 ,但是伪造地像真的一样。从计算机语言学和心理学的角度,我们开发和比较了三个方法来检测虚假评论垃圾信息,并在我们的垃圾评论数据集上开发了一个准确率接近90%的分类器(结合心理学欺骗特征和n-gram)。通过这个机器学习分类器学习到特征权重。特别地,我们考虑上下文和欺骗的动机,而不单单是识别一个普通的欺骗线索的集合。所以 我们
2016-03-22 10:42:20
794
原创 机器学习之Python-环境搭建全过程
工欲善其事必先利其器,下面我就机器学习之python环境搭建过程做全面又详细的解说。所有的安装包以及第三方库均可在百度云盘http://pan.baidu.com/disk/home#list/path=%2F%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0-Python%E6%90%AD%E5%BB%BA下载第一步:安装python(1)下载python-2.7.
2016-01-23 14:42:19
4735
Java Excel API
2016-05-27
MyEclipseGen.java
2016-04-01
Cover T,Hart P.Nearest neighbor pattern classification
2016-03-06
Python实现朴素贝叶斯算法文本分类器
2016-01-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人