Watermelon decision tree ID3 algorithm
ID3 decision tree algorithm
background knowledge
ID3 algorithm was first proposed by J. Ross Quinlan at the University of Sydney in 1975. The core of the algorithm is "information entropy". By calculating the information gain of each attribute, ID3 algorithm considers that the attribute with high information gain is a good attr ...
Posted by apervizi on Sun, 31 Oct 2021 03:13:31 -0700
Java - time complexity and space complexity
The time complexity and space complexity of common sorting algorithms are as follows:
1. Algorithm efficiency
There are two kinds of algorithm efficiency analysis: The first is time efficiency and the second is space efficiency. Time efficiency is called time complexity, and space efficiency is called space complexity. Time complexity mainly ...
Posted by seavers on Sat, 30 Oct 2021 22:24:54 -0700
188. The best time to buy and sell stocks IV
catalogue188. The best time to buy and sell stocks IVsubjectProblem solution
188. The best time to buy and sell stocks IV
subject
Given an array of integers prices, its i-th element prices[i] is the price of a given stock on day I.
Design an algorithm to calculate the maximum profit you can make. You can complete up to k transacti ...
Posted by valtido on Sat, 30 Oct 2021 21:47:05 -0700
[detailed algorithm solution] DFS solution force buckle 463 Island perimeter
subject
A two-dimensional grid map grid of row x col is given, where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water. The grids in the grid are connected horizontally and vertically (not diagonally). The whole grid is completely surrounded by water, but there happens to be an island (or an island connected by one or more gri ...
Posted by garty on Sat, 30 Oct 2021 16:28:29 -0700
Classic interview questions of binary tree (you deserve it)
Classic interview questions of binary tree
Before that, I have published the basic knowledge of binary tree:
Detailed explanation of binary tree Next, I will tell you some classic and common binary tree interview questions
Preliminary interview questions
Maximum depth of binary tree
Question: Maximum depth of binary tree Solution idea: ...
Posted by gacon on Sat, 30 Oct 2021 12:46:33 -0700
Linear regression with one variable
2.1 linear regression algorithm model representation
Let's start with an example: this example is to predict housing prices. We want to use a data set containing housing prices in Portland, Oregon. Here, I want to draw my data set according to the selling prices of different house sizes. For example, if your friend's house is 1250 square feet ...
Posted by SyncViews on Sat, 30 Oct 2021 11:15:12 -0700
Large integer multiplication based on FFT
Polynomial evaluation For polynomials
f
(
x
)
=
a
0
+
a
...
Posted by !Mikey on Sat, 30 Oct 2021 02:08:32 -0700
Principle and code analysis of the strongest ViT (Vision Transformer) in the whole network
Today, let's learn more about Vision Transformer. timm based code.
1. Patch Embedding
Transformer was originally used to do NLP work, so ViT's primary task is to convert the graph into word structure. The method adopted here is to divide the picture into small blocks, as shown in the lower left corner of the above figure. Eac ...
Posted by warran on Fri, 29 Oct 2021 10:38:15 -0700
[algorithm problem solving details] DFS solves the area surrounded by force buckle 130
subject
Give you a matrix board of m x n, which consists of several characters' X 'and' O ', find all areas surrounded by' X ', and fill all' O 'in these areas with' X '. Example 1
Input: board = [["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
Output:[["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],["X","O","X ...
Posted by sheffrem on Fri, 29 Oct 2021 07:49:35 -0700
Hash table of data structure
1, Basic introduction
1. Basic introduction Hash table (also known as hash table) is a data structure that is accessed directly according to the Key value. In other words, it accesses records by mapping key values to a position in the table to speed up the search. This mapping function is called hash function, and the array storing records is ...
Posted by thenature4u on Thu, 28 Oct 2021 20:36:02 -0700