SlideShare a Scribd company logo
1 of 16
Download to read offline
PyClustering: BANG Tutorial
Pyclustering Library Tutorial
Theme: BANG
Library Version: 0.8.2
Author: Andrei Novikov
E-Mail: pyclustering@yandex.ru
Agenda
● PyClustering BANG Features;
● Input format for BANG;
● Data clustering using BANG;
● Data clustering result visualization;
● Animation of BANG clustering process;
● Image segmentation by BANG;
PyClustering BANG Features
● BANG algorithm provides clustering results that can be
used for further analysis (not only clusters and noise itself):
dendrogram, BANG directory - information about density
distribution, structure, approximate amount of real clusters
and influence of input argument on clustering results.
● BANG visualizer for clustering results, BANG directory and
dendrogram.
● BANG animator for creating animation of BANG clustering
process.
Import BANG
BANG algorithm and its features can be imported from
„pyclustering.cluster.bang“:
from pyclustering.cluster.bang import bang
from pyclustering.cluster.bang import bang_directory
from pyclustering.cluster.bang import bang_visualizer
from pyclustering.cluster.bang import bang_animator
Input data format for BANG
BANG algorithm uses array_like data format, for example,
list where each element is a point that is represented by
coordinates. Here is an example of 1-D data:
dataset = [ [0.25], [0.43], [1.34], [-0.56] ]
Example of 2-D data:
dataset = [ [0.1, 0.2], [0.1, 0.6], [0.2, -1.4] ]
Example of 3-D data:
dataset = [ [0.6, 0.1, 0.4], [0.2, 0.1, 0.9] ]
Clustering by BANG algorithm
BANG uses one general parameter for clustering: level of
division that technically means amount of BANG tree hight
where root is a cell that covers whole data.
from pyclustering.cluster.bang import bang
data = [ [0.1], [0.2], [0.5], [0.3], [1.5], [1.8], [1.3], [1.6], [1.5] ]
levels = 3
instance = bang(data, levels)
instance.process() # perform processing
clusters = instance.get_clusters(); # allocated clusters
noise = instance.get_noise(); # cluster noise
directory = instance.get_directory(); # BANG directory
dendrogram = instance.get_dendrogram() # BANG dendrogram
Output result of BANG
BANG algorithm returns allocated clusters, outliers (noise),
BANG directory and dendrogram:
● Clusters are represented by list of clusters and each cluster
contains object indexes from dataset.
● Outliers are represented by list of object indexes from
dataset.
● BANG directory is a object of class bang_directory.
● Dendrogram is represented by list of dendrogram clusters
where each cluster contains expand order of blocks that
was formed during clustering process.
BANG result visualization
Output result such as clusters and outliers can be shown
by common visualizer „cluster_visualizer“ from
„pyclustering.cluster“ or by BANG visualizer:
instance = bang(sample, levels)
instance.process()
clusters = instance.get_clusters() # allocated clusters
noise = instance.get_noise() # outliers
directory = instance.get_directory() # get BANG directory
# visualize clustering results
bang_visualizer.show_clusters(sample, clusters, noise)
bang_visualizer.show_dendrogram(dendrogram)
bang_visualizer.show_blocks(directory)
BANG visualization – Lsun
Visualization of BANG clustering results. Data: ‚Lsun‘.
BANG blocks and their
densities
BANG dendrogram of
three formed clusters
Allocated clusters by
BANG algorithm
BANG visualization – Chainlink
BANG visualizer is able to display clustering result of N-
dimension data by forming pair xk, xl, where k, l –
dimension indexes.
BANG blocks representation in case 3-dimensional data
BANG visualization - Target
Visualization of BANG clustering results. Data: ‚Target‘.
BANG blocks and their
densities
BANG dendrogram of
three formed clusters
Allocated clusters by
BANG algorithm
Animate BANG clustering process
BANG clustering process can be animated (in case of 2-
dimensional data) using services of class ‚bang_animator‘.
instance = bang(data, levels, density_threshold)
instance.process()
# obtain BANG clustering result for creating animation
clusters = instance.get_clusters()
noise = instance.get_noise()
directory = instance.get_directory()
# show animation
bang_animator(directory, clusters, noise).animate()
# or save animation to file
bang_animator(directory, clusters, noise).animate(movie_filename=bang.mp4)
BANG for segmentation
BANG can consider image as a data where each point
represent pixel with three coordinate (RGB), or with four
coordinate (RGBA). Here is an example of image
segmentation using BANG algorithm:
from pyclustering.utils import draw_image_mask_segments, read_image
from pyclustering.cluster.bang import bang;
data = read_image(file_path_to_image);
bang_instance = bang(data, levels, density_threshold);
bang_instance.process();
clusters = bang_instance.get_clusters();
draw_image_mask_segments(source, clusters);
Image segmentation results
Example of image segmentation of photo from St.-
Petersburg by BANG algorithm using pyclustering.
Shortcoming of BANG segmentation
is not trivial way to set density
Threshold, especially to handle
Images with color gradient
References and Links
● Official pyclustering github repository:
https://github.com/annoviko/pyclustering
● Official pypi pyclustering page:
https://pypi.org/project/pyclustering/
● Official pyclustering web-site:
https://pyclustering.github.io/
Thank you for your attention
Thank you!

More Related Content

What's hot

A practical Introduction to Machine(s) Learning
A practical Introduction to Machine(s) LearningA practical Introduction to Machine(s) Learning
A practical Introduction to Machine(s) LearningBruno Gonçalves
 
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache SparkNLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache SparkMartin Goodson
 
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksBeginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksJinTaek Seo
 
Machine(s) Learning with Neural Networks
Machine(s) Learning with Neural NetworksMachine(s) Learning with Neural Networks
Machine(s) Learning with Neural NetworksBruno Gonçalves
 
Applicationof datastructures
Applicationof datastructuresApplicationof datastructures
Applicationof datastructuresHitesh Wagle
 
最新のデータベース技術の方向性で思うこと
最新のデータベース技術の方向性で思うこと最新のデータベース技術の方向性で思うこと
最新のデータベース技術の方向性で思うことMasayoshi Hagiwara
 
MongoDB Project: Relational databases to Document-Oriented databases
MongoDB Project: Relational databases to Document-Oriented databasesMongoDB Project: Relational databases to Document-Oriented databases
MongoDB Project: Relational databases to Document-Oriented databasesLamprini Koutsokera
 
Time Series Analysis:Basic Stochastic Signal Recovery
Time Series Analysis:Basic Stochastic Signal RecoveryTime Series Analysis:Basic Stochastic Signal Recovery
Time Series Analysis:Basic Stochastic Signal RecoveryDaniel Cuneo
 
parallel programming in the PVM-Reduction operation-advanced system architecture
parallel programming in the PVM-Reduction operation-advanced system architectureparallel programming in the PVM-Reduction operation-advanced system architecture
parallel programming in the PVM-Reduction operation-advanced system architectureRoslinJoseph
 
On Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesOn Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesJonathan Katz
 
07 Retrieving Objects
07 Retrieving Objects07 Retrieving Objects
07 Retrieving ObjectsRanjan Kumar
 
Vectors data frames
Vectors data framesVectors data frames
Vectors data framesFAO
 
Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networksImage net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networksheedaeKwon
 
Bloom filter
Bloom filterBloom filter
Bloom filterfeng lee
 
Appendix of downlink coverage probability in heterogeneous cellular networks ...
Appendix of downlink coverage probability in heterogeneous cellular networks ...Appendix of downlink coverage probability in heterogeneous cellular networks ...
Appendix of downlink coverage probability in heterogeneous cellular networks ...Cora Li
 
Gdc2011 direct x 11 rendering in battlefield 3
Gdc2011 direct x 11 rendering in battlefield 3Gdc2011 direct x 11 rendering in battlefield 3
Gdc2011 direct x 11 rendering in battlefield 3drandom
 
Applications of datastructures
Applications of datastructuresApplications of datastructures
Applications of datastructuresRatsietsi Mokete
 

What's hot (20)

A practical Introduction to Machine(s) Learning
A practical Introduction to Machine(s) LearningA practical Introduction to Machine(s) Learning
A practical Introduction to Machine(s) Learning
 
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache SparkNLP on a Billion Documents: Scalable Machine Learning with Apache Spark
NLP on a Billion Documents: Scalable Machine Learning with Apache Spark
 
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksBeginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
 
Machine(s) Learning with Neural Networks
Machine(s) Learning with Neural NetworksMachine(s) Learning with Neural Networks
Machine(s) Learning with Neural Networks
 
Applicationof datastructures
Applicationof datastructuresApplicationof datastructures
Applicationof datastructures
 
最新のデータベース技術の方向性で思うこと
最新のデータベース技術の方向性で思うこと最新のデータベース技術の方向性で思うこと
最新のデータベース技術の方向性で思うこと
 
Nx tutorial basics
Nx tutorial basicsNx tutorial basics
Nx tutorial basics
 
MongoDB Project: Relational databases to Document-Oriented databases
MongoDB Project: Relational databases to Document-Oriented databasesMongoDB Project: Relational databases to Document-Oriented databases
MongoDB Project: Relational databases to Document-Oriented databases
 
Time Series Analysis:Basic Stochastic Signal Recovery
Time Series Analysis:Basic Stochastic Signal RecoveryTime Series Analysis:Basic Stochastic Signal Recovery
Time Series Analysis:Basic Stochastic Signal Recovery
 
parallel programming in the PVM-Reduction operation-advanced system architecture
parallel programming in the PVM-Reduction operation-advanced system architectureparallel programming in the PVM-Reduction operation-advanced system architecture
parallel programming in the PVM-Reduction operation-advanced system architecture
 
Bloom filters
Bloom filtersBloom filters
Bloom filters
 
On Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesOn Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data Types
 
07 Retrieving Objects
07 Retrieving Objects07 Retrieving Objects
07 Retrieving Objects
 
Vectors data frames
Vectors data framesVectors data frames
Vectors data frames
 
Image net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networksImage net classification with deep convolutional neural networks
Image net classification with deep convolutional neural networks
 
Bloom filter
Bloom filterBloom filter
Bloom filter
 
Appendix of downlink coverage probability in heterogeneous cellular networks ...
Appendix of downlink coverage probability in heterogeneous cellular networks ...Appendix of downlink coverage probability in heterogeneous cellular networks ...
Appendix of downlink coverage probability in heterogeneous cellular networks ...
 
Dynomite Nosql
Dynomite NosqlDynomite Nosql
Dynomite Nosql
 
Gdc2011 direct x 11 rendering in battlefield 3
Gdc2011 direct x 11 rendering in battlefield 3Gdc2011 direct x 11 rendering in battlefield 3
Gdc2011 direct x 11 rendering in battlefield 3
 
Applications of datastructures
Applications of datastructuresApplications of datastructures
Applications of datastructures
 

Similar to Pyclustering tutorial - BANG

Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQLPeter Eisentraut
 
The Ring programming language version 1.9 book - Part 58 of 210
The Ring programming language version 1.9 book - Part 58 of 210The Ring programming language version 1.9 book - Part 58 of 210
The Ring programming language version 1.9 book - Part 58 of 210Mahmoud Samir Fayed
 
Generation of Deepfake images using GAN and Least squares GAN.ppt
Generation of Deepfake images using GAN and Least squares GAN.pptGeneration of Deepfake images using GAN and Least squares GAN.ppt
Generation of Deepfake images using GAN and Least squares GAN.pptDivyaGugulothu
 
Feature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive modelsFeature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive modelsGabriel Moreira
 
Introduction to Deep Learning and Tensorflow
Introduction to Deep Learning and TensorflowIntroduction to Deep Learning and Tensorflow
Introduction to Deep Learning and TensorflowOswald Campesato
 
ECCV2010: feature learning for image classification, part 4
ECCV2010: feature learning for image classification, part 4ECCV2010: feature learning for image classification, part 4
ECCV2010: feature learning for image classification, part 4zukun
 
PPT on Data Science Using Python
PPT on Data Science Using PythonPPT on Data Science Using Python
PPT on Data Science Using PythonNishantKumar1179
 
GANS Project for Image idetification.pdf
GANS Project for Image idetification.pdfGANS Project for Image idetification.pdf
GANS Project for Image idetification.pdfVivekanandaGN1
 
Андрей Козлов (Altoros): Оптимизация производительности Cassandra
Андрей Козлов (Altoros): Оптимизация производительности CassandraАндрей Козлов (Altoros): Оптимизация производительности Cassandra
Андрей Козлов (Altoros): Оптимизация производительности CassandraOlga Lavrentieva
 
Bucket sort- A Noncomparision Algorithm
Bucket sort- A Noncomparision AlgorithmBucket sort- A Noncomparision Algorithm
Bucket sort- A Noncomparision AlgorithmKrupali Mistry
 
Working with images in matlab graphics
Working with images in matlab graphicsWorking with images in matlab graphics
Working with images in matlab graphicsmustafa_92
 
Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730Akihiro Okuno
 
Foreground detection using gaussian mixture models matlab
Foreground detection using gaussian mixture models   matlabForeground detection using gaussian mixture models   matlab
Foreground detection using gaussian mixture models matlabym.ygrex@comp
 
Feature Engineering - Getting most out of data for predictive models - TDC 2017
Feature Engineering - Getting most out of data for predictive models - TDC 2017Feature Engineering - Getting most out of data for predictive models - TDC 2017
Feature Engineering - Getting most out of data for predictive models - TDC 2017Gabriel Moreira
 
Lab 1: Data cleaning, exploration, removal of outliers, Correlation of Contin...
Lab 1: Data cleaning, exploration, removal of outliers, Correlation of Contin...Lab 1: Data cleaning, exploration, removal of outliers, Correlation of Contin...
Lab 1: Data cleaning, exploration, removal of outliers, Correlation of Contin...Yao Yao
 
The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30Mahmoud Samir Fayed
 
The Django Book chapter 5 Models
The Django Book chapter 5 ModelsThe Django Book chapter 5 Models
The Django Book chapter 5 ModelsVincent Chien
 
SCons an Introduction
SCons an IntroductionSCons an Introduction
SCons an Introductionslantsixgames
 

Similar to Pyclustering tutorial - BANG (20)

Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
 
The Ring programming language version 1.9 book - Part 58 of 210
The Ring programming language version 1.9 book - Part 58 of 210The Ring programming language version 1.9 book - Part 58 of 210
The Ring programming language version 1.9 book - Part 58 of 210
 
Generation of Deepfake images using GAN and Least squares GAN.ppt
Generation of Deepfake images using GAN and Least squares GAN.pptGeneration of Deepfake images using GAN and Least squares GAN.ppt
Generation of Deepfake images using GAN and Least squares GAN.ppt
 
Feature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive modelsFeature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive models
 
Introduction to Deep Learning and Tensorflow
Introduction to Deep Learning and TensorflowIntroduction to Deep Learning and Tensorflow
Introduction to Deep Learning and Tensorflow
 
ECCV2010: feature learning for image classification, part 4
ECCV2010: feature learning for image classification, part 4ECCV2010: feature learning for image classification, part 4
ECCV2010: feature learning for image classification, part 4
 
PPT on Data Science Using Python
PPT on Data Science Using PythonPPT on Data Science Using Python
PPT on Data Science Using Python
 
GANS Project for Image idetification.pdf
GANS Project for Image idetification.pdfGANS Project for Image idetification.pdf
GANS Project for Image idetification.pdf
 
Андрей Козлов (Altoros): Оптимизация производительности Cassandra
Андрей Козлов (Altoros): Оптимизация производительности CassandraАндрей Козлов (Altoros): Оптимизация производительности Cassandra
Андрей Козлов (Altoros): Оптимизация производительности Cassandra
 
Bucket sort- A Noncomparision Algorithm
Bucket sort- A Noncomparision AlgorithmBucket sort- A Noncomparision Algorithm
Bucket sort- A Noncomparision Algorithm
 
Python for data analysis
Python for data analysisPython for data analysis
Python for data analysis
 
Working with images in matlab graphics
Working with images in matlab graphicsWorking with images in matlab graphics
Working with images in matlab graphics
 
Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730
 
Foreground detection using gaussian mixture models matlab
Foreground detection using gaussian mixture models   matlabForeground detection using gaussian mixture models   matlab
Foreground detection using gaussian mixture models matlab
 
Feature Engineering - Getting most out of data for predictive models - TDC 2017
Feature Engineering - Getting most out of data for predictive models - TDC 2017Feature Engineering - Getting most out of data for predictive models - TDC 2017
Feature Engineering - Getting most out of data for predictive models - TDC 2017
 
Xgboost
XgboostXgboost
Xgboost
 
Lab 1: Data cleaning, exploration, removal of outliers, Correlation of Contin...
Lab 1: Data cleaning, exploration, removal of outliers, Correlation of Contin...Lab 1: Data cleaning, exploration, removal of outliers, Correlation of Contin...
Lab 1: Data cleaning, exploration, removal of outliers, Correlation of Contin...
 
The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30
 
The Django Book chapter 5 Models
The Django Book chapter 5 ModelsThe Django Book chapter 5 Models
The Django Book chapter 5 Models
 
SCons an Introduction
SCons an IntroductionSCons an Introduction
SCons an Introduction
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 

Recently uploaded (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 

Pyclustering tutorial - BANG

  • 1. PyClustering: BANG Tutorial Pyclustering Library Tutorial Theme: BANG Library Version: 0.8.2 Author: Andrei Novikov E-Mail: pyclustering@yandex.ru
  • 2. Agenda ● PyClustering BANG Features; ● Input format for BANG; ● Data clustering using BANG; ● Data clustering result visualization; ● Animation of BANG clustering process; ● Image segmentation by BANG;
  • 3. PyClustering BANG Features ● BANG algorithm provides clustering results that can be used for further analysis (not only clusters and noise itself): dendrogram, BANG directory - information about density distribution, structure, approximate amount of real clusters and influence of input argument on clustering results. ● BANG visualizer for clustering results, BANG directory and dendrogram. ● BANG animator for creating animation of BANG clustering process.
  • 4. Import BANG BANG algorithm and its features can be imported from „pyclustering.cluster.bang“: from pyclustering.cluster.bang import bang from pyclustering.cluster.bang import bang_directory from pyclustering.cluster.bang import bang_visualizer from pyclustering.cluster.bang import bang_animator
  • 5. Input data format for BANG BANG algorithm uses array_like data format, for example, list where each element is a point that is represented by coordinates. Here is an example of 1-D data: dataset = [ [0.25], [0.43], [1.34], [-0.56] ] Example of 2-D data: dataset = [ [0.1, 0.2], [0.1, 0.6], [0.2, -1.4] ] Example of 3-D data: dataset = [ [0.6, 0.1, 0.4], [0.2, 0.1, 0.9] ]
  • 6. Clustering by BANG algorithm BANG uses one general parameter for clustering: level of division that technically means amount of BANG tree hight where root is a cell that covers whole data. from pyclustering.cluster.bang import bang data = [ [0.1], [0.2], [0.5], [0.3], [1.5], [1.8], [1.3], [1.6], [1.5] ] levels = 3 instance = bang(data, levels) instance.process() # perform processing clusters = instance.get_clusters(); # allocated clusters noise = instance.get_noise(); # cluster noise directory = instance.get_directory(); # BANG directory dendrogram = instance.get_dendrogram() # BANG dendrogram
  • 7. Output result of BANG BANG algorithm returns allocated clusters, outliers (noise), BANG directory and dendrogram: ● Clusters are represented by list of clusters and each cluster contains object indexes from dataset. ● Outliers are represented by list of object indexes from dataset. ● BANG directory is a object of class bang_directory. ● Dendrogram is represented by list of dendrogram clusters where each cluster contains expand order of blocks that was formed during clustering process.
  • 8. BANG result visualization Output result such as clusters and outliers can be shown by common visualizer „cluster_visualizer“ from „pyclustering.cluster“ or by BANG visualizer: instance = bang(sample, levels) instance.process() clusters = instance.get_clusters() # allocated clusters noise = instance.get_noise() # outliers directory = instance.get_directory() # get BANG directory # visualize clustering results bang_visualizer.show_clusters(sample, clusters, noise) bang_visualizer.show_dendrogram(dendrogram) bang_visualizer.show_blocks(directory)
  • 9. BANG visualization – Lsun Visualization of BANG clustering results. Data: ‚Lsun‘. BANG blocks and their densities BANG dendrogram of three formed clusters Allocated clusters by BANG algorithm
  • 10. BANG visualization – Chainlink BANG visualizer is able to display clustering result of N- dimension data by forming pair xk, xl, where k, l – dimension indexes. BANG blocks representation in case 3-dimensional data
  • 11. BANG visualization - Target Visualization of BANG clustering results. Data: ‚Target‘. BANG blocks and their densities BANG dendrogram of three formed clusters Allocated clusters by BANG algorithm
  • 12. Animate BANG clustering process BANG clustering process can be animated (in case of 2- dimensional data) using services of class ‚bang_animator‘. instance = bang(data, levels, density_threshold) instance.process() # obtain BANG clustering result for creating animation clusters = instance.get_clusters() noise = instance.get_noise() directory = instance.get_directory() # show animation bang_animator(directory, clusters, noise).animate() # or save animation to file bang_animator(directory, clusters, noise).animate(movie_filename=bang.mp4)
  • 13. BANG for segmentation BANG can consider image as a data where each point represent pixel with three coordinate (RGB), or with four coordinate (RGBA). Here is an example of image segmentation using BANG algorithm: from pyclustering.utils import draw_image_mask_segments, read_image from pyclustering.cluster.bang import bang; data = read_image(file_path_to_image); bang_instance = bang(data, levels, density_threshold); bang_instance.process(); clusters = bang_instance.get_clusters(); draw_image_mask_segments(source, clusters);
  • 14. Image segmentation results Example of image segmentation of photo from St.- Petersburg by BANG algorithm using pyclustering. Shortcoming of BANG segmentation is not trivial way to set density Threshold, especially to handle Images with color gradient
  • 15. References and Links ● Official pyclustering github repository: https://github.com/annoviko/pyclustering ● Official pypi pyclustering page: https://pypi.org/project/pyclustering/ ● Official pyclustering web-site: https://pyclustering.github.io/
  • 16. Thank you for your attention Thank you!