原创 hierarchal cluster (層次聚類,complete linkage)

上一篇博客介紹了single linkage是讓所有簇的距離爲簇間結點最短的距離,同時每一次合併所有簇間距中最短的那一個。 而complete則是讓簇間結點距離最長的作爲簇間距,並且每一次讓所有簇間距最短兩簇進行合併,因此實際上不是都找最

原创 Kaggle比賽----LANL Earthquake Prediction(Baseline)

第一次較完整地kaggle比賽接近尾聲,LANL Earthquake Prediction,先做一篇類似於baseline的東西吧,由於自己看爲主,所以簡單的一些代碼不會全部寫出來,主要作爲一個思路。比賽地址爲:https://www.

原创 C++開發繪製正弦曲線的方法

這篇文章主要爲大家詳細介紹了C++繪製正弦曲線的方法,具有一定的參考價值,感興趣的小夥伴們可以參考一下 本文實例爲大家分享了C++繪製正弦曲線的具體代碼,供大家參考,具體內容如下 通過OnDraw函數繪製圖形

原创 hierarchal cluster (層次聚類,single/complete linkage)

看網上似乎沒有層次聚類關於single/comlplete linkage只用numpy的輪子,於是根據作業需求造了一個。 雖然都是層次聚類,但是基於single/comlplete linkage的和average linkage的着實

原创 對二分類問題,4維特徵數據的bagging(logstics的bagging)

這次的任務是在用logstic單一分類器的基礎上,用bagging進行訓練,看看有沒有提升。 首先對bagging做一些介紹: bagging主要是對樣本進行重複放回的採樣,對每一重採樣都得到一個模型,最後取平均參數(或者進行投票)產生最

原创 169. Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋

原创 168. Excel Sheet Column Title

Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A

原创 167. Two Sum II - Input array is sorted

Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a speci

原创 162. Find Peak Element

A peak element is an element that is greater than its neighbors. Given an input array nums, where nums[i] ≠ nums[i+1],

原创 160. Intersection of Two Linked Lists

Write a program to find the node at which the intersection of two singly linked lists begins. For example, the followin

原创 155. Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push eleme

原创 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] 

原创 148. Sort List

Sort a linked list in O(n log n) time using constant space complexity. Example 1: Input: 4->2->1->3 Output: 1->2->3->4

原创 147. Insertion Sort List

Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (black) initia

原创 144. Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \