SlideShare a Scribd company logo
UNIT II : DATA Processing and Analytics
By
Mr.S.Selvaraj, AP(SRG) / CSD
Ms. K. Jothimani, AP / CSD
Kongu Engineering College
Perundurai, Erode, Tamilnadu, India
20VA028 – IMAGE PROCESSING WITH
MATLB
Thanks to and Resource from : Carl Hamacher, Zvonko Vranesic, Safwat Zaky, Naraig Manjikian, “Computer Organization and Embedded Systems”, McGraw Hill Education; 6th edition, 2017
Unit Wise Syllabus – CO
11/18/2022 Unit 2: Data Processing and Analytics 2
What is Table?
11/18/2022 Unit 2: Data Processing and Analytics 3
11/18/2022 Unit 2: Data Processing and Analytics 4
Import Data
11/18/2022 Unit 2: Data Processing and Analytics 5
Summary of Table
11/18/2022 Unit 2: Data Processing and Analytics 6
Plotting Lat and Lon Data
11/18/2022 Unit 2: Data Processing and Analytics 7
11/18/2022 Unit 2: Data Processing and Analytics 8
11/18/2022 Unit 2: Data Processing and Analytics 9
11/18/2022 Unit 2: Data Processing and Analytics 10
Set Text Type as String
11/18/2022 Unit 2: Data Processing and Analytics 11
EPL = readtable("EPLresults.csv","TextType","string")
table() function
• You can organize your workspace variables
into a table with the table function.
• The following code creates a table, data with
variables a, b, and c.
– data = table(a,b,c)
11/18/2022 Unit 2: Data Processing and Analytics 12
Array2table() function
• You can use the array2table function to
convert a matrix to a table.
• The following code creates a table named data
from a matrix, A.
– data = array2table(A)
11/18/2022 Unit 2: Data Processing and Analytics 13
Example
11/18/2022 Unit 2: Data Processing and Analytics 14
create custom variable names
• create custom variable names in the table,
follow the variable input with the property
VariableNames and a string array of text.
• The following code creates a table named data
with custom variable names, X and Y..
– data = array2table(A,... "VariableNames",["X"
"Y"])
11/18/2022 Unit 2: Data Processing and Analytics 15
• You can sort a table on a specific variable
using the sortrows function.
– tSort= sortrows(tableName,... "SortingVariable")
• To put the top teams at the top of the table,
you need to sort in descending order.
• You can use the "descend" option to sort in
descending order.
– tSort = sortrows(tableName,...
"SortingVariable","descend")
11/18/2022 Unit 2: Data Processing and Analytics 16
• To sort by a second variables, supply them in
order to the sortrows function as a string
array.
– tSort = sortrows(tableName,... ["var1"
"var2"],"descend")
11/18/2022 Unit 2: Data Processing and Analytics 17
Getting Data into MATLAB
• You can use the Import Tool to import many types of data
interactively.
• In MATLAB, you can interactively import data files having several
formats such as: TXT, CSV, XLS, XLSX, JPG, PNG, etc.
• In this lesson, you will load, modify, save and clear data in MATLAB.
11/18/2022 Unit 2: Data Processing and Analytics 18
Getting Data into MATLAB
• In the Import Tool, you need to do three things:
1. Select the data to load. The cells that will be loaded are highlighted.
Yellow shading means there is a missing value, which will be
imported as NaN, or not-a-number.
2. Specify how you want to load the dataset. Should it be a table, a set
of column vectors, a matrix, or text data?
3. Click Import Selection when you are ready.
11/18/2022 Unit 2: Data Processing and Analytics 19
Importing Data with the Import Tool
• You can import gasprices.csv as a matrix using the Import
Tool in three steps.
1. Select the cells with gas prices. Here they are shaded.
2. Change the Output Type to Numeric Matrix.
3. Click Import Selection.
11/18/2022 Unit 2: Data Processing and Analytics 20
Extracting Part of an Array
• The data is currently all stored in a single array.
• The first column represents the years; the remaining columns are the
prices.
• You can interactively extract parts of an array by clicking and dragging to
select elements, right-clicking to bring up the context menu, then
selecting New Variable from Selection.
• This creates a new variable with a default name. You can rename variables
in the Workspace by right-clicking and selecting Rename from the context
menu.
11/18/2022 Unit 2: Data Processing and Analytics 21
Save variables to a MAT - file
• You can use the save command to save variables to a MAT-file.
• >> save fileName
• >> save fileName var1 var2
• These commands both save variables in the workspace to a MAT-
file named fileName.mat.
• The first command saves all variables currently in the workspace.
The second saves only var1 and var2.
11/18/2022 Unit 2: Data Processing and Analytics 22
Extracting Portions of a Table
11/18/2022 Unit 2: Data Processing and Analytics 23
11/18/2022 Unit 2: Data Processing and Analytics 24
• EPL =readtable("EPLresults.csv","TextType","string");
• EPL = sortrows(EPL,["HomeWins“ "AwayWins"],"descend")
11/18/2022 Unit 2: Data Processing and Analytics 25
Example
• You can create a subset of the original table using
regular array indexing with parentheses.
• winningTeams = EPL(1:4,1)
• winningTeams =
Team
___________________
"Leicester City"
"Arsenal"
"Manchester City"
"Manchester United"
11/18/2022 Unit 2: Data Processing and Analytics 26
What will be the Result?
• A = EPL(1:6,:)
• B = EPL(:,[1 2 7])
• C = EPL(2:4,[1 2 3 7 8])
• D = EPL([1:4 18],[1 2 3 7 8])
• E = EPL([18 4:-1:1],:)
11/18/2022 Unit 2: Data Processing and Analytics 27
Index using Variable Name
• When indexing into a table, it's often easier to
remember a variable name as opposed to
figuring out the specific column number.
• So, as an alternative to numeric indexing, you
can index using the variable name in double
quotes.
• hmWins = EPL(:,"HomeWins");
11/18/2022 Unit 2: Data Processing and Analytics 28
Select Multiple Variables
• It would be easier to compare the home goals
for if the team names were included.
• You can select multiple variables by name
using a string vector of variable names as
input.
• wins = EPL(:,["HomeWins" "AwayWins"]);
11/18/2022 Unit 2: Data Processing and Analytics 29
Indexing by Number and Name
• You can also index into a table using a
combination of indexing by number and
name.
• fhw = EPL(2:2:8,["Team" "HomeWins"]);
11/18/2022 Unit 2: Data Processing and Analytics 30
Specialized data
• When you use readtable to bring your data into
MATLAB, dates are often automatically detected
and brought in as datetime arrays.
• A datetime array makes date and time data
easier to work with, because many functions are
designed to handle them, such as sortrows and
plot.
• For instance, if you tried to sort dates stored in a
string array, the sorting would be alphabetical.
• December would come before January, and you
probably meant to sort chronologically.
11/18/2022 Unit 2: Data Processing and Analytics 31
11/18/2022 Unit 2: Data Processing and Analytics 32
Data Types for Date and Time
11/18/2022 Unit 2: Data Processing and Analytics 33
11/18/2022 Unit 2: Data Processing and Analytics 34
MATLAB Functions
11/18/2022 Unit 2: Data Processing and Analytics 35
datetime
11/18/2022 Unit 2: Data Processing and Analytics 36
11/18/2022 Unit 2: Data Processing and Analytics 37
duration variable
11/18/2022 Unit 2: Data Processing and Analytics 38
Additional functions
• sortrows()
• cumsum()
11/18/2022 Unit 2: Data Processing and Analytics 39
Create datetime
• seasonStart = datetime(2015,8,8)
• seasonEnd = datetime(2016,5,17)
• seasonLength = seasonEnd - seasonStart
11/18/2022 Unit 2: Data Processing and Analytics 40
Convert HH:MM:SS into days
• The returned length of time value is called a
duration and is given in hours.
• You can convert this to a more readable
number, like days, using the days function.
• seasonLength = days(seasonLength)
11/18/2022 Unit 2: Data Processing and Analytics 41
Output in days
• The returned value is now a number rather
than a duration. The days function will convert
the input value from a duration to a number
or vice versa depending on the input.
• seasonLength = days(seasonLength)
11/18/2022 Unit 2: Data Processing and Analytics 42
11/18/2022 Unit 2: Data Processing and Analytics 43
Preprocessing Data
11/18/2022 Unit 2: Data Processing and Analytics 44
11/18/2022 Unit 2: Data Processing and Analytics 45
11/18/2022 Unit 2: Data Processing and Analytics 46
11/18/2022 Unit 2: Data Processing and Analytics 47
11/18/2022 Unit 2: Data Processing and Analytics 48
11/18/2022 Unit 2: Data Processing and Analytics 49
Three Option on Missing Values
11/18/2022 Unit 2: Data Processing and Analytics 50
11/18/2022 Unit 2: Data Processing and Analytics 51
11/18/2022 Unit 2: Data Processing and Analytics 52
11/18/2022 Unit 2: Data Processing and Analytics 53
MATLAB Data Preprocessing Functions
11/18/2022 Unit 2: Data Processing and Analytics 54
normalize()
• One of the most common ways to normalize data
is to shift it so that it's mean is centered on zero
(i.e. the data has zero mean) and scale the data
so that it's standard deviation is one.
• This is called the z-score of the data.
• To normalize data using z-scores, you can use the
normalize function.
– xNorm = normalize(X)
• By default, normalize acts on the columns of
array X
11/18/2022 Unit 2: Data Processing and Analytics 55
isnan ()
• Instead of ==, you can use the isnan function
to identify NaN values. The isnan function
takes an array as input and returns a logical
array of the same size.
11/18/2022 Unit 2: Data Processing and Analytics 56
ismissing()
• The isnan function is used to identify missing
values in numeric data types, where missing
values are denoted as NaN values.
• The ismissing function is more general and
identifies missing values in other data types as
well.
11/18/2022 Unit 2: Data Processing and Analytics 57
nnz()
• Remember, that the nnz function counts the
number of non-zero elements in a logical
array.
11/18/2022 Unit 2: Data Processing and Analytics 58
omitnan
• Some functions allow you to skip, or ignore,
missing data.
• For instance, the mean and prod functions
accept the "omitnan" flag.
– mean(v,"omitnan")
11/18/2022 Unit 2: Data Processing and Analytics 59
• Sometimes a missing value has a specific
meaning, like 0 measurement.
• You can use the logical vector that identifies
missing data to access and change them.
– data(idxMissing)=42
– idx = ismissing(x,[NaN -999])
11/18/2022 Unit 2: Data Processing and Analytics 60

More Related Content

Similar to UNIT 2 _ Data Processing and Aanalytics.pptx

MySQL performance tuning
MySQL performance tuningMySQL performance tuning
MySQL performance tuning
Anurag Srivastava
 
K Means Clustering Algorithm for Partitioning Data Sets Evaluated From Horizo...
K Means Clustering Algorithm for Partitioning Data Sets Evaluated From Horizo...K Means Clustering Algorithm for Partitioning Data Sets Evaluated From Horizo...
K Means Clustering Algorithm for Partitioning Data Sets Evaluated From Horizo...
IOSR Journals
 
Mat189: Cluster Analysis with NBA Sports Data
Mat189: Cluster Analysis with NBA Sports DataMat189: Cluster Analysis with NBA Sports Data
Mat189: Cluster Analysis with NBA Sports Data
KathleneNgo
 
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_II_08-08-2022_D...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_II_08-08-2022_D...FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_II_08-08-2022_D...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_II_08-08-2022_D...
AntareepMajumder
 
Python-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptxPython-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptx
Sandeep Singh
 
Python for Data Analysis.pdf
Python for Data Analysis.pdfPython for Data Analysis.pdf
Python for Data Analysis.pdf
JulioRecaldeLara1
 
Python-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptxPython-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptx
tangadhurai
 
A Hacking Toolset for Big Tabular Files (3)
A Hacking Toolset for Big Tabular Files (3)A Hacking Toolset for Big Tabular Files (3)
A Hacking Toolset for Big Tabular Files (3)
Toshiyuki Shimono
 
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory optionStar Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Franck Pachot
 
IC2IT 2013 Presentation
IC2IT 2013 PresentationIC2IT 2013 Presentation
IC2IT 2013 Presentation
Chittagong Independent University
 
IC2IT 2013 Presentation
IC2IT 2013 PresentationIC2IT 2013 Presentation
IC2IT 2013 Presentation
Chittagong Independent University
 
Dimensionality Reduction and feature extraction.pptx
Dimensionality Reduction and feature extraction.pptxDimensionality Reduction and feature extraction.pptx
Dimensionality Reduction and feature extraction.pptx
Sivam Chinna
 
Python-for-Data-Analysis.pdf
Python-for-Data-Analysis.pdfPython-for-Data-Analysis.pdf
Python-for-Data-Analysis.pdf
ssuser598883
 
Python for data analysis
Python for data analysisPython for data analysis
Python for data analysis
Savitribai Phule Pune University
 
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
NAVER Engineering
 
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
Citus Data
 
AlgorithmsModelsNov13.pptx
AlgorithmsModelsNov13.pptxAlgorithmsModelsNov13.pptx
AlgorithmsModelsNov13.pptx
PerumalPitchandi
 
Machine Learning, K-means Algorithm Implementation with R
Machine Learning, K-means Algorithm Implementation with RMachine Learning, K-means Algorithm Implementation with R
Machine Learning, K-means Algorithm Implementation with R
IRJET Journal
 
20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf
MariaKhan905189
 
Clementine tool
Clementine toolClementine tool
Clementine tool
JAINAM KAPADIYA
 

Similar to UNIT 2 _ Data Processing and Aanalytics.pptx (20)

MySQL performance tuning
MySQL performance tuningMySQL performance tuning
MySQL performance tuning
 
K Means Clustering Algorithm for Partitioning Data Sets Evaluated From Horizo...
K Means Clustering Algorithm for Partitioning Data Sets Evaluated From Horizo...K Means Clustering Algorithm for Partitioning Data Sets Evaluated From Horizo...
K Means Clustering Algorithm for Partitioning Data Sets Evaluated From Horizo...
 
Mat189: Cluster Analysis with NBA Sports Data
Mat189: Cluster Analysis with NBA Sports DataMat189: Cluster Analysis with NBA Sports Data
Mat189: Cluster Analysis with NBA Sports Data
 
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_II_08-08-2022_D...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_II_08-08-2022_D...FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_II_08-08-2022_D...
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_II_08-08-2022_D...
 
Python-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptxPython-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptx
 
Python for Data Analysis.pdf
Python for Data Analysis.pdfPython for Data Analysis.pdf
Python for Data Analysis.pdf
 
Python-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptxPython-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptx
 
A Hacking Toolset for Big Tabular Files (3)
A Hacking Toolset for Big Tabular Files (3)A Hacking Toolset for Big Tabular Files (3)
A Hacking Toolset for Big Tabular Files (3)
 
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory optionStar Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
Star Transformation, 12c Adaptive Bitmap Pruning and In-Memory option
 
IC2IT 2013 Presentation
IC2IT 2013 PresentationIC2IT 2013 Presentation
IC2IT 2013 Presentation
 
IC2IT 2013 Presentation
IC2IT 2013 PresentationIC2IT 2013 Presentation
IC2IT 2013 Presentation
 
Dimensionality Reduction and feature extraction.pptx
Dimensionality Reduction and feature extraction.pptxDimensionality Reduction and feature extraction.pptx
Dimensionality Reduction and feature extraction.pptx
 
Python-for-Data-Analysis.pdf
Python-for-Data-Analysis.pdfPython-for-Data-Analysis.pdf
Python-for-Data-Analysis.pdf
 
Python for data analysis
Python for data analysisPython for data analysis
Python for data analysis
 
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
 
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
 
AlgorithmsModelsNov13.pptx
AlgorithmsModelsNov13.pptxAlgorithmsModelsNov13.pptx
AlgorithmsModelsNov13.pptx
 
Machine Learning, K-means Algorithm Implementation with R
Machine Learning, K-means Algorithm Implementation with RMachine Learning, K-means Algorithm Implementation with R
Machine Learning, K-means Algorithm Implementation with R
 
20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf
 
Clementine tool
Clementine toolClementine tool
Clementine tool
 

Recently uploaded

一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
v7oacc3l
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
Timothy Spann
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
y3i0qsdzb
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
AndrzejJarynowski
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
jitskeb
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
SaffaIbrahim1
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
AlessioFois2
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
vikram sood
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
a9qfiubqu
 
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens""Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
sameer shah
 
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
taqyea
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 

Recently uploaded (20)

一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
一比一原版巴斯大学毕业证(Bath毕业证书)学历如何办理
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
 
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens""Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
"Financial Odyssey: Navigating Past Performance Through Diverse Analytical Lens"
 
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 

UNIT 2 _ Data Processing and Aanalytics.pptx

  • 1. UNIT II : DATA Processing and Analytics By Mr.S.Selvaraj, AP(SRG) / CSD Ms. K. Jothimani, AP / CSD Kongu Engineering College Perundurai, Erode, Tamilnadu, India 20VA028 – IMAGE PROCESSING WITH MATLB Thanks to and Resource from : Carl Hamacher, Zvonko Vranesic, Safwat Zaky, Naraig Manjikian, “Computer Organization and Embedded Systems”, McGraw Hill Education; 6th edition, 2017
  • 2. Unit Wise Syllabus – CO 11/18/2022 Unit 2: Data Processing and Analytics 2
  • 3. What is Table? 11/18/2022 Unit 2: Data Processing and Analytics 3
  • 4. 11/18/2022 Unit 2: Data Processing and Analytics 4
  • 5. Import Data 11/18/2022 Unit 2: Data Processing and Analytics 5
  • 6. Summary of Table 11/18/2022 Unit 2: Data Processing and Analytics 6
  • 7. Plotting Lat and Lon Data 11/18/2022 Unit 2: Data Processing and Analytics 7
  • 8. 11/18/2022 Unit 2: Data Processing and Analytics 8
  • 9. 11/18/2022 Unit 2: Data Processing and Analytics 9
  • 10. 11/18/2022 Unit 2: Data Processing and Analytics 10
  • 11. Set Text Type as String 11/18/2022 Unit 2: Data Processing and Analytics 11 EPL = readtable("EPLresults.csv","TextType","string")
  • 12. table() function • You can organize your workspace variables into a table with the table function. • The following code creates a table, data with variables a, b, and c. – data = table(a,b,c) 11/18/2022 Unit 2: Data Processing and Analytics 12
  • 13. Array2table() function • You can use the array2table function to convert a matrix to a table. • The following code creates a table named data from a matrix, A. – data = array2table(A) 11/18/2022 Unit 2: Data Processing and Analytics 13
  • 14. Example 11/18/2022 Unit 2: Data Processing and Analytics 14
  • 15. create custom variable names • create custom variable names in the table, follow the variable input with the property VariableNames and a string array of text. • The following code creates a table named data with custom variable names, X and Y.. – data = array2table(A,... "VariableNames",["X" "Y"]) 11/18/2022 Unit 2: Data Processing and Analytics 15
  • 16. • You can sort a table on a specific variable using the sortrows function. – tSort= sortrows(tableName,... "SortingVariable") • To put the top teams at the top of the table, you need to sort in descending order. • You can use the "descend" option to sort in descending order. – tSort = sortrows(tableName,... "SortingVariable","descend") 11/18/2022 Unit 2: Data Processing and Analytics 16
  • 17. • To sort by a second variables, supply them in order to the sortrows function as a string array. – tSort = sortrows(tableName,... ["var1" "var2"],"descend") 11/18/2022 Unit 2: Data Processing and Analytics 17
  • 18. Getting Data into MATLAB • You can use the Import Tool to import many types of data interactively. • In MATLAB, you can interactively import data files having several formats such as: TXT, CSV, XLS, XLSX, JPG, PNG, etc. • In this lesson, you will load, modify, save and clear data in MATLAB. 11/18/2022 Unit 2: Data Processing and Analytics 18
  • 19. Getting Data into MATLAB • In the Import Tool, you need to do three things: 1. Select the data to load. The cells that will be loaded are highlighted. Yellow shading means there is a missing value, which will be imported as NaN, or not-a-number. 2. Specify how you want to load the dataset. Should it be a table, a set of column vectors, a matrix, or text data? 3. Click Import Selection when you are ready. 11/18/2022 Unit 2: Data Processing and Analytics 19
  • 20. Importing Data with the Import Tool • You can import gasprices.csv as a matrix using the Import Tool in three steps. 1. Select the cells with gas prices. Here they are shaded. 2. Change the Output Type to Numeric Matrix. 3. Click Import Selection. 11/18/2022 Unit 2: Data Processing and Analytics 20
  • 21. Extracting Part of an Array • The data is currently all stored in a single array. • The first column represents the years; the remaining columns are the prices. • You can interactively extract parts of an array by clicking and dragging to select elements, right-clicking to bring up the context menu, then selecting New Variable from Selection. • This creates a new variable with a default name. You can rename variables in the Workspace by right-clicking and selecting Rename from the context menu. 11/18/2022 Unit 2: Data Processing and Analytics 21
  • 22. Save variables to a MAT - file • You can use the save command to save variables to a MAT-file. • >> save fileName • >> save fileName var1 var2 • These commands both save variables in the workspace to a MAT- file named fileName.mat. • The first command saves all variables currently in the workspace. The second saves only var1 and var2. 11/18/2022 Unit 2: Data Processing and Analytics 22
  • 23. Extracting Portions of a Table 11/18/2022 Unit 2: Data Processing and Analytics 23
  • 24. 11/18/2022 Unit 2: Data Processing and Analytics 24
  • 25. • EPL =readtable("EPLresults.csv","TextType","string"); • EPL = sortrows(EPL,["HomeWins“ "AwayWins"],"descend") 11/18/2022 Unit 2: Data Processing and Analytics 25
  • 26. Example • You can create a subset of the original table using regular array indexing with parentheses. • winningTeams = EPL(1:4,1) • winningTeams = Team ___________________ "Leicester City" "Arsenal" "Manchester City" "Manchester United" 11/18/2022 Unit 2: Data Processing and Analytics 26
  • 27. What will be the Result? • A = EPL(1:6,:) • B = EPL(:,[1 2 7]) • C = EPL(2:4,[1 2 3 7 8]) • D = EPL([1:4 18],[1 2 3 7 8]) • E = EPL([18 4:-1:1],:) 11/18/2022 Unit 2: Data Processing and Analytics 27
  • 28. Index using Variable Name • When indexing into a table, it's often easier to remember a variable name as opposed to figuring out the specific column number. • So, as an alternative to numeric indexing, you can index using the variable name in double quotes. • hmWins = EPL(:,"HomeWins"); 11/18/2022 Unit 2: Data Processing and Analytics 28
  • 29. Select Multiple Variables • It would be easier to compare the home goals for if the team names were included. • You can select multiple variables by name using a string vector of variable names as input. • wins = EPL(:,["HomeWins" "AwayWins"]); 11/18/2022 Unit 2: Data Processing and Analytics 29
  • 30. Indexing by Number and Name • You can also index into a table using a combination of indexing by number and name. • fhw = EPL(2:2:8,["Team" "HomeWins"]); 11/18/2022 Unit 2: Data Processing and Analytics 30
  • 31. Specialized data • When you use readtable to bring your data into MATLAB, dates are often automatically detected and brought in as datetime arrays. • A datetime array makes date and time data easier to work with, because many functions are designed to handle them, such as sortrows and plot. • For instance, if you tried to sort dates stored in a string array, the sorting would be alphabetical. • December would come before January, and you probably meant to sort chronologically. 11/18/2022 Unit 2: Data Processing and Analytics 31
  • 32. 11/18/2022 Unit 2: Data Processing and Analytics 32
  • 33. Data Types for Date and Time 11/18/2022 Unit 2: Data Processing and Analytics 33
  • 34. 11/18/2022 Unit 2: Data Processing and Analytics 34
  • 35. MATLAB Functions 11/18/2022 Unit 2: Data Processing and Analytics 35
  • 36. datetime 11/18/2022 Unit 2: Data Processing and Analytics 36
  • 37. 11/18/2022 Unit 2: Data Processing and Analytics 37
  • 38. duration variable 11/18/2022 Unit 2: Data Processing and Analytics 38
  • 39. Additional functions • sortrows() • cumsum() 11/18/2022 Unit 2: Data Processing and Analytics 39
  • 40. Create datetime • seasonStart = datetime(2015,8,8) • seasonEnd = datetime(2016,5,17) • seasonLength = seasonEnd - seasonStart 11/18/2022 Unit 2: Data Processing and Analytics 40
  • 41. Convert HH:MM:SS into days • The returned length of time value is called a duration and is given in hours. • You can convert this to a more readable number, like days, using the days function. • seasonLength = days(seasonLength) 11/18/2022 Unit 2: Data Processing and Analytics 41
  • 42. Output in days • The returned value is now a number rather than a duration. The days function will convert the input value from a duration to a number or vice versa depending on the input. • seasonLength = days(seasonLength) 11/18/2022 Unit 2: Data Processing and Analytics 42
  • 43. 11/18/2022 Unit 2: Data Processing and Analytics 43
  • 44. Preprocessing Data 11/18/2022 Unit 2: Data Processing and Analytics 44
  • 45. 11/18/2022 Unit 2: Data Processing and Analytics 45
  • 46. 11/18/2022 Unit 2: Data Processing and Analytics 46
  • 47. 11/18/2022 Unit 2: Data Processing and Analytics 47
  • 48. 11/18/2022 Unit 2: Data Processing and Analytics 48
  • 49. 11/18/2022 Unit 2: Data Processing and Analytics 49
  • 50. Three Option on Missing Values 11/18/2022 Unit 2: Data Processing and Analytics 50
  • 51. 11/18/2022 Unit 2: Data Processing and Analytics 51
  • 52. 11/18/2022 Unit 2: Data Processing and Analytics 52
  • 53. 11/18/2022 Unit 2: Data Processing and Analytics 53
  • 54. MATLAB Data Preprocessing Functions 11/18/2022 Unit 2: Data Processing and Analytics 54
  • 55. normalize() • One of the most common ways to normalize data is to shift it so that it's mean is centered on zero (i.e. the data has zero mean) and scale the data so that it's standard deviation is one. • This is called the z-score of the data. • To normalize data using z-scores, you can use the normalize function. – xNorm = normalize(X) • By default, normalize acts on the columns of array X 11/18/2022 Unit 2: Data Processing and Analytics 55
  • 56. isnan () • Instead of ==, you can use the isnan function to identify NaN values. The isnan function takes an array as input and returns a logical array of the same size. 11/18/2022 Unit 2: Data Processing and Analytics 56
  • 57. ismissing() • The isnan function is used to identify missing values in numeric data types, where missing values are denoted as NaN values. • The ismissing function is more general and identifies missing values in other data types as well. 11/18/2022 Unit 2: Data Processing and Analytics 57
  • 58. nnz() • Remember, that the nnz function counts the number of non-zero elements in a logical array. 11/18/2022 Unit 2: Data Processing and Analytics 58
  • 59. omitnan • Some functions allow you to skip, or ignore, missing data. • For instance, the mean and prod functions accept the "omitnan" flag. – mean(v,"omitnan") 11/18/2022 Unit 2: Data Processing and Analytics 59
  • 60. • Sometimes a missing value has a specific meaning, like 0 measurement. • You can use the logical vector that identifies missing data to access and change them. – data(idxMissing)=42 – idx = ismissing(x,[NaN -999]) 11/18/2022 Unit 2: Data Processing and Analytics 60