自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【机器学习】线性回归常用的几种衡量指标

一、MSE(Mean Squared Error)名称:均方误差公式:二、RMSE(Root Mean Squared Error)名称:均方根误差公式:三、MAE(Mean Absolute Error)名称:平均绝对值误差公式:注:上述衡量指标的局限:同一个模型,解决不同问题,因为数量量级可能不同,所以最终的结果无法横向对比,如果将最终的结果映射到[0,1]区间内,这样就可以横向比较哪个模型能更好的解决此问题,故R Squared即可满足要求。四、R ..

2020-11-20 00:08:54 1137

原创 Mac 安装 Pyspark

在Mac下搭建Pyspark需要安装:Java JDK Scala apache-spark Hadoop Pyspark安装的两种方式1.官网下载安装包,解压后配置环境变量2.使用brew进行安装/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"2-1.使用brew安装所需包brew install scalabrew install apach

2020-11-07 16:33:26 542

原创 Mac 安装 Python3

安装Xcode command line tool : $sudo xcode-select --installSetp2 安装HomeBrew 包管理工具ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"安装好之后可以跑一下 brew ...

2020-03-11 19:06:34 164

原创 1047 Student List for Course (25分)

Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input S...

2020-02-21 10:15:24 80

原创 1046 Shortest Distance (20分)

The task is really simple: givenNexits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specification:Each input file conta...

2020-02-21 09:56:14 70

原创 1053 Path of Equal Weight (30分)

Given a non-empty tree with rootR, and with weightW​i​​assigned to each tree nodeT​i​​. Theweight of a path fromRtoLis defined to be the sum of the weights of all the nodes along the path fro...

2020-02-19 09:27:22 58

原创 1052 Linked List Sorting (25分)

A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integerkeyand aNextpointer to the next structure. Now give...

2020-02-19 06:21:08 78

原创 1051 Pop Sequence (25分)

Given a stack which can keepMnumbers at most. PushNnumbers in the order of 1, 2, 3, ...,Nand pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of th...

2020-02-19 05:05:56 70

原创 1050 String Subtraction (20分)

Given two stringsS​1​​andS​2​​,S=S​1​​−S​2​​is defined to be the remaining string after taking all the characters inS​2​​fromS​1​​. Your task is simply to calculateS​1​​−S​2​​for any given s...

2020-02-19 03:24:04 54

原创 Mac 安装 Jupyte Notebook

前期准备安装pip 和 python安装直接安装pip install --upgrade pippip install jupyter.whl文件安装(备用)安装时,有时会很慢,可以使用迅雷下载.whl文件直接pip安装(一般会nodebook那个文件下载超时,其他的关联包,不需要管,系统会自动下载,也可那个文件超时,单独下哪个),方法:下载好.whl文件,打开终端,...

2020-02-18 14:37:07 160

原创 1057 Stack (30分)

Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top position) and Po...

2020-02-18 12:06:02 67

原创 1056 Mice and Rice (25分)

Mice and Riceis the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice...

2020-02-18 06:33:59 59

原创 1055 The World's Richest (25分)

Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on the peopl...

2020-02-18 02:36:46 80 1

原创 1054 The Dominant Color (20分)

Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the d...

2020-02-18 02:15:55 70

原创 1060 Are They Equal (25分)

If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as0.123×10​5​​with simple chopping. Now given the number of signif...

2020-02-17 02:10:03 100

原创 1059 Prime Factors (25分)

Given any positive integerN, you are supposed to find all of its prime factors, and write them in the formatN=p​1​​​k​1​​​​×p​2​​​k​2​​​​×⋯×p​m​​​k​m​​​​.Input Specification:Each input file co...

2020-02-17 00:38:39 78

原创 1058 A+B in Hogwarts (20分)

If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Si...

2020-02-17 00:00:58 86

原创 1064 Complete Binary Search Tree (30分)

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node's key. The right s...

2020-02-16 06:52:21 85

原创 1063 Set Similarity (25分)

Given two sets of integers, the similarity of the sets is defined to beN​c​​/N​t​​×100%, whereN​c​​is the number of distinct common numbers shared by the two sets, andN​t​​is the total number of ...

2020-02-16 03:28:51 53

原创 1062 Talent and Virtue (25分)

About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outstanding in both talent and virt...

2020-02-16 03:05:04 65

原创 1061 Dating (20分)

Sherlock Holmes received a note with some strange strings:Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that those strange strings...

2020-02-16 02:29:33 64

原创 1068 Find More Coins (30分)(背包问题DP / DFS)

Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However,...

2020-02-15 10:29:50 309

原创 1067 Sort with Swap(0, i) (25分)

Given any permutation of the numbers {0, 1, 2,...,N−1}, it is easy to sort them in increasing order. But what ifSwap(0, *)is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2...

2020-02-15 03:24:37 88

原创 1066 Root of AVL Tree (25分)

An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is...

2020-02-14 23:16:20 64

原创 1065 A+B and C (64bit) (20分)

Given three integersA,BandCin [−2​63​​,2​63​​], you are supposed to tell whetherA+B>C.Input Specification:The first line of the input gives the positive number of test cases,T(≤10). The...

2020-02-14 22:02:34 62 1

原创 1072 Gas Station (30分)

A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the hou...

2020-02-14 07:09:44 87

原创 1071 Speech Patterns (25分)

People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker...

2020-02-14 04:34:04 67

原创 1070 Mooncake (25分)(神坑)

Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now ...

2020-02-14 03:31:07 104

原创 1069 The Black Hole of Numbers (20分)

For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by takin...

2020-02-14 02:58:30 61

原创 1076 Forwards on Weibo (30分)

Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a ...

2020-02-13 08:58:01 84

原创 1075 PAT Judge (25分)(坑多,填坑)

The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.Input Specification:Each input file co...

2020-02-13 06:29:11 188 2

原创 1074 Reversing Linked List (25分)

Given a constantKand a singly linked listL, you are supposed to reverse the links of everyKelements onL. For example, givenLbeing 1→2→3→4→5→6, ifK=3, then you must output 3→2→1→6→5→4; ifK=4, ...

2020-02-13 02:08:41 87

原创 1073 Scientific Notation (20分)

Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-][0-9]+ which means that the inte...

2020-02-12 23:42:32 60

原创 1080 Graduate Admission (30分)

It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission...

2020-02-12 05:23:14 78

原创 1079 Total Sales of Supply Chain (25分)

A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on th...

2020-02-12 03:34:42 55

原创 1078 Hashing (25分)

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to beH(key)=key%TSiz...

2020-02-12 00:11:47 96

原创 1077 Kuchiguse (20分)

The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality. Such a preference is called ...

2020-02-11 23:07:34 74

原创 1083 List Grades (25分)

Given a list ofNstudent records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades ...

2020-02-11 22:35:03 53

原创 1082 Read Number in Chinese (25分)

Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. OutputFufirst if it is negative. For example, -123456789 is read asFu yi Yi er Qian san Bai ...

2020-02-11 22:16:24 59

原创 1081 Rational Sum (20分)

GivenNrational numbers in the formnumerator/denominator, you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case starts with a positive int...

2020-02-10 22:09:30 55

空空如也

空空如也

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

TA关注的人

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