13、Julia 数据可视化:统计绘图全解析

Julia 数据可视化:统计绘图全解析

1. Makie 的图形代数

AlgebraOfGraphics 是 Julia 中实现图形语法的一个包,它借助 Makie 进行绘图。因此,使用时需要加载一个 Makie 后端,如 CairoMakie。图形代数语法的主要组成部分如下:
- 数据(Data) : data 函数指定要使用的数据集。
- 映射(Mapping) : AlgebraOfGraphics 使用 mapping 函数来表示数据变量和美学属性之间的映射关系。前三个位置参数指定映射到 x、y 和 z 位置的变量,还可以使用关键字参数映射其他美学属性,如颜色和标记大小,同时该函数支持使用对语法进行数据转换。
- 可视化(Visual) :类似于其他图形语法实现中的几何图形,它指定要创建的图形类型。 AlgebraOfGraphics 使用 visual 函数以驼峰命名法指定 Makie 图形类型,例如 Scatter 或 BoxPlot 。
- 分析(Analyses) :即该图形语法中的统计信息。

在图形代数中, Layer 是主要构建块,表示一个绘图规范。可以通过组合上述组件创建一个图层,并且允许对规范执行代数运算,使用 * 运算符

相关推荐

Julia语言绘图实战:从基础到Julia集可视化

Julia语言采用多分派(multiple dispatch)机制,使函数行为可根据参数类型动态选择,极大提升了数值计算的表达力与扩展性。其基于LLVM的即时编译(JIT)技术,使代码执行效率接近C语言水平,同时保留了脚本语言的简洁语法。例如:z = 0endend该复数迭代函数在无需类型声明的情况下仍能高效运行,体现Julia对数学运算的天然支持。主题(theme)是一组预设的样式集合,可用于统一整个项目的视觉风格。Plots.jl 内建defaultdarkggplot2。

weixin_36235398的博客 1023

运算放大器多谐振荡器设计实战:从施密特触发器到波形生成

本文详细介绍了运算放大器在多谐振荡器设计中的实战应用,涵盖施密特触发器的迟滞比较原理、非稳态振荡器的自激机制以及单稳态和双稳态电路的设计技巧。通过具体案例和参数计算,帮助工程师掌握波形生成与信号处理的核心技术,提升电路设计效率与稳定性。

pz89012345的博客 217

泛微ecology9 利用字段值动态控制明细表显示与隐藏

本文详细介绍了在泛微ecology9中,如何利用WfForm.bindFieldChangeEvent监听字段变化,结合jQuery动态控制明细表显示与隐藏的实战方法。通过五步操作,可实现根据字段值(如报销类型)智能切换明细表,提升表单交互体验与开发效率,并确保PC与移动端完美兼容。

7z8x2c4v6b9的博客 585

【Maxwell16.0】实战指南:从DXF导入到MotorCAD联合仿真的关键技巧

本文详细解析了Maxwell 16.0与MotorCAD进行联合仿真的核心流程与关键技巧。重点阐述了从DXF模型导入、几何修复、一极一槽模型剪裁,到坐标系对齐、MotorCAD参数匹配及结果验证的全过程,旨在帮助工程师高效打通联合仿真链路,规避常见错误,提升电机设计效率。

weixin_29062865的博客 712

谷粒商城学习笔记-15-数据库初始化

这一节的主要内容是把创建对应的数据库和数据库表。

epitomizelu的专栏 1438

麒麟操作系统安装达梦数据库ARM版

Linux安装达梦数据库ARM版

运维@小兵的博客 8767

10、利用智能合约实现公平的私有集合交集

本文探讨了利用智能合约实现公平的私有集合交集(PSI)的多种协议,重点分析了协议 Π 和 Π∗ 的气体成本与性能特点。同时对比了包括 Justitia 和 Anesidora 在内的现有方案,突出了仅使用智能合约实现硬币补偿公平性的优势。文中还介绍了相关密码学基础、安全模型及隐私保障机制,为在不同应用场景下选择高效、安全的 PSI 协议提供了理论支持和实践指导。

linux的博客 94

大模型测试人员完整学习体系(分层成长路线 + 知识框架 + 落地实操)

本文系统构建了大模型测试工程师的4级能力成长体系:L1(测试执行)-L2(专项测试)-L3(质量体系)-L4(行业标准),详细拆解了每个阶段的核心技能图谱。重点包括:入门层需掌握传统测试基础和大模型产品逻辑;进阶层需精通Prompt用例设计、RAG测试、安全对齐、自动化评测等专项能力;高级层聚焦评测平台搭建与质量体系建设;专家层深入算法对齐与行业标准制定。文章配套提供了分阶段技术工具栈、3-12个月学习路径及5类实战项目建议,形成了一套完整的大模型测试人才能力培养框架。

SmallBull的博客 451

十一、Cadence ic 617以及assura使用总结

1.617的端口和514不同,没有网络属性,使用时不能直接放在原理图上,如果要直接放在图上要接线并且放上标签。2.617的端口也不能直接放在线上,514中将端口直接放在线上是可以使端口和线连接,但617看似连接,但拉出来线没有交点,实际上没有连接。这里set switches里的选项表示不同的模块,也就是选择一个就只对这一部分进行DRC验证,要验证整个版图的DRC就要把所有的选项选中,然后一个个改正。LVS中也是一样,要全部选中改正。

0 2294

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

深度学习工具包 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');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 29、晶圆表面缺陷模式识别与民航旅客问题意图识别研究
下一篇: 27、基于GAN和机器学习的音频驱动人工视频人脸合成及电梯交通系统MATLAB仿真
git9versioner
博客等级 码龄4年 74粉丝 1650原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值