- 博客(13)
- 收藏
- 关注
原创 高级编程技术第十三次作业
sklearn作业题:简要意思就是测试朴素贝叶斯,SVM,随机森林三种算法对解决同一个问题的性能分析。步骤1:创建数据集dataset = datasets.make_classification(n_samples=1000, n_features=10) 步骤2:用10重交叉验证对数据集拆分。kf = cross_validation.KFold(1000, n_folds=10, shuff...
2018-06-18 23:53:50 256
原创 高级编程技术第十二次作业
本次作业题目来源 https://nbviewer.jupyter.org/github/schmit/cme193-ipython-notebooks-lecture/blob/master/Exercises.ipynb Anscombe's quartetAnscombe's quartet comprises of four datasets, and is rather famous. ...
2018-06-12 16:31:59 179
原创 高级编程作业第十一次作业
Exercise 10.1: Least squaresGenerate matrix A ∈ Rm×n with m > n. Also generate some vector b ∈ Rm.Now find x = arg minx ||Ax − b||2.Print the norm of the residual用numpy里的random的rand和mat生成矩阵,最后用最小二乘...
2018-06-04 10:57:07 307
原创 高级编程技术第十次作业
Exercise 11.1: Plotting a function Plot the function F(x)=sin2(x-2)e-x^2 over the interval [0,2]. Add proper axis labels, a title, etc.在区间[0,2]画出f(x)并加上适合的轴标签,题目等...
2018-05-28 20:22:48 209
原创 高级编程技术第九次作业
exercise 9 Numpy事先声明,这里用到函数前提是安装好numpy和scipy包并在开头引用如下:from numpy import * from scipy.linalg import toeplitz import timeGenerate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A ...
2018-05-21 22:12:21 172
原创 高级编程技术第八次作业
670. Maximum SwapGiven a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get.Example 1:Input: 2736 Output: 723...
2018-05-06 15:44:53 157
原创 高级编程技术第七次作业
第一题:41. First Missing PositiveGiven an unsorted integer array, find the smallest missing positive integer.Example 1:Input: [1,2,0] Output: 3 Example 2:Input: [3,4,-1,1] Output: 2 Example 3:Input: [7,8...
2018-04-27 18:40:39 184
原创 高级编程技术第六周作业
11.1city_functions.pydef get_city_country(City,Country): return City+", "+Countrytest_cities.pyimport unittest from city_functions import get_city_country class CityTestCase(unittest.TestCase): def ...
2018-04-15 16:38:10 126
原创 高级编程技术第五周作业
9.1&9.2class Restaurant: def __init__(self,restaurant_name,cuisine_type): self.restaurant_name=restaurant_name self.cuisine_type=cuisine_type def describe_restaurant(self): print("Our rest...
2018-04-07 22:09:12 194
原创 高级编程技术第四周作业
7.2amount=int(input("How many people come to eat? ")) if amount>8: print("There is no empty table") else: print("There is a empty table")7.3amount=int(input("Please input a number and i'll figure...
2018-04-01 18:40:44 162
原创 高级编程技术第三周作业
5.1food='rice' print("Is food == 'rice' ,i predict true") print(food=='rice') print("Is food == 'pork' ,i predict false") print(food=='pork') animal='dog' print("Is animal == 'dog' ,i predict true") p...
2018-03-25 18:19:34 173
原创 高级编程技术第二周作业
3.2names['ljy','lcz','lk','lyj','lzc','lzy','lyf'] for people in names: print(people+" hello my friend")3.4-3.7guest=['zhugeliang','lishiming','zhuyuanzhang'] for people in guest: print(people.title...
2018-03-18 19:33:29 294
原创 高级编程技术第一周作业
1.python主页 一上到python主页,首先映入我脑海的就是一系列python的代码,这些代码能很清晰的告诉初学者python的最大特点,那就是简洁,以往在c,c++需要几十行代码的文件,在python只需不到十行就能实现。继续往下浏览,可以找到python的历史版本,点开进去,发现有许多版,这给我一种印象就是python这种语言在高速发展中,与时俱进。在继续看有一些关于pyt...
2018-03-11 16:08:58 189
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人