【WY】数据处理 — Python 阶段一 :基础语法 三 —— 异常数据:处理

版权声明:本文为博主原创文章,未经博主允许不得转载。



一、异常数据

  • 异常值是指样本中的个别值,其数值明显偏离其余的观测值
  • 异常值也称离群点,异常值的分析也称为离群点的分析
  • 异常值分析 : 3σ原则 / 箱型图分析
  • 异常值处理方法 : 删除 / 修正填补
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy impor
1、异常值(outliers)检测综述:定义、检测方法、影响、修正 一、异常值定义   在数据科学项目、统计分析、机器学习应用中检测异常值非常重要;   异常值,也称离群值,是指样本中的个别值,其数值明显偏离所属样本的绝大部分观测值。   异常值可以分成两种:单变量(Univariate) 和多变量(Multivariate) 二、导致异常值的原因   两大类原因:人为原因(Non-natural) 和自然原因(Natural )。   人为原因(Non-natural):比如常见的数据输入错误、处理错误、抽样误差等   详细地了解各种类型的异常值: 数据输入错误:人 阅读详情

相关推荐

GigaBrain-0.7三系统架构解析:构建通用机器人控制大脑的ROS2实战

在机器人软件开发中,模块化与解耦是提升代码复用性和开发效率的核心原则。其基本原理在于通过清晰的接口定义,将复杂的系统划分为功能独立的子系统,从而降低模块间的耦合度。这一理念的技术价值在于,它使得算法逻辑与硬件实现分离,让开发者能够专注于上层应用创新,而非重复的底层适配工作。在机器人导航、自主控制等应用场景中,这种架构尤其重要,因为它允许同一套感知与决策算法快速部署到轮式、足式等不同形态的机器人平台上。GigaBrain-0.7提出的“三系统”架构正是这一思想的工程实践,它将机器人软件栈清晰地划分为感知与建模

weixin_34392435的博客 427

ROS数据管理避坑指南:从录制、检查到高效解包rosbag的完整工作流

本文详细介绍了ROS数据管理中rosbag的完整工作流,包括录制前的战略规划、数据验证与质量评估、智能解包与数据转换以及工程化集成方案。通过优化录制策略、自动化完整性检查和高性能解包技巧,帮助开发者避免常见数据问题,提升机器人研发与自动驾驶领域的数据处理效率。

weixin_30616969的博客 379

二维插值方法全解析:从原理到实战的九种方案选型指南

二维插值是一种基于已知离散数据点估算未知位置数值的基础技术,其核心原理是通过构建连续函数或曲面来拟合或逼近给定数据。从信号处理到科学计算,该技术为解决图像缩放、曲面重建、空间数据分析等工程问题提供了关键支撑。其技术价值在于,能够在数据缺失或不均匀的情况下,实现信息的连续化与可视化表达,直接影响结果的精度与视觉效果。在图像处理、地理信息系统、气象建模等应用场景中,不同的插值方法在平滑度、计算效率和数据适应性上各有侧重。例如,针对规则网格数据,双线性插值在速度与质量间取得了良好平衡,而双三次插值则能提供更平滑的

weixin_30416871的博客 419

数据处理之异常值分析、处理

异常值的分析方法 1、简单统计量分析 做一个描述性统计,进而查看哪些数据不合理。最常用的是最大值和最小值,如年龄的最大值199,则存在异常。 2、3σ原则 针对服从正态分布的数据, 3、箱形图分析(R语言) 首先,读取数据集,用sum(),mean()函数来分别获取缺失样本数、缺失比例。 saledata <- read.csv(file="catering_sale.c...

zjlamp的博客 1万+

触觉结合与使用(VTLA、RDP)

OmniVTA、RDP

boss-dog 136

PaddleOCR 3.x 最新版使用教程(2025)——从安装到实战身份证识别,一步到位!

本文针对PaddleOCR 3.x大版本更新带来的参数变化和兼容性问题,提供从环境配置到实际应用的全流程解决方案。

qq_58607032的博客 9786

多标签损失之Hamming Loss(PyTorch和sklearn)、Focal Loss、交叉熵和ASL损失

多标签损失

wuli_xin的博客 4461

用户视角下的vfsglobal预约困境:从注册到登录的全流程避坑指南

本文详细解析了vfsglobal签证预约系统从注册到登录的全流程操作,帮助用户避开常见技术陷阱。针对IP限制、DNS解析、浏览器缓存等登录障碍提供实用解决方案,并揭示账号管理的隐藏规则与支付环节的延时处理技巧,助力用户高效完成签证预约。

ol78901234的博客 871

阿里云习题多选部分459道

比如: UserA的用户在杭州有一台经典网络的ECS云服务器InstanceA (内网IP: A.A.A),InstanceA所属的默认安全组为GroupA, UserB的用户在杭州有一台经 典网络的ECS云服务器InstanceB(内网IP:B.B.B),InstanceB所属的默认安全组为GroupB。43.创建阿里云的云服务器ECS实例之前,需要对ECS实例的配置进行选型,阿里云为用户提供了推荐的配置组合方案来满足大部分用户的需求,这些推荐配置只是作为开始使用云服务器ECS实例的参考。

2501_91384465的博客 1309

Unity UGUI深度优化

Unity UGUI优化相关

不定时分享所学所得,包括游戏开发和其他收获! 2717

WVP-GB28181-Pro配置避坑指南:从零到上线全流程详解(含ZLM自动同步技巧)

本文详细解析了WVP-GB28181-Pro视频平台的配置流程,特别针对国标视频平台部署中的常见陷阱,如stream-ip/sdp-ip配置错误、ZLM自动同步问题及端口冲突等,提供了实用的解决方案和优化建议,帮助开发者快速实现从零到上线的全流程部署。

weixin_30836759的博客 93

Nginx反向代理MinIO私有桶签名失效?一招解决Host头校验问题

本文详细解析了Nginx反向代理MinIO私有桶时出现的签名失效问题,重点解决了Host头校验导致的"SignatureDoesNotMatch"错误。通过精准配置proxy_set_header保持Host头一致性,并提供了二级目录代理和调试指南,帮助开发者高效解决这一常见技术难题。

weixin_29201313的博客 321

图像去模糊(二)——Richardson–Lucy算法

Richardson Lucy Algorithm(Richardson-Lucy算法详解及效果实例)

xueruhongchen的博客 3万+

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

深度学习工具包 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")

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

上一篇: 【WY】数据处理 — Python 阶段一 :基础语法 二 —— 缺失数据:处理
下一篇: 【WY】数据处理 — Python 阶段一 :基础语法 一 —— 特征分析:对比分析
InitialHeart2021
博客等级 码龄5年 49粉丝 182原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

InitialHeart2021

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值