自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(241)
  • 收藏
  • 关注

转载 面向稀有事件的 Logistic Regression 模型校准

引言 对分类问题的研究大部分是在样本分布均衡的情况下开展的。比如对二分类,一般研究的是正样本和负样本的数量相当(比如各占50%)或者相差不是那么大(比如一类样本占30%,另一类样本占70%)。但在实际应用时,经常会碰到样本倾斜问题,对于二分类而言,就会是某类的样本比例远小于另一类的样本比例。在学术界,一般称样本少的那类为正类,称正类代表的随机事件为稀有事件。稀有事件的例子并不少,比如发生战争的...

2018-07-26 16:19:47 4052 1

转载 使用 Isotonic Regression 校准分类器

21 December 2015 1. 引言 对有监督机器学习问题,通常的训练流程包括这样几步:先建立起模型,然后在训练集上训练模型,如果有超参数,还需要在验证集上应用交叉验证以确定超参数,总之最终会得到一个模型。在这样的流程下,不断优化模型,如果在测试集上取得了较高的准确率、召回率、F-score或者AUC后,那事情就结束了吗,模型的输出结果是符合需要的吗?这并不一定。当给定一个样本,大...

2018-07-26 15:33:51 1618 1

原创 走出校门,工作4个月的工作感想

今天五月份正式踏入社会,结束了将近二十年的学习生涯,在踏入工作岗位的一段时间里,没有任何不适应,反而获得了单纯快乐,摆脱了在校园中的种种烦恼。时间过的飞快,工作后的时间更是眨眼即逝。四个月的时间里,虽然很累,但总是感觉到成长很少。最痛苦的找不到原因,也没有自己专一的目标,每天过着随大流的生活。耳边充斥着买房,结婚等琐碎的事情,也越发觉得自己像是陷入了泥潭,回天乏力。浮躁的情绪一天一天的漫上心头

2018-06-01 15:40:05 1493 1

原创 2015校招求职之路

2015.10.23日把三方寄出,今年的求职之旅基本宣告结束了,回想这段求职的旅程也算圆满了,自己心仪公司都经历了面试,也经历过霸面了,最后的结果还算圆满,拿到了华为,中兴,远景能源,大众点评,瑞晟微电子的offer,我的这几个offer也算是比较奇葩的,涵盖了通信,能源,互联网,微电子领域,经过最终的考虑,最终选择了去大众点评。华为  软件研发岗special offer最终选择走软

2015-11-04 18:38:32 1196

原创 两个栈实现队列

stack1与stack21.push的时候一直push到stack1中2.pop的时候,检测stack2是否为空,当为空时,stack1中的元素push到stack2中,当stack2中不为空时,直接pop stack2以下为实现的java代码package 两个栈实现队列;import java.util.Stack;public class MyQueue {

2015-08-23 22:31:02 549

原创 c++中字节对齐问题

三个基本原则1.struct或者union或者class里,每个成员的对齐开始位必须是成员自己的大小的整数倍;2.每个结构体的大小必须是结构体内最大成员的整数倍,(第二个补齐方式)3.结构体a内的结构体b的开始位必须是b里的最大成员的整数倍。例一:typedef struct BB {int id;             //[0]....[3]dou

2015-08-11 21:38:49 654

原创 Different Ways to Add Parentheses

Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are+, - and *.Example 1I

2015-07-28 22:29:19 1721

原创 华为软件精英挑战赛【德州扑克】心得体会

这是华为举办的一个软件竞赛,华为提供一个德州扑克台桌的server,我们要根据牌型等因素,给出出牌的策略,类似模拟牌手的程序。从知道挑战的题目到提交最终版本的程序中间只有一个月的时间,刚看到这个题目一点头绪没有,看了论文有用蒙特卡洛模拟,决策树等,各种没听过的词汇,感觉写出这个程序会很难,和我一个教研室的小伙伴们看到这个题目的时候陆续都放弃了。        思考了半天我也放弃了,因为接下来几

2015-07-10 22:09:31 5375

原创 Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by this original tweet by Max Howe

2015-06-17 22:32:20 597

原创 Add and Search Word - Data structure design

Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regular expression string containing only lett

2015-06-03 22:27:07 763

原创 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact

2015-05-21 21:50:57 522

原创 3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c

2015-05-19 21:43:59 537

原创 Minimum Size Subarray Sum

Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 0 instead.For example, given the array [2,3

2015-05-15 22:22:18 661

原创 egit插件提交项目到github无需每次输入URL的方法

用eclipse的插件egit,向github push的时候,每次关闭并重新打开eclipse都要重新输入url和用户名,非常麻烦,在网上搜搜索了一通,在github群里问了一通,都没有较好的办法,这里又一个较为简单的方法step1:首先由见项目,Team->Show In Repositories Viewstep2:右击Remotes->Creates Remote

2015-05-15 10:04:32 1152

原创 Roman to Integer

Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.class Solution {public: int romanToInt(string s) { unordered_map mp = {{"M",

2015-05-11 21:00:39 716

原创 Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.class Solution {public: string longestCommonPrefix(vector& strs) { if(strs.size()==0) return "";

2015-05-11 20:59:46 491

原创 Integer to Roman

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.class Solution {public: string intToRoman(int num) { map mp = {{1000,"M"},{9

2015-05-11 20:59:33 649

原创 Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin

2015-05-10 22:11:02 549

原创 String to Integer (atoi)

Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca

2015-05-08 21:02:44 801

原创 Reverse Integer

Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before c

2015-05-07 22:29:23 524

原创 ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I

2015-05-07 22:09:13 475

原创 windows下eclipse中gdb调试输出stl容器的内容(终极解决方案)

摸索了一天终于把这个问题搞定了首先下载MinGw地址:http://sourceforge.net/projects/mingw/?source=directory下载完之后安装G++,在安装程序中步骤如下之后利用CMD安装gdb-pythonMinGw-get.exe install gdb-python同时安装GDB同时按照以下步骤安

2015-05-07 17:22:11 1941

原创 Reverse Linked List

Reverse a singly linked list.递归方法/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */publi

2015-05-05 16:38:13 748

原创 Combine Two Tables

Table: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+-------------+---------+Per

2015-05-05 11:03:32 431

原创 Median of Two Sorted Arrays

There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).这是一道非常经典的题。这题更通用的形式是,给定

2015-05-04 10:22:07 1035

原创 Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo

2015-05-02 19:28:48 631

原创 [LeetCode]Isomorphic Strings

Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with anot

2015-04-29 22:23:39 631

原创 [LeetCode]Count Primes

Description:Count the number of prime numbers less than a non-negative number, nclick to show more hints.References:How Many Primes Are There?Sieve of EratosthenesCredits:Speci

2015-04-28 21:51:17 1742

原创 编程之美2015资格赛 题目1 : 2月29日

时间限制:2000ms单点时限:1000ms内存限制:256MB描述给定两个日期,计算这两个日期之间有多少个2月29日(包括起始日期)。只有闰年有2月29日,满足以下一个条件的年份为闰年:1. 年份能被4整除但不能被100整除2. 年份能被400整除输入第一行为一个整数T,表示数据组数。之后每组数据包含两行。每一行格式为"mont

2015-04-22 10:59:02 879

原创 [HiHoCoder]#1051 : 补提交卡

#1051 : 补提交卡时间限制:2000ms单点时限:1000ms内存限制:256MB描述小Ho给自己定了一个宏伟的目标:连续100天每天坚持在hihoCoder上提交一个程序。100天过去了,小Ho查看自己的提交记录发现有N天因为贪玩忘记提交了。于是小Ho软磨硬泡、强忍着小Hi鄙视的眼神从小Hi那里要来M张"补提交卡"。每张"补提交卡

2015-04-16 17:48:42 1080

原创 [LeetCode]Binary Tree Right Side View

Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given the following binary tree, 1

2015-04-13 17:37:06 666

原创 [LeetCode]Number of Islands

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assu

2015-04-11 19:10:28 1017

原创 [LeetCode]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 house

2015-04-11 16:23:37 1011

转载 Java的内存泄漏

Java的一个重要优点就是通过垃圾收集器(Garbage Collection,GC)自动管理内存的回收,程序员不需要通过调用函数来释放内存。因此,很多程序员认为Java不存在内存泄漏问题,或者认为即使有内存泄漏也不是程序的责任,而是GC或JVM的问题。其实,这种想法是不正确的,因为Java也存在内存泄露,但它的表现与C++不同。问题的提出Java的一个重要优点

2015-04-08 14:40:28 502

转载 java程序员面试32问

第一,谈谈final, finally, finalize的区别。   第二,Anonymous Inner Class (匿名内部类) 是否可以extends(继承)其它类,是否可以implements(实现)interface(接口)?   第三,Static Nested Class 和 Inner Class的不同,说得越多越好(面试题有的很笼统)。   第四,&和

2015-04-07 20:53:26 443

原创 [HiHoCoder]三分·三分求极值[hiho一下 第四十周]

时间限制:10000ms单点时限:1000ms内存限制:256MB描述在直角坐标系中有一条抛物线y=ax^2+bx+c和一个点P(x,y),求点P到抛物线的最短距离d。提示:三分法输入第1行:5个整数a,b,c,x,y。前三个数构成抛物线的参数,后两个数x,y表示P点坐标。-200≤a,b,c,x,y≤200

2015-04-06 13:49:49 819

原创 题目2 : Professor Q's Software【微软2016校园招聘在线笔试】

时间限制:10000ms单点时限:1000ms内存限制:256MB描述Professor Q develops a new software. The software consists of N modules which are numbered from 1 to N. The i-th module will be started up by sig

2015-04-04 20:16:29 1007 2

原创 题目1 : Magic Box【微软2016校园招聘在线笔试】

时间限制:10000ms单点时限:1000ms内存限制:256MB描述The circus clown Sunny has a magic box. When the circus is performing, Sunny puts some balls into the box one by one. The balls are in three colo

2015-04-04 20:15:27 1789 1

原创 [HiHoCoder]二分·归并排序之逆序对

时间限制:10000ms单点时限:1000ms内存限制:256MB描述在上一回、上上回以及上上上回里我们知道Nettle在玩《艦これ》。经过了一番苦战之后,Nettle又获得了的很多很多的船。这一天Nettle在检查自己的舰队列表:我们可以看到,船默认排序是以等级为参数。但实际上一个船的火力值和等级的关系并不大

2015-03-30 11:01:31 900

原创 [华为机试]朋友圈信息转发

朋友圈转发信息描述:在一个社交应用中,两个用户设定朋友关系后,则可以互相收到对方发布或转发的信息。当一个用户发布或转发一条信息时,他的所有朋友都能收到该信息。 现给定一组用户,及用户之间的朋友关系。问:当某用户发布一条信息之后,为了让每个人都能在最早时间收到这条信息,这条信息最少需要被转发几次? 假设:对所有用户而言:1)朋友发出信息到自己收到该信息

2015-03-27 22:02:00 1600

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除