原创 kaggle入門競賽--Titanic:Machine Learning from Disaster

Titanic是Kaggle入門競賽的第一個問題,泰坦尼克號已經是衆所周知的事情,在這場災難中存活下來的人非常少,運用機器學習的知識預測某個人在這場災難中是否能夠存活是這道題目的目的。這道題一共做了三次,總結一下做本題的步驟: (1)首先

原创 用學習曲線 learning curve 來判別過擬合問題

轉載自這篇文章 本文結構: 學習曲線是什麼?怎麼解讀?怎麼畫? 學習曲線是什麼? 學習曲線就是通過畫出不同訓練集大小時訓練集和交叉驗證的準確率,可以看到模型在新數據上的表現,進而來判斷模型是否方差偏高或偏差過高,以及增大訓練集是否可

原创 經典排序算法(二)--插入排序、希爾排序(Java實現)

插入排序的思想:首先假設索引爲0的元素]被正確排序,然後只需要對索引爲1-nums.length-1的元素排序,每次將要插入的元素賦值給變量target,然後判斷target與已經排好序的元素相比較,如果target小於排好序的元素,說明

原创 442. Find All Duplicates in an Array--找到數組中出現兩次的數字

Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find

原创 64. Minimum Path Sum--找路徑最小和

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum

原创 624.Maximum Distance in Arrays --找數組中的最大差值

Given m arrays, and each array is sorted in ascending order. Now you can pick up two integers from two different ar

原创 永久激活windows10專業版(並防止殺毒軟件查殺)+eclipse字體大小修改

1.永久激活win10 因爲在激活win10的時候,參考網上的在DOS系統下輸命令,使用各種祕鑰都不行,所以找了這種用激活工具激活的方法,首先下載KMS激活工具: http://pan.baidu.com/s/1hsmpbvA 解壓後點擊

原创 48. Rotate Image

You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could y

原创 628. Maximum Product of Three Numbers--找最大乘積

Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input:

原创 105. Construct Binary Tree from Preorder and Inorder Traversal

Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do no

原创 621. Task Scheduler--任務調度

Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters rep

原创 75. Sort Colors--數組排序

Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, wi

原创 153. Find Minimum 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 m

原创 34. Search for a Range

Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Y

原创 經典排序算法(一)--冒泡排序、快速排序java實現

冒泡排序(升序)的思想是:每次比較相鄰兩個元素,如果這兩個元素沒有按升序排序,即如果第一個元素大於第二個元素,則需要調換兩個元素的順序。經過一輪比較之後,最大的元素排在末尾,這時候只需要再對第0-nums.length-2這些元素進行兩兩