Java Python A1.md 2024-09-29
1 / 3
[CS209A-24Fall] Assignment 1 (100 points)
This summer, we've enjoyed the Olympic Games Paris 2024. Many of us are still reliving the exciting moments
of the summer Olympics, and many of us may be interested in the event of past Olympics and the past
performance of our favorite athletes.
In this assignment, we provide a large dataset of Olympic games from 1896 to 2022. The dataset contains
athlete bio and athlete-event data, including both team and individual sports, from all Winter/Summer
Olympics (1896-2022). The dataset contains 6 csv, with the following relation:
The data should be self-explanatory. Please check the column name and the above diagram carefully to
understand the data.
Analysis of the Olympic Historical Dataset
In this assignment, you will design an OlympicsAnalyzer class, which could read the dataset and perform
various useful analyses. You are encouraged to use the Java features we recently introduced, such as
Collections, Lambda, and Streams, whenever possible.
The OlympicsAnalyzer class has one constructor that reads a dataset file from a given path.
public OlympicsAnalyzer(String datasetPath)
This class also has 5 other methods that perform data analyses. You'll implement these methods in the
OlympicsAnalyzer class. Method details are described below.
1. Top 10 Performant Female Athletes in Individual Sport
public Map topPerformantFemale()A1.md 2024-09-29
2 / 3
This method returns a map of size 10, where:
the key is the name of the female athlete.
the value is the total gold medals acquired by that female athlete in individual sport (i.e., not team
sport).
The map should be sorted by the descending order of count (i.e., from most to the least). If two athletes
have the same gold medal count, then they should be sorted by the alphabetical order of the name.
2. BMI by Sports
public Map bmiBySports()
This method returns a map, where:
the key is the sport name (e.g., Athletics, Boxing, Diving, etc.)
the value is the average BMI of the athletes of that sport. BMI is computed as weight/(height x
height) where the unit of height is the meter. The average BMI should be rounded to one decimal
place.
You should consider all athletes with valid height and weight in our data. The athlete should CS209A、Java also have
participated in any Olympic events so that we know the sport type of that athlete.
The map should be sorted by the descending order of average BMI (i.e., from highest to lowest). If two
sports have the same average BMI, then they should be sorted by the alphabetical order of the sport name.
3. Top 10 Least Appeared Summer Sports
public Map> leastAppearedSport()
This method returns a map with a size of 10, where:
the key is the sport name (e.g., Athletics, Boxing, Diving, etc.)
the value is set of summer Olympics years in which the sport appears.
The map should be sorted by the ascending order of the size of the set (i.e., from least appeared to most
appeared). If two sports have the same occurrences, then they should be sorted by the alphabetical order of
the sport name.
4. Top 10 Countries by Medals in Winter Olympics since the year 2000
public Map winterMedalsByCountry()
This method returns a map with a size of 10, where:
the key is the country code.A1.md 2024-09-29
3 / 3
the value is the sum of all medals, including gold, silver and bronze, acquired by that country in all
Winter Olympics since the year 2000 (including 2000).
The map should be sorted by the descending order of count (i.e., from most to the least). If two countries
have the same medal count, then they should be sorted by the alphabetical order of the country code.
5. Top 10 Countries with Young Athletes in 2020 Summer Olympic
public Map topCountryWithYoungAthletes()
This method returns a map with a size of 10, where:
the key is the country name (not country code).
the value is the average age of the athletes of that country that participate in 2020 Summer Olympic.
For simplicity, you may ignore the exact month and day and only use the year of birth when computing
the age. For example, an athlete born in Dec 31 2000 can be considered as of age 20 in 2020. The
average age should be rounding to the nearest integer.
Athletes with no born information should be ignored.
The map should be sorted by the ascending order of average age (i.e., from youngest to oldest). If two
countries have the same average age, then they should be sorted by the alphabetical order of the country
name ,>,>,>,>,>,>,>,>,>,>
相关推荐
将元素周期表导入程序的小方法 以及 现成的元素周期表代码
@将元素周期表导入程序的小方法 以及 现成的元素周期表代码 方法:H 1.008 He 4.003 Li 6.941 Be 9.012 B 10.81 C 12.01 N 14.01 O 16.00 F 19.00 Ne 20.18 Na 22.99 Mg 24.31 Al 26.98 Si 28.09 P 30.97 S 32.07 Cl 35.45 Ar 39.95 K 39.10 Ca 40.08 Sc 44.96 Ti 47.88 V 50.94 Cr 52.00 Mn 54.94 Fe 55.85
CS209A Stack Overflow
1 / 3Background2 / 3they wantUser3 / 3。
19、面向未来互联网的分布式应用与用户赋权应用方案
本文介绍了面向未来互联网的分布式应用集成与用户赋权应用方案。针对分布式系统中异构中间件平台的集成问题,提出了一种统一的交互范式建模方法,并通过XSB系统实现,从应用开发工作量、可扩展性和性能等方面进行了评估,结果显示该方案具有良好的支持效果。此外,文章还介绍了一种基于LifeApp的用户赋权方法,通过用户虚拟表示实现对个人可识别信息(PII)的控制,从而在个性化服务环境中实现隐私保护与数据自主管理。该方案结合身份七条法律,为用户和服务提供商提供了双赢的解决方案,并展示了在多个应用场景中的潜力。
CS209A Olympic Games
1 / 32 / 3sport).place.3 / 3。
10、基于搜索的软件工程中随机性重要性评估
本文探讨了基于搜索的软件工程(SBSE)中随机性的重要性,重点评估了伪随机数与索博尔序列在软件模块聚类问题中的表现。通过使用爬山搜索算法和不同适应度函数(MQ和EVM)对14个真实世界的Java项目实例进行实验,发现伪随机数在大多数情况下优于索博尔序列,尤其是在模块化质量和解的适应度方面。文章还分析了潜在的有效性威胁,并总结了实验结果,为算法选择提供了有价值的参考。
ARM Cortex平台NEON指令集优化实战指南
本文为ARM Cortex平台开发者提供了一份全面的NEON指令集优化实战指南。文章从NEON的SIMD架构原理讲起,详细介绍了开发环境搭建、NEON内联函数与自动向量化两种核心编程方法、关键数据类型与指令,并通过图像饱和运算、矩阵乘法等实战案例,深入解析了性能调优技巧与常见避坑指南,旨在帮助开发者充分释放ARM处理器的并行计算潜力。
cs反恐特警3d版2java_CS反恐特警增值版
快速搜索机型:诺基亚 N70系列(176×208)7610 3230 6600 6260 6620 6630 6670 6680 6681 6682 N70 N72 ;松下: X700 X800 ;联想: P930诺基亚 N73系列(240×320)N73 5320 5320XM 5320di_XM 5630XM 5700 5700XM 5710XM 5730XM 6110 6110N 6120 ...
多孔材料吸附性质模拟程序RASPA的离线和在线安装方法
RASPA-2.0是今年美国西北大学教授Randall Q. Snurr等人开发的针对于MC,MD,分子力学优化等用途的程序,相比于之前开发的MUSIC软件,RASPA的功能更加齐全,操作更加简便,可以在MC的吸附过程中考虑骨架的柔性,也可以想MUSIC一样先制作积分格点(music中的map)。 A、离线安装(centos为例): (1)、安装之前要检查一下是否装了automake,
javacs服务器的设计文档,java基于CS模式实现聊天程序(服务器).pdf
java基基于于C/S模模式式实实现现聊聊天天程程序序 ((服服务务器器))上篇介绍了java基于C/S模式实现聊天程序的客户端写法,这一篇介绍服务器的写法。服务器的功 是:接收来自客户端的消息,然后将消息转发给当前连接的所有用户。这里一个困扰我许久的地方是如何存储所有用户的地址 (套接字),找了许久我找到了一种变长数组的数据结构Vector,用size ()来获取长度,用add ()来添加元素,...
pagerank算法详解
目录一、pagerank定义两个重要假设二、pagerank算法公式定义计算演示矩阵化计算三、存在的两个问题问题1.Dead Ends问题2.Spider Traps 一、pagerank定义 入链数:指向该节点的链接数 出链数:由该节点指出的链接数 以上图为例:A的入链数为1,出链数为3,所以将由A指向其他节点的边权重设置为1/3,表示A访问B、C、D节点的概率均为1/3 两个重要假设 数量假设:在Web图模型中,如果一个页面节点接收到的其他网页指向的入链数量越多,那么这个页面越重要。 质量假设:指向
(最新更新!)2024全国大学生数学建模竞赛(国赛)B题决策优化+鲁棒模型完整建模全解全析
2024全国大学生数学建模竞赛(国赛)B题完整建模全解全析(已更新!)
java学习资源
想要加强你的编程能力吗?想要提升你的 Java 编程技巧和效率吗?不用担心。本文将会提供快速高效学习 Java 编程的 50 多个网站资源:开始探索吧:1、MKyong:许多开发者在这里可以找到带文字说明和图解的示例代码。这是一个探索各种框架的平台。不管是否用于商业使用,你都可以从这里下载免费的工具。前往 MKyong2、Programmingbydoing:包含超过 100 篇文章,对具有争议的问
HX720数据采集实战:从硬件连接到姿态解析(含避坑指南)
本文详细介绍了HX720高精度ADC芯片在数据采集与姿态解析项目中的实战应用。内容涵盖从硬件电路设计、驱动源码编写与优化,到原始数据处理、校准以及最终姿态角度计算的完整流程,并提供了关键的避坑指南和调试技巧,帮助开发者高效完成从传感器信号到可用姿态数据的转换。
保姆级教程:用IDEA反编译CobaltStrike 4.4,手把手教你修改默认端口和上线流量特征
本文提供了一份详细的CobaltStrike 4.4反编译与定制指南,涵盖从IDEA环境配置到流量特征混淆的完整流程。通过修改默认端口和动态生成校验值,有效规避检测,提升隐蔽性。特别适合需要深度定制CS工具的安全研究人员和红队成员。
littlefs系列:wear leveling
wear leveling的功能是通过block alloctor实现的。littlefs通过两个方法实现磨损均衡: 1) 检测和恢复bad blocks 2)通过dynamic blocks均衡磨损 检测和恢复bad blocks和block alloctor的关系并不紧密,主要依靠文件系统本身来检测坏块并标记。在littlefs中,检测坏块主要是通过写后回读并比较的方式实现的,如果数据不一致则说明是一个坏块。一旦检测到了坏块就要进行恢复。 如果是写入错误,因为数据才RAM中还有备份,因此需.
【Neo4j × Python】基于知识图谱的电影问答系统(含问题记录与解决)附:源代码(含Bug解决)
此前,曾介绍过Neo4j的一些基础知识,本篇将在PyCharm中与Neo4j建立关联,从0到1实现一个基于知识图谱的电影问答系统,实现过程中,没有一帆风顺,而是遇到了一些问题,因此也包含问题的记录与解决。
基于C/S模式的简单聊天程序(客户端篇)
经过这几天对java的学习,用java做了这个计算机网络的课程设计,基于C/S模式的简单聊天程序,此篇文章介绍一些客户端的一些东西。 先讲一讲此聊天程序的基本原理,客户端发送消息至服务器,服务器收到消息之后将其转发给连接服务器的所有客户端,来自客户端的消息中包含发件人的名字。 客户端的主要功能是发送消息和接收消息,客户端设置好了端口和服务器地址,并创立客户端自己的套接字,用作和服务器通信的一个标识
IgH EtherCAT 从入门到精通:第 4 章 网络设备驱动选型与配置
摘要:本章详细介绍了EtherCAT主站网络设备驱动的选型与配置。IgH EtherCAT Master提供Generic通用驱动和Native原生驱动两种方案:Generic驱动通过Linux Socket接口实现,兼容性强但实时性较差;Native驱动通过修改网卡驱动绕过内核协议栈,具有更低延迟和更小抖动。文章具体分析了e1000/e1000e/igb/igc等Intel网卡驱动以及r8169/8139too等Realtek驱动的配置方法,并提供了驱动选型建议。对于实时性要求高的场景,推荐使用Nativ
android 9.x 开机自动同步时间较慢(2~3分钟)
问题描述 不插sim卡,连接wifi启动,系统时间在2~3分钟之后才会同步到最新时间。 NITZ和NTP机制 在解决这个问题之前,让我们来学习一下NITZ和NTP的相关知识 NITZ:Network Identity and Time Zone(网络标识和时区),是一种用于自动配置本地的时间和日期的机制,需要运营商支持,可从运营商获取时间和时区具体信息。NITZ是自从PHASE 2+ RELEASE 96 的GSM中的可选功能,经常被用来自动更新移动电话的系统时钟。NITZ需要运营商网络支持(通过CS网络)
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
复分析 阿尔福斯(Ahlfors) 第三版答案 英文
答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案
高级教程分享:Dubbo+Zookeeper+ActiveMQ+Redis等。
image image image 这是个人收藏的Dubbo系列高级教程,包括Zookeeper、Redis、ActiveMQ等实战解析,现在分享出来,获取可在下方公众号中回复:视频 申明:本视频内容与本公众号无任何关系,仅供学习交流使用。 推荐阅读 2017年最新CS2...
老版QQ原生表情gif动态
这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。
AMQP:企业服务器通过 AMQP 接入物联网平台血泪史
一、基础 数据流向 需要创建设备的参考阿里云提供的官方文档 二、环境搭建 简单说一下搭建流程 ①、创建边缘实例和网关 参考https://help.aliyun.com/document_detail/102729.html?spm=a2c4g.11186623.6.561.119c71b8Mji3Oj ②、安装并启动Link IoT Edge 参考https://help.aliyun.com/document_detail/102729.html?spm=a2c4g.11186623.6.561.11
廖雪峰Python教程[完整版]
廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白
互联网面试题大全
互联网面试题大全 内容来源于网络,具体出处忘记了,今天在以前笔记整理出来 基本概念 操作系统中 heap 和 stack 的区别 https://www.jianshu.com/p/4cc13cb3aa9a 什么是基于注解的切面实现 什么是 对象/关系 映射集成模块 什么是 Java 的反射机制 http://baike.xsoftlab.net/view/209.html#1 什么是 AC...
837



被折叠的 条评论
为什么被折叠?



