100% found this document useful (1 vote)
14 views

A Practical Approach For Machine Learning And Deep Learning Algorithms Abhishek Kumar Pandey pdf download

The document presents a book titled 'A Practical Approach for Machine Learning and Deep Learning Algorithms' by Abhishek Kumar Pandey and co-authors, focusing on implementing machine learning algorithms using MATLAB and Python. It aims to provide a comprehensive understanding of machine learning concepts, algorithms, and practical applications, particularly for graduate students and researchers. The book emphasizes hands-on learning with ample examples and MATLAB code to facilitate understanding of machine learning workflows and neural networks.

Uploaded by

sukowsheafox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
14 views

A Practical Approach For Machine Learning And Deep Learning Algorithms Abhishek Kumar Pandey pdf download

The document presents a book titled 'A Practical Approach for Machine Learning and Deep Learning Algorithms' by Abhishek Kumar Pandey and co-authors, focusing on implementing machine learning algorithms using MATLAB and Python. It aims to provide a comprehensive understanding of machine learning concepts, algorithms, and practical applications, particularly for graduate students and researchers. The book emphasizes hands-on learning with ample examples and MATLAB code to facilitate understanding of machine learning workflows and neural networks.

Uploaded by

sukowsheafox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 87

A Practical Approach For Machine Learning And

Deep Learning Algorithms Abhishek Kumar Pandey


download

https://ebookbell.com/product/a-practical-approach-for-machine-
learning-and-deep-learning-algorithms-abhishek-kumar-
pandey-50471710

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Machine Learning For Civil And Environmental Engineers A Practical


Approach To Datadriven Analysis Explainability And Causality M Z Naser

https://ebookbell.com/product/machine-learning-for-civil-and-
environmental-engineers-a-practical-approach-to-datadriven-analysis-
explainability-and-causality-m-z-naser-50825920

Machine Learning For Adaptive Manycore Machines A Practical Approach


1st Edition Noel Lopes

https://ebookbell.com/product/machine-learning-for-adaptive-manycore-
machines-a-practical-approach-1st-edition-noel-lopes-4931048

Practical Guide For Biomedical Signals Analysis Using Machine Learning


Techniques A Matlab Based Approach 1st Edition Abdulhamit Subasi

https://ebookbell.com/product/practical-guide-for-biomedical-signals-
analysis-using-machine-learning-techniques-a-matlab-based-
approach-1st-edition-abdulhamit-subasi-10666766

Statistics A Practical Approach For Process Control Engineers 1st


Edition Myke King

https://ebookbell.com/product/statistics-a-practical-approach-for-
process-control-engineers-1st-edition-myke-king-6984552
Health Care Information Systems A Practical Approach For Health Care
Management Second Edition 2nd Karen A Wager

https://ebookbell.com/product/health-care-information-systems-a-
practical-approach-for-health-care-management-second-edition-2nd-
karen-a-wager-2386578

Fluid And Thermal Sciences A Practical Approach For Students And


Professionals Nuggenhalli S Nandagopal

https://ebookbell.com/product/fluid-and-thermal-sciences-a-practical-
approach-for-students-and-professionals-nuggenhalli-s-
nandagopal-47165988

M5stack Electronic Blueprints A Practical Approach For Building


Interactive Electronic Controllers And Iot Devices Dr Don Wilcher

https://ebookbell.com/product/m5stack-electronic-blueprints-a-
practical-approach-for-building-interactive-electronic-controllers-
and-iot-devices-dr-don-wilcher-47655928

Deep Learning Models A Practical Approach For Handson Professionals


Jonah Gamba

https://ebookbell.com/product/deep-learning-models-a-practical-
approach-for-handson-professionals-jonah-gamba-56649432

Cloud Computing A Practical Approach For Learning And Implementation


1e Srinivasan

https://ebookbell.com/product/cloud-computing-a-practical-approach-
for-learning-and-implementation-1e-srinivasan-22041786
A Practical Approach for
Machine Learning and Deep
Learning Algorithms
Tools and Technique using MATLAB and Python

By
Abhishek Kumar Pandey
Pramod Singh Rathore
Dr. S. Balamurugan
FIRST EDITION 2019

Copyright © BPB Publications, INDIA

ISBN: 978-93-88511-13-1

All Rights Reserved. No part of this publication can be stored in a retrieval system
or reproduced in any form or by any means without the prior written permission of
the publishers

LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY


The Author and Publisher of this book have tried their best to ensure that the
programmes, procedures and functions described in the book are correct. However,
the author and the publishers make no warranty of any kind, expressed or implied,
with regard to these programmes or the documentation contained in the book. The
author and publisher shall not be liable in any event of any damages, incidental
or consequential, in connection with, or arising out of the furnishing, performance
or use of these programmes, procedures and functions. Product name mentioned
are used for identification purposes only and may be trademarks of their respective
companies.

All trademarks referred to in the book are acknowledged as properties of their


respective owners.

Distributors:

BPB PUBLICATIONS BPB BOOK CENTRE


20, Ansari Road, Darya Ganj 376 Old Lajpat Rai Market,
New Delhi-110002 Delhi-110006
Ph: 23254990/23254991 Ph: 23861747

MICRO MEDIA DECCAN AGENCIES


Shop No. 5, Mahendra Chambers, 4-3-329, Bank Street,
150 DN Rd. Next to Capital Cinema, Hyderabad-500195
V.T. (C.S.T.) Station, MUMBAI-400 001 Ph: 24756967/24756400
Ph: 22078296/22078297

Published by Manish Jain for BPB Publications, 20, Ansari Road, Darya Ganj, New
Delhi-110002 and Printed by Repro India Pvt Ltd, Mumbai
Preface

While the history of technology development by mankind can be considered


in terms of thousands of years, the real development of technology has
occurred only during the last hundred years.
What is Artificial Intelligence?
One of the key features that distinguish us, humans, from everything
else in the world is intelligence. This capacity to understand, practice
knowledge and strengthening skills has played vital role in our evolution
and developing human civilization. It is believe that the advancement in
technology can create super intelligence that can threaten human existence
What Is Machine Learning?
This is a book about Machine Learning with MATLAB, which immediately
begs the question: what is Machine Learning? It’s a surprisingly hard
definition to nail down, especially given how ubiquitous the term has
become. Vocal critics have differently released the term as unnecessary
label or a simple buzzword that only occurred to salt resumes and hold on
to the eye of enthusiastic tech recruiters
Data scientist has been called “the most important job of the 21stcentury,”
presumably by someone who has never visited a fire station.
And developing field and it can’t take a great extent of detecting to find
analyst breathlessly fore sighting that over the next 10 years, we will
need billions and billions of more data scientists than we currently have.
An aim is to help and develop the data science by learning algorithm
skills and the desire is to develop statistical modeling and the mathematics
that is the core of Machine Learning and the goal is to help you to get
comfortable with the mathematics and statistics that are at the core of data
science.
The best way to learn Machine Learning is by Learning Algorithms on
things. By reading this book you will get good understanding of the way
the Algorithm has been used for various applications. You will get good
understanding of Machine Learning using Matlab and some part like deep
learning has been touched with Python approach to get the students and
iv A Practical Approach for Machine Learning and Deep Learning Algorithms

readers a good comparative analysis about classification and prediction


and data visualizations. In the book the content part has been organized in
such a way that a graduate and post graduate student can get fundamentals
of machine learning along with ample of examples to get conceptualize the
theories of different machine learning algorithms. This book has focused
right from machine learning basic theories along with pattern recognition,
visualization of data, brief introduction in Deep learning and applications
of tensor flow as well.
∑ As the real-time application of machine learning is endless but the
basics concepts and algorithms are discussed by us using MATLAB
language so that from graduate students to researchers can get
benefited with this.
∑ The book focused on MATLAB code for algorithm implementations
rather than mathematical formula.
∑ The book has discussed machine learning workflow for health
monitoring.
∑ The neural network domain has been touched and implementation in
Matlab with explicit explanation of code and results
∑ This book has ability to realize the students that machine learning is
easy and interesting.
Foreward

Who should read this book


The book is basically meant for graduate and research students who find
the algorithms of machine learning difficult for implementations. We
have touched all basic algorithms of machine learning in detail with the
practical approach. Primarily beginners can find this book more effective
as the chapters are subdivided into such a way they will find the building
and implementing algorithms in MATLAB is interesting and easy at the
same time.
Why we wrote this book
The writers for this book teamed up from research and academic research
domain, so we take care of things that the text and flow of chapter’s content
are easy enough for the beginners.
Readership (who’s the target audience?):
There are numerous books on machine learning and AI. In any case, every
one of them is implied for graduate students or research today, applying
machine learning does not require a Ph.D. Nonetheless, there are a couple
of assets out there that completely cover all the essential parts of actualizing
machine learning by and by, without expecting you to take advanced of
math courses. We believe this book will help individuals who need to apply
machine learning without studying upon years of analytics, calculus math,
and probability hypothesis. We are focusing on the engineering students
who find difficulties while solving different machine learning algorithms
in MATLAB.
Machine learning is most sought to research field and is an integral part
of many research projects today including commercial applications, and
academic research as well. The machine learning domain starts from
finding friends on social networking sites to medical diagnosis and even
for satellite processing. In this book, we have made an honest effort to
make the concepts of machine learning easy and also give basics programs
in MATLAB right from the installation part. As the real-time application
of machine learning is endless but the basics concepts and algorithms are
discussed by us using MATLAB language so that from graduate students
to researchers can get benefited with this.
vi A Practical Approach for Machine Learning and Deep Learning Algorithms

What you will learn:


∑ Machine learning in MATLAB
∑ The Algorithms of machine learning with MATLAB code
∑ Deriving and access data in MATLAB then preprocessing and
preparation of data
∑ Machine learning workflow for health monitoring
∑ Neural network domain implementation in MATLAB with explicit
explanation of code and results.
Acknowledgment

Writing a book is harder than I thought and more rewarding than I could
have ever imagined. First and foremost, I would like to thank my father
Mr. Krishan Dev Pandey for being coolest father ever and my mother Mrs.
Veena Pandey for allowing me to follow my ambitions throughout my
childhood. They taught me discipline, tough love, manners, respect, and
so much more that has helped me succeed in life. Also, my gratitude to
my elder sister Mrs. Arpna Tripathi, who always stood by me during every
struggle and all my successes. She has been my inspiration and motivation
for continuing to improve my knowledge and move my career forward.
Also, I’m eternally grateful to my wife Mrs. Kajal Pandey for standing
beside me throughout my career and writing this book. I also thank my
wonderful son Aarudra Pandey, for always making me smile and for
understanding on those weekend mornings when I was writing this book
instead of playing games with him. I hope that one day he can read this
book and understand why I spent so much time in front of my computer.
Last but not the least, I want to thank my friends who always backed me in
my good or bad days and everyone who ever said anything positive to me
or taught me something. I heard it all, and it meant something.

Abhishek K. Pandey
Assistant Professor (Computer science engineering)
ACERC, Visiting faculty, Mdsu, Ajmer Rajasthan, India

First of all, I would like to thank the authors for contributing their excellent
chapters to this book. Without their contributions, this book would not
have been possible.
I would like to dedicate this book to my father Late Mr. Raghunath Singh
Rathore and my mother Late Mrs. Prem Kanwar who always believed in
my ability to be successful. I am missing you and at the same time feeling
you both around me always. You are gone but your belief and blessing in
me has made this journey possible. Also, my gratitude to my elder brother
Mr Praveen Singh Rathore, who always stood by me during every struggle
and all my successes. Also, I would like to express appreciation to my
viii A Practical Approach for Machine Learning and Deep Learning Algorithms

beloved wife Mrs. Anita Kanwar who always support in the moments
when there was no one to answer my queries. I also thank my wonderful
son Raghavendra Singh Rathore, for made me stronger, better and more
fulfilled than I could have ever imagined. This book has been a long-
cherished dream of mine which would not have been turned into reality
without the support and love of these amazing people, who encouraged me
despite my not giving them the proper time and attention. Thanks to all my
friends specially Abhishek K Pandey for sharing my happiness at the start
of this project and following up with their encouragement when it seemed
too difficult to completed.
Pramod Singh Rathore
Assistant Professor (Computer science engineering)
ACERC, Visiting faculty, Mdsu, Ajmer Rajasthan, India

The authors are always thankful to God for their perseverance.


I would like to thank my father Mr.M.Shanmugam and mother
Mrs.S.Sarojini, wife Mrs.S.Charanyaa for being the pillar of support,
son Master.B.Surya for his patience and understanding, and to
Mr.K.S.Subramanian and Mrs.S.Varalakshmi for support. I wish to thank
my sisters Mrs.S.Amudha and Dr.S.Geetha for their valuable support. My
special thanks go to brother-in-law Mr.S.Vivek & Family. Also wishes
thanks to the management team of QUANTS IS & CS LLP, India for their
support for the book work.
Dr.S.Balamurugan
Head of Research and Development,
Quants IS & CS, India.
Authors
AUTHORS
AUTHORS

Abhishek Kumar
Abhishek KumarPandey Pandey is pursuing
is pursuing his
his Doctorate in co
Abhishek Kumar Pandey is pursuing his Doctorate in c
Doctorate
science frominUniversity
computer science
of Madras. andHedone M.Tech
is currently
science from University of Madras. He is currently researching
researching
in Computer
recognition
recognition Sci.IoT
using
using & Engineering.
IoT
concept and He
concept and hashas
has done
donebeen M.Tech in Co
M.Tech in C
Science
workingandand
as Engineering
an Assistantfrom Government
professor Engineering College
of Computer
Science Engineering from Government Engineering College
Rajasthan
Science at Technical
Aryabhatt University, Kota, India.
Engineering College He andhas been workin
Rajasthan Technical University, Kota, India. He has been workin
Assistant
Research professor
center, of Computer
Ajmer and also Science faculty
visiting at Aryabhatt Eng
Assistant professor of Computer Science at Aryabhatt Eng
College and Research
in Government center, MDS
University Ajmer and also Heaa visiting fa
College and Research center, AjmerAjmer. and also visiting fa
Government University
has total Academic MDS,
teaching Ajmer. He
experience has a
of amoretotal academic t
Government University MDS, Ajmer. He has total academic t
experience
than of
eight years more than
withthanmore 8 years
than 50 with many
publications publications
in reputedin reputed national
Nationalnational
and and inter
experience of more 8 years with many publications in reputed and inter
SCOPUS Journals
International Journals.likeHisWiley, Taylorarea
research and includes-
Francis Springer,
Artificial Elsevier Science Direct, A
intelligence,
SCOPUS Journals like Wiley, Taylor and Francis Springer, Elsevier Science Direct, A
Computer
Image Science, Poland, and
processing, IEEE. HisMining,
research area includes artificial
He intelligence
Computer Science,Computer
Poland, and Vision,
IEEE. DataHis researchMachine Learning.
area includes artificial intelligence
processing,
has computer
been in computer
International vision, data mining,
Conference machineoflearning.
Committee He has been in the Inter
many International
processing, vision, data mining, machine learning. He has been in the Inter
Conference Committee of many international conferences. He has been the reviewer f
conferences. He has beenofthe
Conference Committee reviewer
many for IEEE
international and Inder science
conferences. He hasJournal.
been the reviewer
and Inder Science Journal. He has co-authored three books published internationally a
He has authored 4 books published internationally
and Inder Science Journal. He has co-authored three books published and 7 edited book.. internationally
edited books. Currently, he is working on a Machine Learning book with BPB Publica
He
editedis also
books.member
Currently,of various National
he is working on aand International
Machine Learning professional
book with BPB Publica
is also a member of various national and international professional societies in the
societies
is also a in the fieldof of
member engineering
various national & and
research like Member
international of IAENG
professional societies in the
engineering and research like Member of IAENG (International Association of Eng
(International
engineering and Association
research of likeEngineers),
Member of Associate Member
IAENG (International
Associate Member of IRED (Institute of Research Engineers and Doctors), Associate M
of IRED
Association of Eng
(Institute
Associate of Research
Member of IRED Engineers
(Instituteand Doctors),
of Research Associate
Engineers
of IAIP (International Association of Innovation Professionals), Member of ICSES (Inter Member
and Doctors), of Associate
IAIP
of IAIP(International
Computer Science Association
(International AssociationofofInnovation
and Engineering Society), Professionals),
Innovation Professionals), Member of
Life Member of ISRD (International of ICSES (InterSo
Computer
ICSES
research &Science
(International and
Development), Engineering
Computer
Member ofSociety),
Science ISOC Life Member
and(Internet
Engineering of ISRD
Society),
Society). He has (International
Life been awarded So
research
Member &
of Development),
ISRD Member
(International of
SocietyISOC for (Internet
research
CV Raman life time achievement national award for 2018 in young researcher andSociety).
& He has
Development), been awarded
CV
MemberRaman
category. ofHelife
ISOC time achievement
(Internet
is serving Society).He
as an national
Associate has
Editor award
gotofSir for
CV2018
Global Ramanin young
Journal life timeresearcher
on Innovation, Oppoand
category.
achievement He
and Challenges is serving
national
in Applied as
award an Associate
for 2018
Artificial Editor
in young
Intelligence of Global
andresearcherJournal on Innovation,
and faculty
Machine Learning. Oppo
and Challenges
Category. He isinserving
AppliedasArtificial Intelligence
an Associate Editor andofMachine
Global Learning.
Journal on
Innovation, Opportunities and Challenges in Applied Artificial Intelligence
and Machine Learning.
Pramod Singh
SinghRathore
PramodSingh Rathoreis M.pursuing
Tech inhis Computer
doctorateSci. and Engi
Pramod
from Government Rathore isisM.
Engineering Tech in Computer
College Ajmer, Sci. and Eng
Rajasthan Te
in Computer Science & engineering and done
from Government
University, Kota, Engineering
India. I have been College
working Ajmer,
as an Rajasthan
Assistant ProfeT
M. Tech. He has been working as the Assistant
University,
Computer Kota, India.
at IAryabhatt
have been working as anCollege
Assistant Profe
professor Science
of Computer ScienceEngineering
at Aryabhatt and R
Computer
center, AjmerScience
and at
also a Aryabhatt
visiting Engineering
faculty in GovernmentCollege and
UniversiR
Engineering College and Research centre, Ajmer
center,
Ajmer. Ajmer and also
He hasfaculty a
authored visiting faculty in
a book in Network Government Univers
and visiting in Government Universitysimulation w
Ajmer.
publishedHe has authored
worldwide. a book in Network simulation
experiw
MDS Ajmer. He hasHe has edited
been a total and
academic
authored teaching
published
more
many than worldwide.
books7 with He
yearsWiley, has
with Taylor a total academic
many publications
& Francis Eureka in reputed exper
teaching natio
more than 7 years with many publications
international E-SCI SCOPUS Journals like Wiley, IGI GLOBAL, Taylor in and
reputed natio
Francis S
international E-SCI SCOPUS Journals like Wiley, IGI GLOBAL, Taylor
Elsevier Science Direct, Annals of Computer Science, Poland, and IEEE. He has co-au and Francis S
Elsevier Science Direct, Annals of Computer Science, Poland, and
three edited book and is currently working on Network Simulation Book with IEEE. He has co-a
three editedand
Publication, book and Learning
Machine is currently
bookworking
with BPBon Network His
Publication. Simulation
research areaBookinclud
wit
Publication, and Machine Learning book with BPB Publication. His research area includ
x A Practical Approach for Machine Learning and Deep Learning Algorithms

group, CRC USA. He has total Academic teaching experience of more


than eight years with more than 40 publications as Research papers and
Chapters in reputed National and International E-SCI SCOPUS. He has
done five edited book. His research area includes machine learning, NS2,
Computer Network, Mining, and DBMS. He has been serving in editorial
and advisory committee of Global journal group, Eureka Group of Journals
.He has been member of various National and International professional
societies in the field of engineering & research like Member of IAENG
(International Association of Engineers).
Dr S. Balamurugan is the Head of Research and
DrDevelopment,
S. Balamurugan is the
Quants IS Head
& CS,of Research
India. andhe
Formely, Development,
ISwas
& theCS,Director
India. Formerly,
of Research and Development at of Resea
he was the Director
Development at Mindnotix
Mindnotix Technologies, India. Technologies, India. He has autho
He has authored/
authored
co-authored 33 books
33 books and and
has has
200 200
publications in various inter
publications
journals and conferences to his credit.
in various international journals and conferencesHe is currently in the pr
authoring further three books with
to his credit. He was awarded with Three Post- Springer, Elsevier, and W
was awarded
Doctoral with Doctor
Degrees- Three Post-Doctoral
of Science(D.Sc.) Degrees-
degree Doctor
and Twoof Science(D.Sc.)
Doctor of degree a
Doctor of Letters(D.Litt) degrees for his significant contribution
Letters(D.Litt) degrees for his significant contribution to research and to research and devel
in Engineering,
development in and is the recipient
Engineering, and is ofthethe Best Director
recepient of theeAward, 2018. He is the reci
Best Director
Rashtriya
Award, Vidhya
2018. Gourav Gold
His biography is listedMedal
in “WorldAwardBook byofIndian Solidary
Researchers” Council and T
2018,
Educationalist
Oxford, UK and Award from Hon.Justice,
in “Marquis WHO’S WHO” O.P.Saxena, Supreme
2018 issue, NewCourt,
Jersey,New Delhi. H
USA. He carried
recipient out a healthcare
of Lifetime Achievement consultancy
Award, by project for VGM
Global Hospitals
Outreach Education and R
between
Council. 2013
He is and
the 2016, and his
recipient current researchKalam
of Dr.A.P.J.Abdul projects include “Women
Sadhbhavana Award and Jewel
Empowerment using IoT”, “Health-Aware
Award, from Hon.Balmiki Prasad Singh, FormerSmart Chair”,
Governor “Advanced Brain
of Sikkim, India. He also r
Simulators for Assisting Physiological Medicine”, “Designing
Star of Asia Award. As Director of Research and Development at Mindnotix, he and h Novel
Health
won theBands”
2017 CSI and “IoTIT-based
Young Devices
Professional for Assisting
Award Elderly
for Region-7, People”.
awarded by the Computer
His professional
of India, Coimbatoreactivities
Chapter.include
He isroles
also astheAssociate
recipient Editor, editorial
of the Best Researcher Aw
board member and/or reviewer for more than 100 international journals
Certificate of Exceptionalism from the ASDF, the Young Scientist Award, and the Bes
and conferences.
Researcher Award.HeHehasserved
been an as invited
the Joint asSecretary
Chief Guest/Resource
of ITA duringPerson/
his BTech at PSG Co
Keynote Plenary
Technology, IndiaSpeaker in manyisreputed
.His biography listed in Universities
"World Book andofColleges His 2018, Oxf
Researchers"
research interests include Augmented Reality, the Internet of
and in "Marquis WHO'S WHO" 2018 issue, New Jersey, USA. He carried out a he Things, Big
Data Analytics,
consultancy CloudforComputing,
project VGM Hospitals and Wearable
betweenComputing.
2013 and 2016,He is aand
lifehis current r
member of the ACM, ISTE and CSI.
projects include "Women Empowerment using IoT", "Health-Aware Smart Chair", "A
Brain Simulators for Assisting Physiological Medicine", "Designing Novel Health Ban
"IoT -based Devices for Assisting Elderly People". His professional activities include
Associate Editor, editorial board member and/or reviewer for more than 100 inter
journals and conferences. He has been invited as Chief Guest/Resource Person/
Plenary Speaker in many reputed Universities and Colleges. His research interests
augmented reality, the Internet of Things, Big Data Analytics, Cloud Computing, and W
Computing. He is a life member of the ACM, ISTE, and CSI.
Table of Contents

Preface iii
Foreword v
Acknowledgment vii

Pre-requisite to Machine Learning........................................................ 1


1. Accessing the Data........................................................................... 1
2. Pre - processing Data....................................................................... 1
3. Deriving Data/ Missing Data in MATLAB...................................... 2
4. Importing and Organizing Data....................................................... 9
4.1 Data Types............................................................................. 9
4.2 Categorical Data Plot.......................................................... 33
4.3 Create and Work with Tables.............................................. 44
4.4 Cross Validation.................................................................. 46
4.5 What is Data Preparation.................................................... 51
1. An Introduction to Machine Learning....................................... 57
1.1 Basics of Machine Learning...............................................
. 58
1.2 Machine Learning Types ..................................................... 58
1.3 Selection of Appropriate Algorithm.................................... 63
1.4 Linear Programming Algorithms........................................ 65
1.4.1 Machine Learning
.
Workflow using a Health Monitoring..................... 67
2. Finding Natural Patterns in Data............................................... 73
2.1 Unsupervised Learning....................................................... 73
2.2 Clustering Strategies........................................................... 74
2.2.1 Hard Clustering Calculations.................................. 74
2.2.2 Soft Clustering Calculations................................... 74
2.3 Cluster Evaluation and Interpretation................................. 91
2.3.1 Common Dimensionality Reduction Techniques
for Improving Model Performance......................... 91
3. Building Classification Methods................................................. 95
3.1 Supervised Learning............................................................ 95
3.2 Supervised Machine Learning............................................. 98
3.3 Unsupervised Machine Learning...................................... 101
xii A Practical Approach for Machine Learning and Deep Learning Algorithms

3.4 Semi-supervised Learning................................................. 103


3.4.1 Understanding Semi-supervised Learning............ 103
3.5 Reinforcement Learning.................................................... 105
3.6 Some Important Consideration in Machine Learning....... 106
3.7 Training and Validation..................................................... 107
3.8 Classification of Methods.................................................. 108
3.8.1 Training of Automated Classifier.......................... 108
3.8.2 Manual Classifier Training.................................... 109
3.8.3 Parallel Classifier Training.....................................110
3.9  Algorithm for Classification...............................................112
3.9.1 Classification Algorithm in General.......................112
3.9.2 Common Classification Algorithm.........................112
3.9.3 Regression............................................................. 138
3.9.4 Regression Algorithms.......................................... 149
3.10 Techniques for Model Improvement................................. 185
3.10.1 Selecting Features for Classifying
High-dimensional Data......................................... 185
3.10.2 Loading the Data................................................... 186
3.10.3 Sequential Feature Selection Application............. 191
4. Data Pre – Processing in Python............................................... 193
4.1 Data Preparation................................................................ 193
4.1.1 Data Preparation Process....................................... 193
4.2 Feature Selection for Machine Learning........................... 195
4.3 Recursive Feature Elimination.......................................... 196
4.4 Principal Component Analysis.......................................... 197
4.5 Feature Importance............................................................ 198
4.6 Feature Scaling.................................................................. 198
4.7 Seven Ways to Handle Large Data Files for
Machine Learning............................................................. 201
4.8 Dimensionality Reduction................................................. 204
4.9 Cross Validation................................................................ 205
4.10 Feature Transformation..................................................... 210
5. Building Regression Models...................................................... 213
5.1 Parametric regression Methods......................................... 213
5.2 Nonparametric Machine Learning Algorithms................. 215
5.3 Evaluation of Regression Models..................................... 217
Table of Contents xiii

6. Creating Neural Networks........................................................ 221


6.1 Self-organizing the Maps and their use in Obtaining
K-Clusters......................................................................... 221
6.2 Classification with Feed-Forward Networks..................... 223
6.3 Regression with Feed-forward Networks.......................... 243
7. Introduction to Deep Learning................................................. 247
7.1 Deep Learning Overview.................................................. 247
7.2 How Deep Learning Works............................................... 247
7.2.1 How is Deep Learning Different from
Machine Learning?................................................ 247
7.2.2 Is Deep Learning Different from
AI (artificial intelligence)?.................................... 248
7.2.3 What is Deep Learning Framework?.................... 248
7.2.4 What are the Dimensions of the
Deep Learning?..................................................... 248
7.3 Deep Learning uses and Functioning................................ 248
7.4 Programming Languages used to Program (design)
Deep Learning?................................................................. 248
7.5 Meaning and importance of Deep Learning...................... 249
7.6 What Deep Learning can do in Future?............................ 250
7.7 Applications of Deep Learning in
Artificial Intelligence........................................................ 251
7.8 Fields were deep learning boom:...................................... 251
7.9 The future of deep learning............................................... 251
7.10 Algorithms in Deep Learning............................................ 252
7.11 Comparison of Machine Learning and
Deep Learning................................................................... 253
7.11.1 Data Dependencies................................................ 253
7.11.2 Hardware dependencies........................................ 254
7.11.3 Execution time...................................................... 254
7.11.4 Interpretability....................................................... 254
7.12 TensorFlow........................................................................ 255
7.12.1 What is TensorFlow.............................................. 255
7.12.2 Steps to install TensorFlow................................... 255
7.12.3 Linear Regression with TensorFlow..................... 256
7.13 Artificial Neural Networks................................................ 257
7.13.1 Neurons................................................................. 257
7.13.2 How will Artificial Neural Network Work?.......... 258
7.13.3 Neuron Weights..................................................... 259
7.13.4 Feed-forward Deep Networks............................... 259
7.13.5 Feed-forward Deep Networks............................... 259
7.14 Activation function............................................................ 260
7.14.1 Back propagation.................................................. 261
7.14.2 Cost Perform and Gradient Descent...................... 262
7.15 Multi-layer perceptron (forward propagation).................. 263
7.16 Using Activation Perform................................................. 265
Pre-requisite to Machine
Learning

1. Accessing the Data


Physical-World Data
MATLAB is used wide range of applications in sensor, picture, video,
telemetry, parallel and other continuous organizations.
Machine learning, neural systems, and measurements and beyond:
MATLAB offers a full arrangement of insights and machine learning
functionality in addition to cutting edge techniques. For example, nonlinear
improvement, framework recognizable proof and a huge number of in-
built calculations for picture and video preparing, budgetary displaying,
control framework outline.
Rapid preparing of huge data sets
MATLAB’s numeric schedules scale straightforwardly for parallel
processing on groups and cloud.

2. Pre - processing Data


Information collection can requires pre-processing systems with guaranteed
exact, productive or significant investigation. Pre-processing alludes to
strategies for discovering, evacuating and supplanting terrible or missing
information. Recognizing neighborhood extreme and sudden changes can
distinguish huge information patterns. Smoothing and de-trending for
expelling commotion and direct patterns from information, while scaling
changes the limits of the information. Gathering and binning strategies are
procedures that distinguish connections among the information factors.
2 A Practical Approach for Machine Learning and Deep Learning Algorithms

3. Deriving Data/ Missing Data in MATLAB


Working with missing information is a typical assignment in information
pre - processing. In some cases missing qualities imply an important
occasion in the information else with inconsistent or unusable information
focuses. In either case, MATLAB has numerous alternatives for taking
care of missing information.
Make and Organize Missing Data
The shape of missing qualities take in MATLAB relies upon the information
write. For instance, numeric information writes such as double use NaN
(not a number) deals with missing data.
x = [NaN 1 2 3 4];
You can likewise utilize the missing value to speak to missing numeric
information or different sorts of information. Different information data are
such as date time, string and categorical. MATLAB consequently changes
over the missing value to the information’s for accurate processing.

Assume you need to continue missing qualities as a major aspect of your informational
isolate them from whatever remains in the information. A few MATLAB capacities empower you t
situation of missing qualities for handling additionally. For instance, utilize the 'Missing Placemen
the sort function to move NaN to a complete number.
Pre-requisite to Machine Learning 3

Assume you need to continue missing qualities as a major aspect of


your informational collection yet isolate them from whatever remains
Assume you need to continue missing qualities as a major aspect of your informational collection
in the information. A few MATLAB capacities empower you to control
te them from whatever remains in the information. A few MATLAB capacities empower you to control
the situation of missing qualities for handling additionally. For instance,
ation of missing qualities for handling additionally. For instance, utilize the 'Missing Placement' option w
utilize
sort function to movethe
NaN‘Missing Placement’
to a complete option with the sort function to move NaN
number.
to a complete number.

d, Replace andFind, Replace


Ignore and Ignore
Missing Data Missing Data
Evenwethough
Even though are notwe are not
making making
purposely purposely
making missingmaking missing
data value data value
in MATLAB still it brings a kind
in MATLAB
rmation. On the off chance still
that ityou
brings
don'ta know
kind of information.
about On the in
missing qualities offyour
chance that
information this lead
you don’t know about
ulation or examination of information. missing qualities in your information this leads to
calculation or examination of information.
For instance, that you unknowingly plot a vector containing NaN value, the NaN does not show up on
nds even plotFor instance,
function basedthat you typically
on NaN unknowingly
focusesplot a vector containing
on remaining NaNbevalue,
plot which may inaccurate.
the NaN does not show up on the grounds even plot function based on
OGRAM NaN typically focuses on remaining plot which may be inaccurate.
Program
anData = [1:9 NaN];
>>nanData = [1:9 NaN];
(1:10,nanData)
plot(1:10,nanData)
Output

TPUT

e chance you process normal information but still outcome is obtained as NaN. For this sit
ul to know ahead of time information containing NaN function and afterward overlook or exp
as normal information data.
4 A Practical Approach for Machine Learning and Deep Learning Algorithms

By the chance you process normal information but still outcome is


obtained aschance
By the NaN. you
Forprocess
this situation, it is morebut
normal information useful to know
still outcome ahead ofastime
is obtained NaN. For this situat
information
more useful tocontaining
know ahead ofNaN
time function
informationand afterward
containing overlook
NaN function or expeloverlook
and afterward it or expel i
before processing
processing as normal as normal data.
information information data.

PROG
Program
>>meanData = mean(nanData)
>>meanData = mean(nanData)
meanData =
meanData =
NaN NaN
One approach
One approachto to
find
findNaN in information
NaN in information is utilizing
is utilizing the
the NaN NaN function,
function, which restores a coherent
showing the area of any NaN value.
which restores a coherent exhibit showing the area of any NaN value.
Program
PROGRAM = ismissing(xDatetime)
TFdatetime
TFdatetime = 1x5 logical array
1 TFdatetime
0 0 0 0= ismissing(xDatetime)
Assume you are working with a table or timetable made up of factors
TFdatetime = 1x5 logical array
with numerous information writes. You can discover the greater part of the
1 0qualities
missing 000 with one call with minimal utilization of time.

Assume you are working with a table or timetable made up of factors with numerous information wri
can discover the greater part of the missing qualities with one call with minimal utilization of time.
Pre-requisite to Machine Learning 5

Missing qualities canMissing Missing


speak qualities
to qualities
unusable can speakfor
information to handling
unusable information
or for handlingfor
supplant missing can speak
qualities toesteem
with unusable
or information
use rm missing to fill missin
examination. Use fill missing
supplant missing to supplant
qualities missing
with esteemqualities
or use rmwith esteem
missing to fillormissing inform
use rm missing to fill missing information data.

Numerous MATLAB capacities empower you t


Numerous MATLAB Numerous capacities
having MATLAB
empower you
unequivocally capacities
find, or empower
tofilloverlook themyou
expelmissing first.toFor
overlo
ins
having
qualities, without unequivocally
having whole of a find,
theunequivocally find,fill
vector ororexpel
fill expelthem
containing them first.
NaN For
first. For
values instance,
which yieldsin
instance, in thethe whole
you of
can astraightforwardly
needvector containing
the wholeNaN
ignorevalues
NaNswhich yields the out
event to register of a vector containing
in aggregate by
NaN values which yields the outcome
can straightforwardly as NaN. In any case, you can
the sum function.ignore NaNs in aggregate by utiliz
straightforwardly ignore
the sum NaNs in aggregate by utilizing the ‘omitnan’
function.
option with the sum function.

Data Splitting Groups Groups


Data Splitting and Statistical Calculation
and Statistical Calculation
This portrayal shows information of patients in .mat format which are
This portrayal shows information of patients in .mat format which are reco
recorded as an social events. This illustrate the mean weight and recorded
illustrate the mean weight and recorded figure count then it is converted to strain
addition to that resultant outcome of data are plotted based on values in table.

Data regarding patient


6 A Practical Approach for Machine Learning and Deep Learning Algorithms

figure count then it is converted to strain readings of all patients data. In


addition
Data Splittingto that and
Groups resultant outcome
Statistical of data are plotted based on values in
Calculation
table.
This portrayal shows information of patients in .mat format which are recorded as an social events. This
illustrate
Datathe mean weightpatient
regarding and recorded figure count then it is converted to strain readings of all patients data. In
addition to that resultant outcome of data are plotted based on values in table.
Gather data from 100 patients through data sample.
Data regarding patient
>> load patients
Gather data from 100 patients through data sample.
Conversion of Self Assessed Status of Health in to categorical arrays
>> load patients
>> Gender
Conversion = categorical
of Self Assessed Status of Health in (Gender);
to categorical arrays
SelfAssessedHealthStatus = categorical
>> Gender = categorical (Gender);
(SelfAssessedHealthStatus);
SelfAssessedHealthStatus = categorical (SelfAssessedHealthStatus);
whos
whos

Mean Weight Calculation


Mean Weight Calculation
Classify the variable of patients as non smoker and smoker variables. Social affair of smoker variable
Classify the variable of patients as non smoker and smoker variables.
contribution are calculated from mean weight variables.
Social affair of smoker variable contribution are calculated from mean
PROGRAM
weight variables.
>>Program
[G,smoker] = findgroups(Smoker);
meanWeight = splitapply(@mean,Weight,G)
>> [G,smoker] = findgroups(Smoker);
meanWeight = splitapply(@mean,Weight,G)
meanWeight =
149.9091
161.9412
Pre-requisite to Machine Learning 7

Group function is denoted as G, for evaluating number of smokers vector


count are calculated. Apply mean function of splitting variables of social
event with mean interface of vector weights. For event identification yield
the social event as debate variable for event occurrence. Smoker smart
attributes variables for smoker in desire qualities. The party identifiers are
smart attributes because Smoker contains sensible qualities. As a second
variable smoker patients are get-together for evaluating variables.
Program
>>smoker
smoker =
0
1

Mean weight of the patients are classified based on the smoker status and
sexual orientation of patients.
>> G = findgroups (Gender, Smoker);
meanWeight = splitapply(@mean,Weight,G)

meanWeight =

130.3250
130.9231
180.0385
181.1429

The remarkable mixes across 4 variables based smoker identifier and


Gender for patients together classified variables are stated as follows: male
nonsmokers & smokers and male nonsmokers & smokers. In the below
table consolidated events of mean weight and social events are stated as
follows:
> [G,gender,smoker] = findgroups (Gender,Smoker);
= table (gender,smoker,meanWeight)
=
gender smoker meanWeight

Female false 130.32


Female true 130.92
Male false 180.04
Male true 181.14
8 A Practical Approach for Machine Learning and Deep Learning Algorithms

Gender group contains clear cut qualities and smoker contains consistent
qualities. The information kinds of these table factors coordinate the
information about gender of smoker.
>>meanBMIfcn = @ (h,w)mean( (w ./ (h.^2) ) * 703);
BMI = splitapply (meanBMIfcn,Height,Weight,G)

BMI =

21.6721
21.6686
26.5775
26.4584

Patients BMI (Body Mass Index) are presented based on social occasion of
patients. Data conflicts of patients are classified based on height, weight,
register BMI and two data conflicts.
Gathering Self-Reports of Patients
Based on the poor or fair classification of patients data are categorized.
Regardless, split apply classifies patients in different measures as follows:
female nonsmokers & smokers and male nonsmokers & smokers. At this
point just check those patients categorized as Poor or fair can be utilizing
honest goodness asking for S and G. Through this two approaches of
checks, enlist the portion for each social affair.
Program
>> [G, gender, smoker] = findgroups (Gender, Smoker);
S = SelfAssessedHealthStatus ;
I = ismember (S, {‘Poor’ , ‘Fair’ });
numPatients = splitapply(@numel, S, G);
numPF = spiltapply(@numel, S(I), G(I);
numPF . /numPatients

ans =
0.2500
0.3846
0.3077
0.1429
Pre-requisite to Machine Learning 9

Diastolic recording of patients are calculated for standard deviation based


on Fair health or poor health status of patients, in similar manner health
condition of patient are reported in to health condition of Good or Excellent
status of patient.
Program
>>stdDiastolicPF = splitapply (@std, Diastolic(I),
G(I) );
stdDiastolicGE = splitapply (@std,Diastolic(~I), G(~I)
);

In below table consolidated value of patients are stated for patients and
recordings of variety of patient health in Fair or Poor health conditions of
patients are demonstrated as follow table.
Program
>> T = table(gender,smoker,numPatients, numPF,
stdDiastolicPF, stdDiastolicGE, BMI)
T =
gender smoker numPatients numPFstdDiastolicPF stdDiastolicGE BMI
Female false 40 10 6.8872 3.9012 21.672
Female true 13 5 5.4129 5.0409 21.669
Male false 26 8 4.2678 4.8159 26.578
Male true 21 3 5.6862 5.258 26.458

4. Importing and Organizing Data

4.1 Data Types


Data type’s variables and conversion are stated as characters, tables, cell
arrays, structures and conversion of data type and numeric arrays.
Numeric Types
Numeric type considered are data of floating- point and integer type.
MATLAB® include numeric class for checked and unsigned numbers for
single-precision and twofold exactness of numbers as points. Obviously,
MATLAB retrieve data for each and every numeric motivator in twofold
precision floating point. In this manner any number are stored and grouped
number in single-precision value. Exactness of twofold exactness in single
precision of groups memory capable of each number.
10 A Practical Approach for Machine Learning and Deep Learning Algorithms

Double-precision arrays
>> x = 10;
whos x
Name Size Bytes Class Attributes
X 1x1 8 double Creation
You can make a twofold exactness exhibit utilizing the [] operator, such
as A = [1 2 3; 4 5 6]. What’s more, numerous capacities return twofold
accuracy clusters, such as sin.
Syntax
Y = double(X)
Description
Y = double(X) converts the values in X to double precision
Precision using the double function
Integer
Integer Classes
MATLAB® has 4 checked and 4 unsigned entire number classes. Stamped
makes enable you to work with negative entire numbers and furthermore
positive, yet can’t addresses the unsigned number in sorts either positive
or negative. In broad numbers unsigned structure are stated in degree of
expansion in huge numbers either positive or zero.
In number data MATLAB able to support number bytes of 1, 2, 4 and
8-bytes. You can use For every individual task memory and execution time
depends on accumulated data for entire number. Consider the example
entire number of 32-bit need not to store as value of 100.
Consider number class count of 8 where every characteristics are stored
are different kind and MATLAB try make required changes:
Creation of Data Integer
In MATLAB numeric data are stored as twofold precision drifting
point (twofold) as per usual. In order to store number data in MATLAB
previously convert the double integer in to desire entire number. Consider
the limits change as described in following table.
Consider a example in this we need to store data number of 325 in 16-bit
entire number allotted to variable x, typex = int16(325); On off chance
that the number being changed over to a whole number has a partial
part, MATLAB rounds to the closest number. On the off chance that the
desire entire number. Consider the limits change as described in following table.
Consider a example in this we need to store data number of 325 in 16-bit entire nu
allotted to variable x, typex = int16(325); On off chance that the number being changed o
whole number has a partial part, MATLAB roundsPre-requisite to the closest number.
to Machine 11the off chan
Learning On

the fragmentary part is exactly 0.5, at that point from the two similarly adjacent whole nu
MATLABfragmentary partsupreme
picks the one is exactlyesteem
0.5, at that point amount:
in large from the two similarly adjacent
whole numbers, MATLAB picks the one supreme esteem in large amount:

In case
In case ififyou
youwant
wantto change the data
to change the format of number
data format in defaultinformat
of number default format w
we have different characteristics to change the function. Fewer functions
different characteristics to change the function. Fewer functions consider for data conver
consider for data conversion are listed as follows: round, fix, floor and ceil.
listed as follows: round, fix, floor and ceil. In this fix function engages as default variable
In this fix function engages as default variables then it will be rounded off
will be rounded off to zero where their is no nonzero parts are listed.
to zero where their is no nonzero parts are listed.
x = 325.9;
int16(fix(x))
ans =
int16
325

Math activities that include the two whole numbers and skimming point
dependably result in a number information write. MATLAB rounds the
outcome, when vital, as per the default adjusting calculation. The case
beneath yields a output of 1426.75 in MATLAB at that point round off in
following most noteworthy whole number:
int16(325) * 4.39
ans =
int16
1427
12 A Practical Approach for Machine Learning and Deep Learning Algorithms

The TheThe whole


whole number number
change change capacities are additionally
capacities valuable while chan
whole number change capacitiesareareadditionally
additionally valuable
valuable while
while changing
classes,
classes, for example,
for example, strings,
strings, to wholeto whole
numbers: numbers:
changing over different classes, for example, strings, to whole numbers:

In thethe
event if youyou
change valuevalue
of NaN
ofinto number class than its resultant
In the In
event ifevent
you ifchangechange
value of NaN NaN
into into number
number class
class than itsthan its resultant
resultant outcom o
outcome
as 0 as is
inestimated
whole as 0
number as in whole
format. number
Example format.
of this Example
is stated of
as this is
follows:
as 0 stated
as in whole number format. Example of this is stated as follows:
as follows:

Integer Classes Arithmetic Operation


IntegerInteger
ClassesClasses Arithmetic
Arithmetic Operation
Operation
MATLAB can perform whole number math on the accompanying kinds
ofMATLAB
MATLAB information:can perform
can perform whole whole
numbernumber math
math on theon the accompanying
accompanying kinds
kinds of of in
informat
Integers
Integers or or
Integers number
or number
number varieties
varieties of a similar
varieties of awhole
of a similar number
similar
whole information
whole
number number write.
information
information write. wr
T
This yields
outcome an
that outcome
has that
similar has similar
information information
are stated are
as:x =stated as:x
uint32([132= 347 528])
outcome that has similar information are stated as:x = uint32([132 347 528]) .* uint
uint32([132 347 528]) .* uint32(75);

InInpoint
point numbers
numbers itit can
canbebeeither
eitherwhole
wholenumber or integers
number basedbased
or integers on two
on two folde
folded manner scalar qualities are stated. This resultant point produces
qualities are stated. This resultant point produces same information write as the
same information write as the whole number operands:
operands:
In point numbers it can be either whole number or integers based on two folded m
qualities are stated. This resultant point produces same information write as the w
operands:
In point numbers it can be either wholePre-requisite
number to orMachine
integers based13
Learning on two folde
qualities are stated. This resultant point produces same information write as the
operands:

EveryEvery
single paired
single task task
paired in which one one
in which operand
operandis aisvariety
a varietyof number
of number information c
the exception
information ofcompose
64-bit whole
(with thenumbers)
exceptionand the other
of 64-bit wholeisnumbers)
a scalar and
twofold,
the MATLA
activity
Every utilizing
other is a scalar
single component
twofold,
paired in insightful
task MATLAB
which one twofold
figures accuracy
the activity
operand math
utilizing
is a variety and afterward
component
of number chan
information
outcome back
insightful to the
twofold first number
accuracy math information
and afterward write.
changes For parallel
over
the exception of 64-bit whole numbers) and the other is a scalar twofold, MATL the tasks
outcome including a
number back to the
exhibit
activity first number
also,component
utilizing information
a scalar twofold,
insightful write.
MATLAB For parallel
twofoldformsaccuracy tasks including
the movement just as math
math and afterward c
a 64-bit
bit outcome
are wholefor
considered number exhibitaccuracy
increasing also, a scalar
rather twofold,
than MATLABloss.
minimizing forms
back to the first number information write. For parallel tasks including
the movement just as math type of 80-bit are considered for increasing
number
Integer exhibit
Class inrather also,
Larger a Smaller
scalar twofold,
andminimizing Value MATLAB forms the movement just as m
accuracy than loss.
bit are considered for increasing accuracy rather than minimizing loss.
Integer
ForClasseachin entire
Largernumber
and Smaller dataValue
compose, greater and most reliable nu
Integer Class in Larger and Smaller Value
addressed
For eachforentire
numbernumber data.
dataFor this similar
compose, greater andto table formatnumber
most reliable integers are dem
can be addressed
diminutive For eachforentire
characteristics number data. For
for creation
number ofthis similar
"Extent
data oftoValues"
compose, table format
greaterarea. integers
and most reliable
are demonstrated
addressed for in
number diminutive
data. characteristics
For this similarfor creation
to table of “Extent
format of
integers are d
The functions
Values” area.intmax('int8') is utilized to identify intmax and intmin qualities.
diminutive characteristics for creation of "Extent of Values" area.
The functions intmax(‘int8’) is utilized to identify intmax and intmin
The functions intmax('int8') is utilized to identify intmax and intmin qualities.
qualities.

In the event that you change over a number that is bigger than the m
estimation of a whole number information write to that compose, MATLAB sets it t
esteem. So event
In the also,
In thein the
that you
eventeventthatthat
change youchange
over
you achange
number over
thataaisnumber
over number that
bigger than isislittler
thatthe most
bigger than the th
than ba
of estimation
theextreme
whole estimation
number information
of a whole writing
number MATLAB
information sets
write it
to to the
that
of a whole number information write to that compose, MATLAB sets base
compose, esteem.
MATLAB
esteem. sets in
So also, it to
thethe greatest
event that esteem. So also,
you change overina number
the eventthat thatisyoulittler than the
Consider following example,
of the whole number information writing MATLAB sets it to thewhole
change over a number that is littler than the base estimation of the base esteem.
number information writing MATLAB sets it to the base esteem.
Consider following example,
14 A Practical Approach for Machine Learning and Deep Learning Algorithms

Consider following example,

Moreover,
Moreover, when when the delayed
the delayed consequence
consequence of aofnumber
a number juggling assignm
juggling
Moreover,
entire numbers when the delayed
outperforms the consequence
best (or of aestimation
slightest) number juggling
created assignment
data sets, in in
t
assignment including entire numbers outperforms the best (or slightest)
entire sets
numbers outperforms
most minimal valuethe best (or slightest) estimation created data sets, in this M
estimation created datafor
sets,consideration:
in this MATLAB sets most minimal value for
sets most minimal value
consideration: for consideration:

Floating Point Number


Floating Point Number
MATLAB®
Floating Point Number provides skimming in either of point in twofold single-
MATLAB® provides
precision skimming
or precision in either
mastermind. In of point precision;
twofold in twofolddefault
single-precision
value is or preci
MATLAB® provides
set to be skimming
that direct in either
change in of point
work is in twofold
obtained single-precision
through single or
precision precision
mastermind. In twofold precision; default value is set to be that direct change in w
mastermind.value.
In twofold precision; default value is set to be that direct change in work is
obtained through single precision value.
Creatingsingle
obtained through Floating-Point
precisionData
value.
Creating Floating-Point Data
Utilize twofold exactness to store esteems more prominent than roughly
Creating Floating-Point Data
3.4 x 1038 or not precisely around - 3.4 x 1038. The number lies between
Utilize twofold exactness to store esteems more prominent than roughly 3.4
Utilize twofold
precisely aroundexactness
- 3.4 x to storeThe
1038. esteems
number more
lies prominent than two
between those roughly
limits3.4
arex eith
103
precisely aroundwith
precision - 3.4utilization
x 1038. The number lies
of minimal between
memory. those two limits
Performance are either
Metrices Analysisuse
precision with utilization of minimal memory. Performance
logistics growth and infrastructure development in India Metrices Analysis for ev
Pre-requisite to Machine Learning 15

those two limits are either uses single-precision with utilization of minimal
memory. Performance Metrices Analysis for evaluating logistics growth
and infrastructure development in India
Double-Precision Data Creation
In MATLAB default double numeric is defined based on the task
explanation in two folded manner as below:
The whos function demonstrates that in MATLAB type double value are estimate
x = 25.783
one in
The whos the
The whos name
functionofdemonstrates
x: demonstrates
function that in
thatMATLAB type type
in MATLAB double valuevalue
double are estimated
are estim
The whos function demonstrates that in MATLAB type double value are
one inone
theinname of x: of x:
the name
estimated by, one by one in the name of x:

Use of float if you essentially need to affirm x as drifting number value. In this lim
as of Usedesire
1Use
for of floatdrifting
if you essentially
point with need to affirm x as drifting number value. In function:
Use float
thisof
if you
float
limit if essentially need sensible
you essentially
is consider need
as 1 for desire
information
to drifting
affirm x as drifting
to affirm
point xwith
0 as
as sensibledifferent
number
drifting number point
value. In this
value.
information In limit
this
as 1 for desire
as01asfor drifting
desire point
different point
drifting with sensible information 0 as different point function:
point with sensible information 0 as different point functio
function:

This can be converted into other data formats like numeric, strings, cha
two This
folded
can manner
This can
This
be be inbeMATLAB
canconverted
converted converted
into other datafunction.
into other
into data
other
formats With
data
like the
formats precision
like
formats
numeric, point
numeric,
strings, delineation
strings,
likecharacter
numeric, charac
strings,
evaluated
two folded
two for
datafolded checking
inmanner manner
two folded whole
in manner
MATLAB number.
in MATLAB function.
in MATLAB WithWith
function.
function. the precision
With point
the precision
precision delineation
point
point delineatc
evaluated for checking
evaluated
delineationforchangeswhole
checking number.
are whole number.
evaluated for checking whole number.

Single-Precision Data Creation


Single-Precision DataMATLAB
In default
Single-Precision Creation
Data stores numeric data information in default manner
Creation
sole exact number
In default it
In defaultshould
MATLAB have
MATLAB single
stores capacity
numeric
stores dataconversion
numeric number
information
data informat.
in default
information manner
default fo
mann
sole exact number
sole exact it should
number have have
it should singlesingle
capacity conversion
capacity number
conversion format.
number format.
16 A Practical Approach for Machine Learning and Deep Learning Algorithms

Single-Precision Data Creation


In default MATLAB stores numeric data information in default manner
for making it sole exact number it should have single capacity conversion
number format.
x = single(25.783);

In MATLAB whos function is utilized to restore structure of variable x


characteristics. This structure describes x when it has been put solely and
it requires 4 bytes with 8 bytes double values:

You canYou can change


change other numerical
other numerical number information
number information either characters
either characters
You can change other numerical number information either cha
legitimate
or stringsinformation for information
and legitimate accuracy utilization
for accuracyin utilization
single function.
in singleSingle-accu
legitimate information for accuracy utilization in single function. Sing
function.
marked overSingle-accuracy pointinarethe
changes presented marked over changes
numerical point: presented in the
marked
numerical over changes presented in the numerical point:
point:

Arithmetic Operations over Floating-Point Number in MATLAB


Arithmetic
Arithmetic Operations
Operations over
over Floating-PointNumber
Floating-Point Numberin
in MATLAB
MATLAB
Thisfunctional
This functionalarea
areafacilitates
facilitates class
class of of depicts
depicts in which
indepicts
which point
point number tasks are
number
This functional area facilitates class of in which point number t
tasks are obtained.
Double-Precision Operations
Double-Precision Operations
Double-Precision Operations performance considered for number-crunching act
The essential functional
The essential functional performance considered for number-crunch
double The
or any otherfunctional
essential form. It must contain at least one
performance whole number for operand
double or any other form. It must considered
contain at for number-crunching
least one whole number for op
Resultant outcome
activities ofof
class double
doubleinteger
or anyare listed
other as Itbelow:
form. must contain at least one
Resultant outcome of double integer are listed as below:
whole —
 single number for operand
Resultant in scalar
in single form. Resultant outcome of double
type function
 single — Resultant
integer are listed as below: in single type function
 double
 double
 int* or uint* — Similar to integer operand it has same data type.
 int* or uint* — Similar to integer operand it has same data type.
 char
 char
 logical
Double-Precision Operations
The essential functional performance considered for number-crunching ac
double or any other form. It must contain at least one whole number for operand
Resultant outcome of double integer are listedPre-requisite
as below: to Machine Learning 17
 single — Resultant in single type function
 • single — Resultant in single type function
double
 int*• or
double
uint* — Similar to integer operand it has same data type.
 char• int* or uint* — Similar to integer operand it has same data type.
 • char
logical
• logical
The below stated example provides result in double for input arithmetic perform
The below
double stated example provides result in double for input arithmetic
data type.
performance char and double data type.

Single-Precision
Single-Precision Operations
Operations
 • You
You can can perform
perform essential
essential number number juggling
juggling taskstasks in single
in single or any
or any other differen
other different task classes however outcome is obtained as single
however outcome is obtained as single for any of following characteristics: for
any of following characteristics:
 Single class
• Single class
 Double class
• Double class
 Char class
• Char class
 Logical class
• Logical class
Consider as following example in this double class is set as 7.5 default value wher
Consider as following example in this double class is set as 7.5 default
single class:
value where the result is single class:

Class of Floating Point in Largest and Smallest Values


In single and double classes we can able to write the coding for biggest va
MATLAB.
18 A Practical Approach for Machine Learning and Deep Learning Algorithms
Class of Floating Point in Largest and Smallest Values
Class of Floating Point in Largest and Smallest Values
In single and double classes we can able to write the coding for big
In single
MATLAB.and double classes we can able to write the coding for biggest
value integer in MATLAB.
Largest and Smallest Double-Precision Values
Largest and Smallest Double-Precision Values
In double dataIntype
double data typefunction
of MATLAB of MATLAB
realmax function realmax
and realmin and realmin co
composes
least qualities as follows:
minimal and least qualities as follows:

In MATLAB
In MATLAB positive and negative
positive infinity infinity
and negative ranges are assigned
ranges are based on based on
assigned
the function realmax and -realmax function respectively. In this number
and -realmax function respectively. In this number higher than realmax are
higher than realmax are positive and number lower than -real max are
lower than -real max are negative values as stated below:
negative values as stated below:

Single-Precision Largest
Single-Precision andand
Largest Smallest Values
Smallest Values
MATLAB
MATLABfunction
functionwith
withrealmax
realmaxandandrealmintheir
realmintheirwill
willbebea ‘single’ argument to
a ‘single’
of argument
least and to
extreme datatype
single data typeofqualities:
least and extreme data type qualities:
Single-Precision Largest and Smallest Values
Single-Precision Largest and Smallest Values
MATLAB function with realmax and realmintheir will be a ‘single’ argument to s
MATLAB
of least and function withtype
extreme data realmax and realmintheir will be a ‘single’ argument to
qualities:
of least and extreme data type qualities: Pre-requisite to Machine Learning 19

    
Accuracy Calculation
Accuracy in Floating-Point
Calculation Data Data
in Floating-Point
Accuracy Calculation in Floating-Point Data
InIncase
caseif the drifting
if the pointpoint
drifting and estimation are obtained
and estimation correctlycorrectly
are obtained than the than the lim
the limitation
In case
PC’s lies
hardware.in the
if the InPC’s
drifting hardware.
point
results theandIn estimation
results the likelihood
likelihood are are
values valuescorrectly
obtained
had are had than the l
lacking bits of addre
lacking
the PC’srangebits of
hardware.address for minimal accuracy range hence it is considered
accuracy henceInit results the likelihood
is considered values
as truncated are had lacking
consequence value. bits of addr
as truncated
accuracy rangeconsequence
hence it is value.
considered as truncated consequence value.
Double-Precision Accuracy
Double-PrecisionAccuracy
Accuracy
Double-Precision
In two In foldtwo fold precision
precision number itnumber
containsit set
contains set of
of number number
values with values
exact with exac
lies aIn
theirvalues. two foldrange
Inprecision
PC their precision
lies number
a between
precision two
rangeithigher
contains set of
numbers.
between two number
this values
For numbers.
higher with exa
gap between de
their
Forlies
thisagapprecision
betweenrange between
degrees confinestwo higher
results numbers.value
of precision For with
this eps
gap between d
function. In following example division of 5 for precision value is stated
as below:
results of precision value with eps function. In following example division of 5 for
results of precision value with eps function. In following example division of 5 f
value is stated as below:
value is stated as below:
results of precision value with eps function. In following example division of 5
value
20is stated as below:
A Practical Approach for Machine Learning and Deep Learning Algorithms

The above example stated that in two folded manner for division 5 precision r
The above example stated that in two folded manner for division 5 precisio
between 5 and 5 + eps(5). For proper estimation of precision values of 5 the exact
between 5 and 5 example
+ eps(5).stated
For that
proper estimation of precision values5of 5 the ex
calculatedThe
withabove
eps(5)
The function.
above example stated inthat
twoinfolded manner
two folded for division
manner for division 5 precis
calculated withrange
precision eps(5)lies
function.
between 5 and 5 + eps(5). For proper estimation of
between 5 and 5 + eps(5). For proper estimation of precision values of 5 the
In this eps(x) function relies on exact
variable
valuex.isFurther in below example variable x is gre
thisprecision
Incalculated
eps(x)withvalues
function of relies
eps(5) 5function.
the on variable calculated
x. Furtherwith eps(5)
in below function.
example variable x is
MATLABInfunction eps(x):
MATLAB thisfunction eps(x): relies on variable x. Further in below example
eps(x) function
In this eps(x)
variable x isfunction relies
greater than on variable
MATLAB x. Further
function eps(x): in below example variable x i
MATLAB function eps(x):

On the
On the off chance
thatthat eps function have contention
desire contention information to
On off
thechance
off chance epsthat
function
eps have desire
function have desireinformation
contentiontoinformation
eps(1) function in MATLAB for in
exact numberforcalculation from separation value 1.
eps(1)estimate
functioneps(1) function
in MATLAB forMATLAB
exact numberexact number
calculation calculation from
from separation value 1.
On the off chance that eps function have desire contention informatio
separation value 1.
Accuracy of Single-Precision
Accuracy
eps(1) of Single-Precision
function
Accuracy ofin MATLAB for exact number calculation from separation value 1.
Single-Precision
It have certain distance between two single number for precision calculation. Cons
ItIthave
havecertain
certaindistance between two single number for precision calculation. C
Accuracy
an integer of of typedistance
for thatbetween
Single-Precision
single precisiontwo single
count is number
returnedforwith
precision
eps(x) function.
an integer of single
calculation. type
Consider for that
x is anbetweenprecision
integer of singlecount is
typenumber returned with
for that precision eps(x) functi
count
consider below
It haveexample,
certain distance two single for precision calculation.
consider below example,
is returned with eps(x) function. For this consider below example,
an integer of single type for that precision count is returned with eps(x) func
consider below example,

The
The outcome
outcomeisismore
morenoteworthy
noteworthythanthan
eps(5). Since
eps(5). less single-accuracy
Since less single-accuracy numb
The outcome
numbers than is more
twofold noteworthy
accuracy numbers, than eps(5).
openings Since numbers
between less single-accuracy n
twofold accuracy numbers, openings between numbers of single valueofare higher t
twofold accuracy
single numbers,
value are openings
higher than between
gap between numbers
number of values.
precision single This
value are high
between number precision
The outcomevalues.
is moreThis enables single-accuracy
noteworthy number
than eps(5). Since minimal precis
less single-accuracy
between number precision values. This enables single-accuracy number minimal pr
that oftwofold
double accuracy
- precisionnumbers,
value. openings between numbers of single value are hig
that of double - precision value.
between number precision values. This enables single-accuracy number minimal
that of double - precision value.
Pre-requisite to Machine Learning 21

enables single-accuracy number minimal precision than that of double -


precision value.
For doubleFornumber stated asstated
double number x provides aggregate
as x provides upper header
aggregate upper for
header for eps
eps(single(x))
For double
it changes when it changes
number
from double from
to stated
single as double to
x provides
value. single value.
In caseaggregate In case when
upper header
when precision for eps(si
value exactness
precision
it changes value exactness obtained asIn3.14 inwhen
singleprecision
number than for
in single number than for double value it is calculated as double(single(3.14) -ob
from double to single value. case value exactness 3
double
in single value itthan
number is calculated
for doubleas double(single(3.14) - 3.14).
value it is calculated as double(single(3.14) - 3.14
ans
ans==
ans =

Floating-Point
Floating-Point Arithmetic Common
Arithmetic Common Point Avoidance
Point Avoidance
Floating-Point Arithmetic Common Point Avoidance
All errands
All function of MATLAB
errands function are performed
of MATLAB in two folded
are performed in twomath
folded math pr
precision
IEEE 754 based
All errandson
standard.IEEE 754
function
Since ofstandard.
MATLAB
PCs Since PCs simply
are performed
simply address address
numbersin twonumbers
foldedtomath
restricted prec
precisio
IEEErestricted to precision value (twofoldaddress
exactness relatedrestricted
to 52 bits),
exactness related to 52 bits), nonintuitive results are obtained via numericalv
754 standard. Since PCs simply numbers to precision
nonintuitive
exactness results
related to 52are obtained via numerical computation. In MATLAB
MATLAB this are notbits), nonintuitive
considered as bug. results are obtained via numerical co
this are not considered as bug.
MATLAB this are not considered as bug.
Utilize
Utilizeaccompanying caseswhich
accompanying cases whichenable
enable to to distinguish
distinguish cases
cases mentioned below:
mentioned
Utilize accompanying
below: cases which enable to distinguish cases mentioned below:
Illustration 1 — Round-Off or What You Get Is Not What You Expect
Illustration 1 —1Round-Off
Illustration — Round-Off or What You
or What YouGet
GetIsIsNot
Not What YouExpect
What You Expect
In beloe example 4/3 decimal number is nor precision value its in two-folded
In beloe
In Further
beloe example 4/3
example decimalnumber
number isis nor
nor precision
precision value itsitsinintwo-
resultant4/3 decimal
value is not obtained as 0 instead it isvalue
denoted two-folded pr
as eps.
Further resultant value is not obtained as 0 instead it is denoted 0asinstead
folded precision value. Further resultant value is not obtained as eps.
it is denoted as eps.

Similarly, 0.1precisely represents paired number. Along these lines, accompany


Similarly,
conduct 0.1precisely
Similarly, represents
0.1precisely
value paired
represents
is obtained: number.
paired Along
number. these
Along lines,
these accompanying
lines,
conduct value is obtained:
accompanying non intuitive conduct value is obtained:
Similarly, 0.1precisely represents paired number. Along these lines, accompanying n
22 A Practical Approach for Machine Learning and Deep Learning Algorithms
conduct value is obtained:

In computation order of operation is not possible:


In computation order of operation is not possible:
In computation order of operation is not possible:
In computation order of operation is not possible:

Between skimming point numbers their lies holes. With increase in num
higher: Between skimming point numbers their lies holes. With increase in numb
Between
Between
higher: skimming skimming pointtheir
point numbers numbers theirWith
lies holes. liesincrease
holes. With increase in num
in number
higher:
holes get higher:

In this π is actual number, further sin(pi) is also not exactly zero:


In thisInπthis π is actual
is actual number,
number, further
further sin(pi) is also
sin(pi) notnot
is also exactly zero:zero:
exactly
In this π is actual number, further sin(pi) is also not exactly zero:

Example 2 —Cancellation of Catastrophic


Example
Exactly 2 —Cancellation
operands inofcomparable
Catastrophicmanner operation of subtraction is perform
Examplewith
2 —Cancellation of Catastrophic
Exactly
sudden with operandsis in
cancellation comparable
performed. Themanner
going operation of cancellation
instance for subtraction isleads
perform
to
Pre-requisite to Machine Learning 23

Example 2 —Cancellation of Catastrophic


Example 2 —Cancellation of Catastrophic
Exactly with operands in comparable manner operation of subtraction is
Exactly with
performed, operands
in all of suddenincancellation
comparable manner operation
is performed. The goingofinstance
subtraction is pe
sudden cancellation
for cancellation leads is
to performed.
overpoweringThe going instance
(precision for cancellation leads
loss for insignificant
(precision loss for insignificant development).
development).

In MATLAB
In MATLAB function for sudden
function for cancellation fewer examples
sudden cancellation fewerare utilized
examples are ut
which are expm1
expm1 and log1p. and log1p.
Example 3 — Operation of Floating-Point and Linear Algebra
Example 3 — Operation of Floating-Point and Linear Algebra
Round-off value, cancellation and diverse qualities skimming guide math
unite toward Round-off value,figuring
make startling cancellation and diverse
when dealing with thequalities
issues ofskimming
direct guide
make startling
factor based figuring
math. MATLAB when dealing
alerts with
that the thewith
going issues of direct
matrix A is notfactor based
alerts
very much shaped and along these lines the system Ax = b may beand
that the going with matrix A is not very much shaped along these li
fragile
=
to blittle
mayirritations:
be fragile to little irritations:

These
These are are
just just a couple
a couple of theof the indicating
cases cases indicating
how IEEE how IEEEpoint
coasting coasting point
math influences
calculations calculations inThe
in MATLAB. MATLAB. The calculations
calculations performedperformed
in IEEEin 754 numb
IEEE 754 number
influenced; which juggling are influenced;
incorporates which
applications incorporates
written in C orapplications
FORTRAN and MAT
written in C or FORTRAN and MATLAB
COMPLEX NUMBER
Complex Number
ComplexComplex
numbers numbers contain
contain two two
distinct distinct
parts parts
as real and as real and Inimaginary. I
imaginary.
parts
this imaginary parts are square root of -1 unit. In MATLAB this real andparts are de
are square root of -1 unit. In MATLAB this real and imaginary
orimaginary
j. parts are denoted by letters i or j.
With announcement exhibits one
With announcement technique
exhibits one for making for
technique an making
astounding
an astounding
MATLAB. In this variable x is defined by many - sided precision value of two p
not available value.
Complex numbers contain two distinct parts as real and imaginary.
parts are square root of -1 unit. In MATLAB this real and imaginary parts are de
or j.

24
With announcement exhibits one technique for making an astoundin
A Practical Approach for Machine Learning and Deep Learning Algorithms
MATLAB. In this variable x is defined by many - sided precision value of two
not available value.
an function in MATLAB. In this variable x is defined by many - sided
precision value of two part and part 3 as not available value.
x = 2 + 3i

In MATLAB another approach for dealing with complex number


In MATLAB another approach for dealing with complex number
is utilization of complex function. In this limit solidifies numeric
complex
commitments of twoInnumbers
function. this limit solidifies
with marvelousnumeric commitments
yield, influencing mainoftotwo number
yield, influencing main to include bonafide
include bonafide and the second nonexistent: and the second nonexistent:

YouYoucan can isolate


isolate a mind
a mind boggling
boggling numbernumber
as realasand
realimaginary
and imaginary
part by part by util
for real:
utilizing the function for real:

Infinity and NAN


Infinity and NAN
Infinity

MATLAB® represents unprecedented value inf. Boundlessness comes


view of errands like division by zero and surge, which provoke results excessiv
making it impossible to address as general skimming point regards. MATLAB mo
Pre-requisite to Machine Learning 25
Infinity and NAN

Infinity
Infinity
MATLAB® represents unprecedented value inf. Boundlessness comes to
MATLAB® represents unprecedented value inf. Boundlessness comes
fruition in view of errands like division by zero and surge, which provoke
view of errands like division by zero and surge, which provoke results excessiv
results excessively sweeping, making it impossible to address as general
making it impossible to address as general skimming point regards. MATLAB mo
skimming point regards. MATLAB moreover gives a limit based on IEEE
limitarithmetic
based ondepiction
IEEE arithmetic depiction asininf
as inf for permeability for permeability
positive in positive
manner regarded as mann
double-precision.
double-precision.
CoupleCouple instance
instance of declarations
of declarations which which
leads toleads to positive
positive or negative bou
or negative
boundlessness in MATLAB
MATLAB is showed up here. is showed up here.

Use Use
the the is inf
is inf functiontotoaffirm
function affirmthat
that xx isispositive
positiveoror
negative perpetuation:x
negative perpetuation:x = log(0
= log(0);

NaN
NaNMATLAB addresses esteems that are not a complex numbers with a one of
a kind regard called NaN, which stays for “Not a Number”. Explanations
MATLAB
like 0/0 and inf/inf addresses esteems
result in NaN, thatcalculating
as do any are not aexercises
complex numbers with a
including
regard called NaN, which stays for "Not a Number". Explanations like 0/0 an
a NaN:
in NaN, as do any calculating exercises including a NaN:

MATLABfunction
MATLAB function NaN
NaN returns
returns depiction
depiction of IEEE
of IEEE doubledouble scalar value. Fo
scalar value.
value for hexadecimal is stated as follows,
26 A Practical Approach for Machine Learning and Deep Learning Algorithms
MATLAB function NaN returns depiction of IEEE double scalar value. For s
MATLAB function NaN returns depiction of IEEE double scalar value. For s
value
Forfor hexadecimal
significant is stated
NaN value as follows, is stated as follows,
for hexadecimal
value for hexadecimal is stated as follows,

ToTo
evaluate thethe
evaluate array elements
array of NaN
elements MATLAB
of NaN always
MATLAB uses
always isnan
uses function:
isnan
To evaluate the array elements of NaN MATLAB always uses isnan function:
function:

MATLAB
MATLAB software
software represent
represent a"Not provides
a”Not a Number” a Number" provides curre
current value
MATLAB software represent a"Not a Number" provides curre
NaNof representations
NaN in alternate
representations in manner
alternate mannerfurther it itdeals
further with
deals withassorted
assorted depictions e
NaN representations in alternate manner further it deals with assorted depictions
NaN. Regardless,
depictions in certain
equivalently uncommon
for NaN. stages
Regardless, (due
in certain to gear hindrances),
stages MATLAB
NaN. Regardless, in certain uncommon stages (due touncommon
gear hindrances), MATLAB
right piece
(due casehindrances),
to gear for NaN representation
MATLAB doesinnotalternate
have right manner
piece all
casethrough
for estimat
right piece case for NaN representation in alternate manner all through estimat
configuration portrayed
NaN representation beforehand
in alternate bit of
manner all NaN.
through estimation rather uses
configuration portrayed beforehand bit of NaN.
NaNconfiguration portrayed beforehand bit of NaN.
Logical Operations
NaN Logical Operations
NaN Logical Operations
Generally, two NaN functions are proportional to each other it de
Generally, two NaN functions are proportional to each other it de
exercises for two
Generally, returning false value
NaN functions with involvement
are proportional to eachof NaN
other beside
it deals a test lopsided
with
exercises
lucid for returning
exercises for false false
returning valuevalue
withwith
involvement of of
involvement NaNNaN beside
besideaatest lopside
NaN):
NaN):
test lopsidedness, (NaN ~= NaN):

numerical value in 5-digit display based on settled points.


e appeared at going with:
Pre-requisite to Machine Learning 27
Numeric
NumericValueDisplay
ValueDisplayFormat
Format
Default
Default
NumericDisplay
Display
ValueDisplay Format
Default Display
Normally,
Normally, MATLAB
MATLABprovides
providesnumerical
numericalvalue
valueinin5-digit
5-digitdisplay
displaybased
basedon
onsettle
settl
Normally,characteristics
Numeric
Numeric MATLAB provides
characteristics numerical
value
valueappearedvalue
appeared ingoing
5-digit
atatgoing display based on
with:
with:
settled points. Numeric characteristics value appeared at going with:
Settled
Settled point
Settled pointin
point inin5-digit display
5-digitdisplay
5-digit asasdrifting
displayas drifting
driftingpointororor
point
point with
with
with two
twotwo significant
significantvalue.
significant value.
value. point with 15-digit display with gliding point or two points best value
Settled
Settled point with 15-digit display with gliding point or two points best value
Settled point with 15-digit display with gliding point or two points best
Minimal
value whole
Minimal wholenumber
numberproportion
proportion
Minimal whole number proportion
Hexadecimal
Hexadecimal(base
(base16)
16)
Hexadecimal (base 16)
Bank
Bankdocumentation
Bank documentation
documentation
Eachand
Each
Each andevery
and everyopen
every open course
opencourse ofofaction
courseof action are
arerecorded
actionare recorded
recordedininin
reference
referencepage
reference page
pageformat.
format.
format.
Example
Exampleofof
Example ofDisplay
DisplayFormat
Display Format
Format
In these two or
InInthese
thesetwothree
two ororinstances
three of the distinctive
threeinstances
instances ofofthe courses ofcourses
thedistinctive
distinctive action
coursesand
ofofthe
action
actionand
andtheth
yield
from
fromthe conveyed
thegoing from
goingwith the going
withtwo-part with two-part
two-partasasxxvector, as x vector,
vector,different different
differentdegrees degrees
degreessection
sectionarearestated
statedasasf
section are stated as follows:
Current
Currentformat
Current setting
formatsetting
format checking:
settingchecking:
checking:

Previously
Previouslyset
setvalue
Previously set
totoxxand
valueto
value xand
anddisplay
display
display
inin5-digit
5-digit
in 5-digit
scaled
scaled
scaled
fixed
fixedfixed
point:
point:point:

Set
Setthe
theformat
the formattoto5-digit
format 5-digit floating
5-digitfloating
floatingpoint:
point:
point:
28 A Practical Approach for Machine Learning and Deep Learning Algorithms

Set
Setthe
Set theformat
the format
formattoto
to15-digit scaled
15-digit
15-digit fixed
scaled
scaled fixedpoint:
fixed point:
point:
Set
Set the
the format
format toto
15-digit scaled
15-digit fixed
scaled point:
fixed point:

InIn
Insmall
In integer
small
small ratio
integer
integer format
ratio
ratio formatneed
format needtoto
need set'rational'
toset
set 'rational'
‘rational’
'rational'output: output:
output:
small
In integer
small ratio
integer format
ratio need
format needto set
to set 'rational'output: output:

InIn
Inhexadecimal
hexadecimal
In format
hexadecimal
hexadecimal integer
format
format
format integervalue
integer
integer valueisis
value isset
is settoto
set
set toxxxxand
to andused
and usedfor
used fordisplay
for with
display
display withbase
with base16:
16:
In hexadecimal
base 16: format integer value is set to and
x andused
usedfor display
for with
display base
with 16:
base 1

Program
Program
Program
Program for
forNumeric
for Numeric
for Numeric
Numeric Setting
Setting Format
Setting
Setting Format
Format
Format
Program for Numeric Setting Format
To by Tochance
by need to modify
chance need tocertain
modifyvalues in program
certain values instead
inin of numeric
To
To by
by chance
chance need
need to
to modify
modify certain
certain values
values inprogram
program
program instead
insteadofof
instead ofnume
num
num
the values,
principle get
Tothe byprinciple
chance
affiliation affiliation
need
utilizing to utilizing
modify
similar similar
certain
function function
values
addition in
to addition
program
variable. toinstead
The pathof nu
the principle
the principle affiliation
affiliation utilizing
utilizing similar
similar function
function addition
addition to to variable.
variable. The pathtow
The path tt
variable.
the The path
principle towards
affiliation strategysimilar
utilizing will reestablish
function the settingto
addition utilizing
variable. The path
will
will
willreestablish
reestablish
reestablish the
thesetting
setting
thethe
settingutilizing
utilizing
utilizing appeared
appeared
appeared function
function
functionhere:
here:
here:
appeared
will function
reestablish here:
setting utilizing appeared function here:
Program for Numeric Setting Format
To by chance need to modify certain values in program instead of n
the principle affiliation utilizing similarPre-requisite
functionto Machine
addition to variable.
Learning 29 The pat
will reestablish the setting utilizing appeared function here:

Integer Type
Combining Integer Type
Overview
Overview
Overview
If you join particular number created system (e.g., set apart in unsigned
Ifyou
value or If8-bityou joinparticular
join
entire particular
numbers number
innumber createdsystem
16-bit).created system
Typically, (e.g.,set
(e.g.,
in MATLAB set apartininunsign
apart
with unsig
entirenumbers
entire
compose numbers inin16-bit).
of typical 16-bit). Typically,
Typically,
function ininMATLAB
all structure MATLAB
are withIn
with
segmented. compose
compose
MATLAB ofoftypical
typicalfunc
fu
are
are segmented.
segmented. InIn MATLAB
MATLAB resulting
resulting system
system are
are set
set to to desire
desire
resulting system are set to desire data kind uttermost left segment data data
data kind
kind utte
utterm
datacross
data
cross cross section.
section.
section. Forexample,
For
For example,example, thedelayed
the
the delayed delayed consequence
consequence
consequence going with going
going withinterface
with
interface interfaceth
checked
checked entire
entire numbers:
numbers:
three 16-bit vector checked entire numbers:

Exampleofof
Example
Example ofCombining
CombiningInteger
Combining IntegerSizes
Integer Sizes
Sizes
In the wake
InInof
theimpairing
the
wake the
wakeofof whole number
impairing
impairing link notices
thewhole
the whole number
number as link
appeared above,
linknotices
noticesasasappeared
appearedab
connect the
accompanying accompanying
accompanyingtwo twonumberstwo numbers
numbersonce
onceand once and
andafterward afterward
afterwardswitch switch
switchtheir their
theirrequest.
request.The
Thearri
ar
request. The arrival esteem relies upon the request in which the whole
uponthe
upon therequest
requestininwhich
whichthe
thewhole
wholenumbers
numbersare areconnected.
connected.The Thefurthest
furthestleft
lef
numbers are connected. The furthest left write decides the information
informationcompose
information composeofofvector
vectorcomponents:
components:
compose of vector components:

Theprinciple
The
The principle principle
action actionreestablishes
action
reestablishes reestablishes
16-bit number 16-bit
16-bit number
number
vector. vector.Entire
Entire vector.
numbers Entirenumb
num
vector
vector count.
count. InIn this
this element
element are
are set
set toto 127
127 with
with function
function int16(5000),
int16(5000),
returns 8-bit vector count. In this element are set to 127 with function the
the
motivating force for a 8-bit checked
motivating force for a 8-bit checked number. number.
Similartenets
Similar tenetsapply
applytotovertical
verticallink:
link:
30 A Practical Approach for Machine Learning and Deep Learning Algorithms
The principle action reestablishes 16-bit number vector. Entire num
vector count. In this element are set to 127 with function int16(5000), the
int16(5000), the most outrageous motivating force for a 8-bit checked
motivating force for a 8-bit checked number.
number.
Similar
Similar tenets applytotovertical
tenets apply verticallink:
link:

Note
Note
You can
You canlocate thethe
locate mostmost
extreme or leastorqualities
extreme for any MATLAB
least qualities for anywhole
MATLAB who
number write
utilizing utilizing
the intmax andtheintmin
intmax and intmin
functions. functions.like
Functions Functions
realmaxlike
and realmin a
realmax
coasting. and realmin are used for point coasting.
Signed withPresently
Unsignedsimilar
Combination
exercise is marked and unsigned with whole numbe
Signed with Unsigned Combination
furthest similar
Presently left component
exercise is decides the unsigned
marked and informationwith write
whole for all components
numbers.
network:
Once more, the furthest left component decides the information write for
all components in the subsequent network:

MATLABevery
MATLAB assesses assesses
elementevery element concatenating
concatenating prior into aprior into a consolidated
consolidated
accompanying proclamation assesses to a 8-bit marked number (equivalent to value 50) an
cluster. As such, the accompanying proclamation assesses to a 8-bit marked
number with unsigned number in 8-bit (i.e in this value is set to zero as unsigned value instea
number (equivalent
consolidated as twoto components.
value 50) andInprovided
second with whole number
component with however g
holds esteem
unsigned number
unsigned int8 type:
in 8-bit (i.e in this value is set to zero as unsigned value
instead of 50) preceding are consolidated as two components. In second
component holds esteem however goes up against the unsigned int8 type:
MATLAB
MATLAB assesses
assesses every
every element
element concatenating
concatenating prior prior into
into aa consolidated
consolidated cc
accompanying MATLAB assesses
accompanying proclamation
proclamation assesses to
assesses toevery
aa 8-bit
8-bitelement
marked
marked concatenating
number
number (equivalentprior into
(equivalent to a consolida
to value
value 50)
50) and
and
numberaccompanying
number with
with unsigned proclamation
unsigned number
number in assesses
in 8-bit
8-bit (i.e
(i.e into a
in this8-bit
this valuemarked
value isis set
set tonumber
to zero
zero as (equivalent
as unsigned to value
unsigned value
value instea5
instea
number
consolidated with
as unsigned
two number
components. in In8-bit (i.e
second in this value
component
consolidated as two components. In second component holds esteem however g is set to
holds zero as
esteem unsigned
however value
g
consolidated as two components. InPre-requisite second tocomponent
Machine Learningholds 31esteem howe
unsigned
unsignedint8 type::
int8type
unsigned int8 type:

Combining
Combining
Combining Integer
andand
Integer
Integer NonNon
and Non Integer
Data Data
Integer
Integer Data
Combining Integer and Non Integer Data
In the event Inthat
In theyouevent
the join numbers
event that with double,
that you
you join single, or with
join numbers
numbers logical classes,single,
with double,
double, single, oror lo
l
all components
components In
havethe event
subsequent that
lattice you join
provided numbers
with with
information double,
kind single,
components have have subsequent
subsequent lattice
lattice provided
provided with
with information
information kind
kind furthest
furthest ll
components
furthest leftinstance, have subsequent
whole number. In certain lattice provided
instance, components with information kind furt
In
In certain
certain instance, components
components accompanying
accompanying are setaccompanying
are set to
to int32
int32 vector:
vector:
are setIntocertain instance, components accompanying are set to int32 vector:
int32 vector:

Empty
Empty Matrices
Matrices
Empty
Empty Matrices
Matrices
In theIn the
Inevent event
event that
the that
In theyou buildyou
that
event
you build
build aa framework
a framework
that
framework
you buildof amatrix
of
of matrix
framework
matrix
element element
element
matrix,
of where
matrix
matrix,
matrix, w
element matr
w
overlooked
overlooked
void lattices as
as subsequent
subsequent
overlooked grid:
grid:
as subsequent
overlooked as subsequent grid:grid:

Concatenation
Concatenation Examples
Examples
Concatenation
Concatenation Examples
Examples
Single and double type combination
Combination of single and double value matrix provide double value. In
this 5.73*10^300 is excessively tremendous, making it impossible secured
as single function, (In this the function class is used as a piece of this case
reestablishes the data compose for the data regard).
Singleand
Single anddouble
doubletypetypecombination
combination
Combination of
Combination of single
single and
and double
double value
value matrix
matrix provide
provide double
doubl
5.73*10^300isisexcessively
5.73*10^300 excessivelytremendous,
tremendous, making
making itit impossible
impossiblesecured
securedas
assingle
single
the function class is used as a piece of this case reestablishes
the function class is used as a piece of this case reestablishes the data comp the data com
32 A Practical Approach for Machine Learning and Deep Learning Algorithms
regard).
regard).

Double and
Double and Integer
Integer type
typeCombination
Combination
Double and Integer type Combination
Joining entire number characteristics with double values yields a number
Joining
cross section.
Joining Note entire
that
entire number characteristics
the halfway
number with
part of with
characteristics double
pi isdouble values
changed yields aa number
in accordance
values yields number cross
cross se
s
halfwaypart
halfway partof
ofpipiisischanged
changedininaccordance
accordancewithwiththe
thenearest
nearestentire
entirenumber.
number.(The
(Theint8
int8function
functionuu
with the nearest entire number. (The int8 function used as a piece of this
casechanges
case changesover
overits its numericconflict
conflicttotoaa8-bit
8-bitnumber).
number).
case changes over numeric
its numeric conflict to a 8-bit number).

Double
Double
Double and
and
and Character
Character
Character type
type combination
type combination
combination
Toretain
To retain character
character matrix
matrix valuesvalues of double
ofdouble
double and character
andcharacter
character needto beneed
tobe to be
combined.
To retain character matrix values of and need combined.
combined.
InInInthisscenario
this scenarioMATLAB
MATLABvalues
this scenario
valuesare
arechanged
MATLAB values
changedto
todouble
doubleelement
are changed
elementvalue
valueto
to double element
toequivalent
equivalent character v
value to character va
equivalent character values:

Doubleand
Double andLogical
Logicaltype
typeCombination
Combination
Double and Character type combination
To retain character matrix values of double and character need to be combined.
Pre-requisite to Machine Learning 33
In this scenario MATLAB values are changed to double element value to equivalent character va

Double
Double andand Logical
Logical typetype Combination
Combination
Double matrix is obtained through combination of double and logical
Double matrix is obtained through combination of double and logical value matrices. MA
value matrices. MATLAB to delineation logical value need to change in
logical value need to change in true and false element:
true and false element:

4.2 Categorical Data Plot


4.2 Categorical Data Plot
Try
Try below examplegiven
below example givenininMATLAB
MATLAB
Categorical Array
Categorical Arraydata
dataplot
plotasas
example
example
Sample Data Load
Sample Data Load
Data of 100 patients to load sample data
Data of 100 patients to load sample data
Program
PROGRAM
>> load patients
Whos
Name
>> load patients Size Bytes Class Attributes
Age 100x1 800 double Diastolic
Whos
100x1 800 double
Gender 100x1 12212 cell
Name Size Bytes Class
Age 100x1 800 double
34 A Practical Approach for Machine Learning and Deep Learning Algorithms

Height 100x1 800 double


LastName100x112416 cell
Location 100x115008 cell
SelfAssessedHealthStatus 100x1 12340 cell
Smoker 100X1 100 logical
Syatolic100x1 800 double
Weight 100x1 800 double
X 1x1 8 double
Creation of Character Vectors through Categorical Arrays from Cell Arrays
In workplace of vector variable and location of cell are presented with
vector character with three of kind restorative offices where patients were
watched. To access and think about information all the more effortlessly,
convert Location to an absolute exhibit.
Program
>> Location = categorical (Location);
>>summary (Location)
County General Hospital 39
St. Mary’s Medical Center 24
VA Hospital 37
>> SelfAssessedHealthStatus = categorical
(SelfAssesedHealthStatus,…
{‘Poor’ ‘Fair’ ‘Good’ ‘Excellent’}, ‘Ordinal’,
true) ;
>> summary (SelfAssessedHealthStatus)
Poor 11
Fair 15
Good 40
Excellent 34
>>figure
histogram (SelfAssessedHealthStatus)|
title (‘Self Assessed Health Status From 100
Patients’)
Excellent 34
>>figure
histogram (SelfAssessedHealthStatus)|
Pre-requisite to Machine Learning 35
title (‘Self Assessed Health Status From 100 Patients’)
Output OUTPUT

PROGRAM
>>figure
Program
histogram(Location(SelfAssessedHealthStatus<=’Fair’) )
>>figure
title(‘Location of Patients in Fair or Poor Health’)
histogram(Location(SelfAssessedHealthStatus<=’Fair’) )
title(‘Location of Patients in Fair or Poor Health’)
Output OUTPUT

PROGRAM
>>figure
36 A Practical Approach for Machine Learning and Deep Learning Algorithms

Program
>>figure
pie (SelfAssessedHealthStatus) ;
title (‘Self Assessed Health Status From 100
Patients’)
Output

ProgramPROGRAM
>>figure>>figure
A = countcats (SelfAssessedHealthStatus);
A = countcats
C = categories (SelfAssessedHealthStatus);
(SelfAssessedHealthStatus);
pareto (A,C) ;
C = categories (SelfAssessedHealthStatus);
title (‘Self Assessed Health Status From 100
pareto (A,C) ;
Patients’)

title (‘Self Assessed Health Status From 100 Patients’)

OUTPUT
Random documents with unrelated
content Scribd suggests to you:
aconite in proper proportion is administered to reduce fevers and
inflamed conditions. Astrologically, aconite is a herb of Saturn.
Saturn is, like the herb, cold and contracting whilst Mars is warm and
expanding. The blood and mental faculties are liable to disorder in
certain people born with Aquarius rising at birth or with the Sun
therein: and the sapphire was the panacea which also, it was said,
stopped bleeding of the nose if held against the temples. In old
pharmacies the sapphire held a place of importance and its reputed
curative virtue led to its employment as a charm against swellings,
boils, ruptures, profuse perspirations, poisons, melancholy, flatulence
and other bodily inharmonies. It was also employed as a charm
against enchantment, danger, treachery, quarrels between friends,
evil suggestions and undue influence. Porta in his work on “Natural
Magic,” 1561, writes of the value of the sapphire in all magical and
religious ceremonies, protecting the wearer from the Larvae of the
lower spiritual world and from the snakes and poisonous reptiles of
the world of matter. It was considered intensely powerful as a
destroyer of poisonous insects which it was said to kill if placed at
the mouth of a vessel in which they were imprisoned. Boetius (“De
Natura Gemmarum”) writes that the sapphire was worn by priests as
an emblem of chastity, for none of evil thoughts, bad minds or
vicious habits dare wear this gem of pure heavenly love which was
used of old by those consulting the sacred oracles. In his messages
to the Bishops of the 12th century Pope Innocent III asked that they
should have their pure gold rings set with “that stone which is the
true seal of secrecy.” When the Roman Catholic church received her
novices into the Sisterhood a sapphire ring blessed by a Bishop was
given as a holy symbol of the mystical marriage. In the famous
Pulsky Collection—mentioned by Mr. C. W. King—there is a wonderful
intaglio on a fine sapphire of Pope Paul III by the great Alessandro
Cesati, three-quarters of an inch square. St. Jerome (4th and 5th
centuries) wrote that the sapphire saved its wearer from captivity
and pacified his enemies, also that it gained the favour of princes.
Some old authors recommend the sapphire as a stone for the hands
of Kings. It is a stone rather of Democracy. Perhaps, however, the
symbolic idea was that the King as the servant of the people could
adorn his hand with no more fitting emblem. It is traditionally
reported that the ring of King Solomon was a sapphire, which stone
was believed by some of the masters to be the special talisman of
the Jews. One kept in the Holy of Holies as a holy emblem is said to
have been saved and concealed for the people of Israel when Titus
sacked Jerusalem. Moses was born with the Sun rising in the
ascending Aquarius, hence the adoption of either the sapphire as we
know it today or the lapis lazuli as national gems is perfectly natural.
The sapphire in the signet of Constantine, weighing 53 carats, which
now lies amongst the treasures in the Rinuccini Cabinet at Florence,
is cut in intaglio with a portrait of the Emperor in the guise of
Nimrod attacking a great boar with his spear in the Cæsarean plains.
As a gem of heavenly and beautiful thoughts the sapphire was
regarded as a scare against devils, evil forces, witchcraft, sorcery
and all forms of villainy. The Buddhists symbolically say that a
sapphire opens a closed door, brings prayerful feelings and sounds
the sweet bells of peace. It is a stone of truth, constancy, friendship,
goodness and angelic help; it warns against hidden dangers and
heightens the imagination and psychic forces. It rebels against
intoxication and refuses to adorn the hand of a drunkard; it helps
hopes and wishes that are truly just and right. It was the third stone
of the Nao-rattan and the fourth of the seven rings which Iarchus
brought down from the angelic spheres as a gift to Apollonius of
Tyana. It was the fourth stone of the magical necklace of Vishnu,
and according to the Ramayana sapphires fell from the eyes of the
slain god Maha Bali.
An Irish Countess lent for exhibition to the South Kensington Loan
Collection in 1872 the sapphire ring which Lady Scroope threw from
the window of the death chamber of Queen Elizabeth to Sir Robert
Carey who was waiting below for this signal of the Queen’s passing
in order to convey the news post haste to James. In the Sepher of
Solomon “which was set together in the desert by the Children of
Israel in the Holy Name of God, following the influences of the
stars,” a charm for favouring desires, for procuring invisibility, and
certain benefits was a light coloured sapphire on which was
engraved a mermaid holding a twig in one hand and a mirror in the
other. The times for the construction of this talisman (which was to
be set in a ring and worn inwards for escaping the eyes of others)
was when the moon well aspected, was passing through the 5th, 6th
and 7th degrees of the sign Aquarius. Another charm from the same
source is the figure of a young man crowned, a circle round his
neck, his hands raised in prayer, seated on a four-legged throne
supported on the back of their necks by four men standing. The
charm is to be cut on a “cornflower” sapphire for purifying the mind
and obtaining favours from rulers, scholars, priests and people of
wisdom, when the well-aspected moon was passing through the 1st,
2nd, 28th and 29th degrees of Aquarius. In the “Book of Wings,” a
charm advised for gaining wealth and prophetic foresight is an
astrolabe cut on a sapphire, especially when the moon, well
aspected, passes through the 1st, 2nd, 28th and 29th degrees of
Aquarius. Another for health, protection from poison, poisonous airs,
and tyranny was the Bearded Head of a man or a ram engraved on a
sapphire, constructed when the well-aspected moon was passing
through 8th, 9th, 25th and 26th degrees of Aquarius. Dreaming of
sapphires is said to denote protection, social success, and favour
generally.
Beautiful Colour Gems
Kelsey I. Newman Collection

.dv class='tbl'
.ta r:3 r:2
1. | |Beryl | | 17¼ carats
2. | |Aquamarine | | 59⅛ "
3. | |Pink Sapphire | | 3½ "
4. | |Amethyst | | 28 "
5. |{| |}| 14 "
6. |{| Orange Sapphires |}| 4 "
7. |}| |{| 20 "
8. |}| Golden Sapphires |{| ¾ "
9. |}| |{| 2½ "
10. | | Sunlight Sapphire| | 441⁄16 "
.ta-
.dv-

The Asteriated or Star Sapphire, displaying like the Star Ruby, an


opalescent star, is a valued charm for procuring the love of friends,
for constancy and harmony.
All shades of blue and green sapphires are under the zodiacal
Aquarius. White sapphires (called Leucos sapphires) are under the
sign Pisces. Yellow sapphires are under the sign Leo. Amethyst
sapphires are under the sign Sagittarius.
CHAPTER XXIX
SARDONYX—SUCCINITE

SARDONYX: SCHORL: SELENITE: COMPARISONS BY MARBODUS AND MALPLEAT:


PLINY’S ACCOUNT: ANCIENT USE OF SELENITE: USED IN THE PALACE AT
PEKIN: DR. JOHN GOAD AND THE SELENITE OF POPE CLEMENT VIII:
SELENITE AMONGST THE GREEKS: TREVISA’S NARRATIVE: SELENITES OR
LUNARY MEN: A LOVE ATTRACTOR: A CURIOUS TALISMAN: SELENITE AND
PEARLS: SERPENTINE OR HYDRINUS: IDENTIFIED WITH THE TARSHISH
STONE: THE OPHITE STONE OF DIOSCORIDES AND PLINY: AGRICOLA
KNOWS IT AS LAPIS SERPENTIUS: THE RANOCHIA OF ITALIAN ARTISTS: A
CURE FOR RHEUMATIC AFFECTIONS, ETC.: USED BY THE ANCIENTS FOR
FASHIONING ORNAMENTS AND CHARMS: A TALISMAN OF CAPRICORN:
USED IN THE MAKING OF SCARABS AND CYLINDERS: SOAPSTONE OR
STEATITE: ITS EXTENSIVE USE IN ANCIENT EGYPT: PINITE: THE
AGALMATOLITE OR PAGODITE CALLED BY THE CHINESE HAO-CHI: LUCKY
FIGURES AND EMBLEMS: A SAVAGE FOOD: SPHENE OR TITANITE SPINEL OR
BALAS RUBY: VARIETIES: PHENOMENA OF THE SPINEL: ALBERTUS MAGNUS:
ANDREA BACCI: THE PALACE OF THE RUBY: MARCO POLO’S STORY: LAL
RUMANI OF THE INDIANS: THE KING OF OUDE’S SPECIMEN: THE LAL-I-
JALADI: THE BLACK PRINCE’S RUBY AND ITS STORY: SIR JAMES MELVILLE
AND QUEEN ELIZABETH’S “FAIR, GREAT RUBY”: LOVE OF QUEEN ELIZABETH
FOR SPINELS: ROBERT DE BERQUEN AT THE COURT OF THE KING OF
PERSIA: SPINELS AND CORUNDUMS IN RIVER GRAVELS: ELIANUS AND THE
STORY OF THE STORK: ITS SYMBOLIC IMPORT: AN ANCIENT MEDICAL
CUSTOM: A HEALTH STONE: A GARDEN CHARM: SPODUMENE: HIDDENITE:
KUNZITE: RADIUM INFLUENCE ON SPODUMENE AND KUNZITE: SUCCINITE.

SARDONYX. (See ONYX.)

SCHORL. (See TOURMALINE.)

SELENITE
“This stone, a remedy for human ills,
Springs, as they tell, from famous Persia’s hills.”
Marbodus.

The word SELENITE is derived from the Greek SELENE, the moon,
and is found also written as silenite, silonite, silenitis. The stone
which is a crystallized variety of gypsum is in pearly white, green,
yellow and gray colours. Marbodus compares it with soft grass or
verdant jasper, and Malpleat, in 1567, says it is like a fresh and
flourishing green herb. The moon-like lustres whether in pearl-white
or light green are the most esteemed, and Pliny writes that it is
frequently employed in the construction of beehives to enable the
curious to watch the little insects at their wonderful work. The
ancients employed it in much the same way as we do glass, and it
formed an item of considerable trade importance between Rome,
Spain, Cyprus, Africa, Cappadocia and other parts of the ancient
world. Slightly coarser varieties were used by Tiberius to cover his
hot-houses, for it is susceptible of being split into comparatively thin
sheets. A finer variety of very great value was at one time to be seen
in the palace at Pekin. Dr. John Goad, who wrote the Astro-
Meteorologia, a book on the natures and influences of the celestial
bodies, mentions the Selenite which Pope Clement VIII had amongst
his treasures. It was a natural moon dial, of which Cocheram said in
1623, “it decreaseth and encreaseth as the moon groweth.” This Dr.
Goad was a famous scholar who, wrote Cooper, “gained a reputation
for his astrological knowledge founded on reason and experiment.”
The Greeks called the stone Selenitis Lithos, because they said it
waxed and waned with the moon, a belief quaintly expressed by
Trevisa in 1398 as follows: “Selenites is a stone of Perse, grene as
grasse. It shineth with a white specke and foloweth the moon and
waxyth and waneth as the moon doeth.” Some old stories tell of a
belief that little Moon men which Howell, a 17th century writer, calls
“Selenites or Lunary Men,” flung these stones deep in the earth. The
Selenite was regarded as a love attractor and a stone to restore
harmony between quarrelsome lovers. If engraved with a figure of
Diana with bow and arrow when the moon was passing through the
3rd, 16th and 17th degrees of Cancer it increased, say old writers,
the power of imagination and helped the wearer to realize future
movements. If the Selenite be burned and carefully powdered it is
said to be of great use in cleaning pearls (which also are moon-ruled
according to astrology). The Selenite is under the sign Cancer like
the moonstone, with which it is frequently confounded.

SERPENTINE OR HYDRINUS
The name Serpentine appears at different periods as serpentyn,
serpentyne, sarpentene, sarpentin, scharpentyn. It is derived from
the Latin SERPENS, and its more ancient term HYDRINUS indicates
exactly the Sea Serpent family (Hydridæ), so well known to ancient
and modern writers. Precious serpentine is translucent—or about so
—and of a rich oily green colour. Common serpentine is opaque. The
precious serpentine is called “noble,” the impure “common.” The
colours are dark oily green, light green, olive green, black green,
brown yellow, green yellow, sometimes almost white. The
Serpentine is identified with the Tarshish stone, the 10th stone of
the High Priest’s Breastplate. It was known as “Ophite Stone” by
Dioscorides and Pliny, and Agricola writing in the 16 th century calls
it “Lapis Serpentinus.” Other writers called it “Serpentinum,” hence
the modern name “Serpentine.” In Italy, especially amongst artists,
some specimens of the stone are known as “Ranochia,” because of
its similarity to a frog’s skin.
It was recommended of old as a cure for rheumatism and
rheumatic pains in the limbs, and for that purpose specimens were
carried on the body next the skin, attached to the arms or legs. It
was believed to cure dropsy and all moist complaints, especially if
the sufferer held a specimen in each hand whilst resting in the
sunlight. The wearer was also warned not to overdo this sun-bathing
with Serpentine in his hands because of its affinity with all natural
bodily fluids. It was said to be a charm against serpent bites or
stings and to scare away poisonous insects and reptiles of the sea
and land. Serpentine was much esteemed by the ancients for its
healing virtues and peculiar beauty. They effectively employed it in
the manufacture of vases, pillars, boxes, etc., and for the making of
special charms and talismans. The figure of a goat with a fish’s tail
cut on a serpentine when the moon, well aspected, was passing
through the 3rd and 4th degrees of the sign Capricorn, was a charm
against rheumatism, skin troubles, gout, stiff limbs, accidents to the
limbs, falls or hurts.
The Serpentine was largely used by the ancient Egyptians in the
making of sacred scarabs, and the Persians favoured it especially for
shaping into cylinders of authority, one of which is described by Mr.
C. W. King, as follows:
“A King contending with two andro-sphinxes, Ormuzd hovering
above on the Tree of Life”—a very symbolic cylinder.
The Serpentine or Hydrinus is under the celestial Capricorn.

SOAPSTONE OR STEATITE
Steatite derives its name from the Greek word STEAR, fat, which
well describes the greasy feel of this soft magnesian rock—a massive
variety of talc. It was extensively used by the ancient Egyptians who
cut it into scarabs which in many cases they first burnt and then
coated with a vitreous blue or green glaze. The substance is
extremely soft and can easily be cut with a knife. Soapstone figures
are cut from a variety known as PINITE—the Agalmatolite or
Pagodite of China, called by them Hoa-chi. Many of these are very
beautifully cut, a number being lucky figures presented in the guise
of gods and goddesses, flowers, fruits, etc. This custom reminds of
the “Household gods” of the ancients. A kind of soft steatite earth is
still eaten by the savages of New Caledonia and other places.
All varieties of Steatite are under the zodiacal Taurus.

SPHENE OR TITANITE
Sphene derives its name from the Greek SPHEN, a wedge. As the
name indicates the form of the crystals is wedge-shaped. The lustre
is very brilliant but the stone is scarcely as hard as the opal and
therefore is little used in jewellery.
Sphene is under the zodiacal Sagittarius.

SPINEL OR BALAS RUBY


Spinel, which derives its name from the Greek word SPINOS, a
spark, is found written in a variety of ways, chief amongst which are
spinell, spinele, spinel. Its colours are red, brown, green, yellow and
blue. The red varieties are clear and glittering and the dark generally
more dense or opaque.

The name Spinel is applied to those of bright red


colour
The name Balas is applied to those of rose red
The name Rubicelle is applied to those of orange red
The name Almandine Ruby is applied to those of violet
The name Chloro Spinel is applied to those of green
The name Ceylonite or Pleonaste is applied to black
those of
The name Sapphirine is applied to those of blue

Spinel and Balas are often intermixed and both terms are accepted
as denoting this Aluminate of Magnesium, whose hardness is just a
little inferior to the Corundum and whose crystalline form is
isometric, like the diamond. The spinel, however, is non-electric, no
matter if submitted to heat or friction, whilst the ruby (Corundum),
and garnet are highly so. Hence it is not a difficult matter to
distinguish these stones from each other even if their outward
similarities tend to confuse the eye. The spinel, submitted to trial by
heat, first changes from red to brown; if left to cool it becomes dark;
then it changes to green; then, as if exhausted, it seems to lose its
colour which, however, slowly reappears in its red expression.
The word BALAS has been written as balace, baless, balays,
balais, balass. It is derived from the Arabic BALAKHSH which, says
Albertus Magnus, is the female of the real ruby “and some say it is
his house.” That prolific writer on precious stones, Andrea Bacci
(16th and 17th centuries), echoes older thought also when he writes
that “Balas is derived from PALATIUS, a palace, which is the palace
where the ruby lives.” He echoes the symbolic ideas of the old Greek
writers who said that the true ruby resided in a palace—clearly
showing that they knew the difference between rubies and spinels.
Marco Polo’s remarks are as follows: “In this Provence
(Badachschan), those fine and valuable gems the Balas rubies are
found. They are got in certain rocks among the mountains and in the
search for them the people dig great caves beneath the earth just as
is done by miners for silver. There is but one special mountain that
produces them and it is called Syghinan. The stones are dug on the
King’s account and no one else dares dig on pain of death as well as
of seizure of worldly possessions, nor may any take the gems out of
the Kingdom. The King collects them all and sends them to other
kings as tribute or as presents. He so acts in order to keep the Balas
at a great value for if he allowed all persons to mine for them the
world would be filled with them and they would be valueless.” In
Persia there is a story which tells that they were found in a
destroyed mountain after an earthquake. The Indians know the
stone as the “Pomegranate Ruby” (Lal Rumani), and the King of
Oude is said to have had a remarkable and beautiful specimen as big
as the egg of a pigeon, which was known as “Lal-i-jaladi.” The
beautiful heart-shaped Balass which is set in the British Crown under
the Black Cross known as the “Black Prince’s Ruby,” is said to have
been obtained in Spain by Prince Edward when he was aiding Don
Pedro of Castillo to hold his throne. It is reported that this was the
gem worn by King Henry V at the Battle of Agincourt. This may have
been the “fair great ruby” which Sir James Melville says Queen
Elizabeth valued so highly. Elizabeth was very fond of spinels of
which she possessed some splendid specimens, as shown in the still
extant inventories of the personal effects of the Queen. An
inspection of her nativity will show that they were gems of good
omen for her. Madame de Barrera gives an extract from Robert de
Berquen’s “Merveilles des Indes Orientales et Occidentales” wherein
it is stated that “Josephus Barbaro, a Venetian gentleman, says in a
report made to the Signori of Venice that when he was ambassador
for the Republic at the court of Yussum Cassan, King of Persia, on a
certain day of the year 1472 when he was received in solemn
audience, that prince showed him a handkerchief filled with the
rarest and most inestimable precious stones. Among others there
was a table-cut Balass ruby, of a beautiful shape, of at least a
finger’s breadth, weighing two ounces and a half, and of a most
peerless colour: in fact, it was a most perfect paragon, so exquisite
that when the King asked what he valued it at, he replied that he
thought a city or even a kingdom would scarcely pay for it.”
Spinels and corundum are always found together, and Dr. G. F. H.
Smith comments on the fact that although harder stones, rubies in
the river gravels are usually waterworn whilst spinels are found in
perfect crystals. The ancient Zoologist Elianus repeats an old story
that a stork brought a spinel as a present to the woman-nurse
Heraclis for healing his wounded leg. Here again it is necessary to
look beneath the fable for true understanding of it. The stork is one
of the birds of Jupiter and its legs are astrologically under the
zodiacal Sagittarius (the house or mansion of Jupiter). The woman
symbolizes the moon and in her name the afternoon sun is
concealed. The nurse is under Virgo, the sign to which the Spinel is
attached. The 4 toes of the stork symbolize the negative or
afternoon sun, the 3 front toes webbed to the first joint, Jupiter.
Again, the stork has no voice and tells no secrets. Hence we have a
cryptic prescription illustrating the method employed by the ancient
medical brethren to convey their meaning to each other. The spinel
is here an active mineral employed in the treatment, together with
the moon and negative or afternoon sun, of certain afflictions of the
legs. Even today it is a custom amongst medical men to preface
their prescriptions with the symbol of Jupiter. The stork is also
greatly esteemed as a bird of good fortune and happy omen, and in
many countries it is protected against destruction.
The spinel was esteemed as a perfect health stone and was
especially valued as a charm to be worn over the solar plexus. It was
a fortunate gem for doctors of medicine, scholars, writers, clerks,
secretaries, manufacturers, business people, hospital attendants,
nurses, etc. It raised the thoughts and purified the imagination. A
specimen placed at each corner of a house was considered a
protection against calamity, and rough pieces placed at the 4 angles
of a garden, orchard or corn field were said not only to protect the
products from storms and lightning, but also to carry the symbolic
influence of rich returns for the farmer.
The spinel or balas, rubicelle, almandine ruby and the Sapphirine
are under the Zodiacal Virgo. The Chloro-spinel and the pleonaste
are under the zodiacal Capricorn.

SPODUMENE
Spodumene derives its name from the Greek word SPODIOS, ash-
coloured. It is a stone resembling Feldspar, but has a lustre more
pearl-like. In general appearance spodumene is of a pale yellow tint,
sometimes gray or as its name suggests, ash-coloured. It is about
the hardness of quartz. The emerald green variety which is
exceedingly rare, is called Hiddenite, after its discoverer, Mr. M. G.
Hidden, and it is said by Professor Dana to rival the emerald as a
gem. It was discovered in 1881 in North Carolina, which seems to be
the only place of its occurrence. Comparatively few specimens have
been distributed and amongst them no stones of any considerable
size. A pretty example of 2½ carats is in the Natural History section
of the British Museum. Perhaps the most beautiful examples of this
mineral were discovered in the San Diego district of California in
1903 and named Kunzite, after Dr. G. F. Kunz. These stones range in
colour from pale violet to deep lilac and large specimens have
already been unearthed, that in the British Museum weighing 60
carats. Dr. G. F. H. Smith remarks that under the influence of Radium
Kunzite is phosphorescent, thus presenting some difference from
spodumene in general. In analysis it is shown that spodumene
contains 7.5 per cent of lithia. It would be, in harmony with ancient
philosophy, under the zodiacal Libra, although the variety Hiddenite
may be connected with the zodiacal Taurus. All varieties of
spodumene would be regarded as powerful eye charms and as
beneficial to the kidneys and lumbar regions.

SUCCINITE (See GARNET.)


CHAPTER XXX
TITANITE—TOPAZ

TITANITE: TOPAZ: THE MYSTERY OF THE “ISLAND OF THE MISTS”: THE RING
OF THOMAS A’ BECKET CALLED A PERITOT BY THE ABBOT OF
GLASTONBURY: THE MEANING OF THE WORD TOPAZ: TOPAZ REMARKABLE
FOR ITS CLEAVAGE: ITS USE IN ANCIENT AND MODERN MEDICINE: TOPAZ
RHOMBICUS OF THE MINERALOGISTS: M. DUMELLE DISCOVERS HOW TO
CHANGE THE COLOUR OF A TOPAZ: “PINGOS D’AGOA,” “GOUTTES D’EAU,”
“MINAS NOVAS”: “DIAMOND OF SLAVES”: 12 LBS. OF TOPAZ FOR THREE
SHILLINGS: HOW QUEEN MARY’S GREAT BLUE TOPAZ WAS FOUND: THE
TOPAZION STATUE OF PTOLEMY PHILADELPHUS: THE PTOLEMAIC BADGE:
HADRIAN’S TOPAZ: TOPAZ OF THE GRAND MOGUL AND RUNYEET SINGH: A
GIANT EMPEROR’S PLEASURE: SOME OLD INTAGLI: PLINY’S STONE OF
STRENGTH: A STONE AGAINST DEATH AND TERROR: SYMBOL OF BOILING
WATER: A CHARM AGAINST DROWNING: A MODERN ILLUSTRATION: RABBI
BENONI: “BOOK OF WINDS”: TOPAZ CHARMS.

TITANITE. (See SPHENE.)

TOPAZ

“The flaming topaz with its golden beam.”


Glover.

At various times the word has been rendered tupase, tupace,


topace, topas, thopas, topaze, topasie, topazius, topasius. In the
traditional derivation of the word a mystery is concealed. Pliny says
that the stone was found in an island difficult for mariners to locate
on account of the fogs and mists surrounding it, and Marbodus
seems to indicate the true topaz when he says:
“From seas remote the yellow topaz came,
Found in the island of the self-same name.”

The Island was known as Topazios, which owes its origin to the
Greek word meaning “to divine, guess, conjecture.” The misty island
is the celestial Scorpio which is accounted in astro-philosophy the
death sign and the sign of the serpent, the wounder of the heel of
man. It also concerns the goods of the departed, their abode in the
world to come, etc., hence the Island of the Mists, the place of
guess, conjecture or philosophical speculation which the traveller in
the flesh can dimly see through the strange cloudy lights of the
spirit. The name was originally given to the stone known to us as the
Chrysolite which gem is now identified with the occult sign of the
Fishes employed in the mysteries in ancient and modern times. The
classification as we at present know it, is of very ancient date, and
specimens of the modern topaz have been found adorned with
various intagli of proven antiquity. Although it has been stated that
Thomas A’ Becket wore a topaz ring, there is no doubt that Adam
Sodbury, Abbot of Glastonbury, was correct when he says it was a
peridot, for the peridot or chrysolite was the stone of the Churchmen
and intimately associated with the mystic sign of Christianity—Pisces,
the Fishes. The old Abbot wrote that “a gold ring in which was set
the stone peritot (an old form of peridot) encircled the finger of our
Martyr St. Thomas when he was killed by the swords of evil men.” At
that time it is certain that the topaz and the peridot were the stones
known as such today and as such they had been known for many
centuries before.
The Sanscrit word TOPAS, meaning heat, may well describe the
topaz, the colour of which can be changed readily by heat, and
which, under heat pressure and friction, exhibits strong electric
phenomena.
Scorpio, as before remarked, is the sign of the snake or serpent so
intimately connected with the mysteries of life and death, and the
topaz is remarkable for its cleavage, for when struck with a hammer
it breaks into flakes like the backbone of a serpent. The topaz was
considered as of wonderful potency in the treatment of sexual
disorders, which astrologically are considered as disorders of the
sign Scorpio. It contains from 55 to 58 per cent of Alumina, which
substance has been used in modern times by Dr. Richard Hughes,
Dr. Teste, Dr. Peters, Dr. Marcy and others in troubles of the sexual
system and the mucous membranes. The drug has been used
homœopathically in such morbid conditions and in chronic
pharyngitis and diseases of the nose and throat. The nose is ruled
by Scorpio in astrological deductions, and the throat by Taurus, its
opposite sign. Alumina is most strongly expressed in Corundums,
which include the Oriental Topaz, next the chrysoberyl, next the
spinel, and next the topaz, but there are certain characteristics of
the Topaz which in some way render it distinct from other gems, and
these would have been considered by the hermetic schools whence
such philosophy originated. Amongst mineralogists the topaz is
known as Topaz Rhombicus. It is found in colours golden, yellow,
reddish, white, greenish, wine colour and blue. A charming pink is
produced artificially by subjecting the real stone to heat, the best
results being procured from a golden-brown variety. This process
was first discovered by M. Dumelle, a Paris jeweller, in the year
1750. The colour thus obtained is doubtless permanent, the shade
being manifest when the stone cools. Great care must be observed
in this simple experiment because the stone is so sensitive that
unless properly handled it is likely to split under the various degrees
of heat and cold.
Translucent achromatic topaz is called Pingos d’Agoa (drops of
water) by the Brazilians, and Gouttes d’Eau by the French. In
England the variety is called Minas Novas, after the Minas Novas in
the State of Minas Geraes in Brazil where it is extensively found. In
Portugal this type of topaz is called the “Diamond of Slaves.” The
large British Museum specimen of this White Topaz which, according
to Mr. Emanuel, weighs over 12 lbs. (avoirdupois), was sold for three
shillings by a marine store dealer who used it to hold open his door.
The great blue Queensland topaz in the possession of Queen Mary
of Great Britain is said to have been discovered by a shepherd who,
thinking it was a common stone, threw it at a howling dog during
the night and wakened in the morning to discover the precious
nature of his missile. The Topazion Statue of 4 cubits high which
Pliny mentions as having been made by the order of Ptolemy
Philadelphus to the memory of his sister-wife Arsinoe, has puzzled
investigators. It has been set down as indicating a statue of jasper,
agate, prase, chrysoprase or rock crystal of the Citrine or the Smoky
Quartz varieties. Probably this latter suggestion is right but the real
meaning will no doubt lie in the sign Scorpio, which was known in
old Egypt as the Eagle—(the symbolic badge of the Ptolemaic
dynasty)—and was the sign of material death and spiritual life. The
Emperor Hadrian is said to have had a large topaz ring on which was
engraved:

“Natura deficit,
Fortuna mutatur,
Deus omnia cernit.”

Tavernier writes of a great topaz in the possession of the Grand


Mogul weighing 157 carats and worth about 100,000 dollars.
Runyeet Singh’s topaz, half the size of a billiard ball, was worth
200,000 rupees. The Great Braganza, 1680 carats, which adorned
the crown of Portugal and was supposed to be a diamond, is a white
topaz. One of the pleasures of the giant Emperor Maximilian, of
whose strength so many stories are told, was to crush topazes to
powder in his fingers. Why he indulged in this form of sport is
unknown; probably he found it recreation after killing an ox at a
blow or knocking out the teeth of an unfortunate horse. Mr. King
mentions a Head of Mæcenas on topaz attributed to Solon at
Florence, and another—wrongly attributed to Dioscorides—of a girl’s
head in the Marlborough collection. The Topaz was called “Stone of
Strength” by Pliny for the martial Scorpio is the wrestler’s sign and
the sign of strong people. The power of the topaz was said to
increase as the moon increased, especially if the night orb was at
new or full in the sign Scorpio. It banished the terrors of the night,
protected the wearer during epidemics, soothed the wild passions
and gave a glimpse of the beyond. It banished the fear of death and
secured a painless passing from this life to the next; it gave strength
to the intellect and enabled the wearer to receive impressions from
astral sources. It preserved from miasmatic conditions and lost its
colour when in the presence of poisons. The power attributed to it of
quenching boiling water is symbolic of the fiery Mars, planet of
power in the watery Scorpio. It was also said by the old masters that
the topaz preserved against drowning, and a curious illustration of
this belief came recently under the writer’s notice. He advised the
wife of a well-known Australian to purchase a very beautiful topaz,
which was mounted under his direction as a charm of the sign
Scorpio. During the late war this lady and her daughter had need to
travel to England. The voyage was about half accomplished when
the vessel was submarined. The boat in which the lady and her
daughter were, capsized and all the struggling passengers were
thrown into the sea. She seized a piece of wreckage and supported
her daughter and herself until they were both dragged into a boat
some considerable time after. The lady had clutched the topaz charm
from her neck and was holding it tightly in her hand while struggling
in the water. Just as they got into the boat she felt someone give a
heavy blow on her hand and take the gem from her. She grieved for
the loss of her beautiful topaz charm which she regarded as the
symbol of her own and her daughter’s salvation.
Leonardus said that the topaz was a charm against asthma and
Rabbi Benoni calls it the emblem of strength and the easer of
hæmorrhage. In the “Book of Wings” it is recommended that to
secure favour with kings, princes, nobles and important personages
a topaz engraved with the figure of a flying falcon should be worn.
This charm was to be constructed as a charm of power when the
well aspected moon was passing through the 5th, 6th and 7th
degrees of the heavenly Scorpion. Another topaz charm given is for
acquiring riches: this takes the form of a man holding a lamp. It had
to be mounted in gold and constructed when the increasing moon,
in good aspect to the direct Jupiter and the Sun, was passing
through the 5th, 6th, 7th, 26th and 27th degrees of Scorpio.
In a dream the topaz is a symbol of movement, protection from
harm, poisons, etc. The symbolic dream introducing this stone is a
symbolic message from the departed.
The topaz and its varieties are under the celestial Scorpio.
CHAPTER XXXI
TOURMALINE—ZIRCON

TOURMALINE: ARRIVAL OF SPECIMENS IN LONDON: THE ASH ATTRACTOR: THE


“ELECTRIC STONE” OF LINNÆUS: THE “MAGNETIC” OF LEMERY:
EXPERIMENTS OF ÆPINUS AND LEHMANN: PROFESSOR GOODCHILD’S
EXPERIMENT: SUSPECTED CONNECTION OF THE TOURMALINE WITH
ORIENTAL ALCHEMY: COLOURS OF THE TOURMALINE: THE TOURMALINE
AND THE TOPAZ IN METHYLENE IODIDE: IDENTIFICATION SUGGESTIONS:
PLINY’S LYCHNIS: THE CADUCEUS OF HERMES: TURQUOISE: SAXO AND
ALBERTUS MAGNUS ON ITS VIRTUES: THE PIRUZEH OF THE ARABIANS: THE
CHALCHIHUITL OF THE MEXICANS: IDENTIFIED WITH PLINY’S CALLAIS: A
FAVOURITE ORIENTAL CHARM STONE: A SYMBOLIC THEORY OF ORIGIN:
STONE OF THE HORSE AND RIDER: A RELIGIOUS GEM OF JUPITER: A
CHARM AGAINST THE EVIL EYE: A SENSITIVE STONE: MISTAKES OF
WRITERS: MEDICINAL VALUES: TURQUOISE SET IN STATUES OF BUDDHA:
THE GOLDEN BOW AND TURQUOISE ARROW: GEM OF THE GODS: COLOUR
CHANGES IN TURQUOISE: TURQUOISE AND THE WEATHER: INDIAN RAIN-
STONE: KING TOHESER AND THE TURQUOISE MINES: MAJOR C. MAC
DONALD AND PROFESSOR FLINDERS PETRIE DISCOVER THE OLD
TURQUOISE WORKINGS: LOVE OF THE TURQUOISE IN OLD EGYPT: SOME
UNIQUE STONES: THE GEM IN PERSIA: THE KHORASSAN MINES: STONE OF
FASHION IN 17TH CENTURY EUROPE: DEATH STONE OF JAMES IV OF
SCOTLAND: HENRY VIII SENDS A LAST GIFT TO CARDINAL WOLSEY:
MARBODUS’S TURQUOISE TALISMAN OF FREEDOM: DIFFERENCE BETWEEN
“DE VIELLE ROCHE” AND “DE NOUVELLE ROCHE”: VARISCITE: IDENTIFIED
AS THE CALLAINA OF PLINY: MANÉ ER H’ROCK OR FAIRY ROCK OF
BRITTANY: ZIRCON: STONE OF THE MOON’S NODES: THE SNAKES OF THE
CADUCEUS.

TOURMALINE
“This black thing, one of the prettiest of the very few pretty black
things in the world, is called Tourmaline.”
Ruskin.

The Tourmaline, written in the 18th century in England as Tumalin,


is derived from the Ceylonese TURMALI or TORAMALLI. The first
specimens to arrive in London were known as “Brazilian Emeralds,”
and they came from Brazil in the 17th century only to meet with an
unfavorable reception. In the beginning of the 18th century Dutch
merchants began to bring from Amsterdam specimens obtained by
them from Ceylon. The Dutch cutters, observing how straw and
other particles were attracted to specimens which had been lying in
the sunlight, called the stone in consequence Aschentrekker (ash
attractor). The Germans called it Azchenzieher, and the French Tire-
cendre.
The Swedish scholar Linnæus experimented with the Tourmaline,
calling it the “Electric Stone.” M. Lemery, the French Professor, called
it the “Magnetic.” The experiments of Æpinus and Lehmann were
concerned with the positive and negative energies exhibited by the
Tourmaline. These 18th century scholars held that its power of
repulsion exceeded its power of attraction. This sensitive stone is
affected by weather changes, and it exhibits considerable power
when heated—the electricity then developed being termed pyro-
electric. Professor W. Goodchild, M.B., etc., details an interesting
experiment in dealing with the Physical Properties of Gem Stones:
"A crystal of tourmaline, in heating to 150° C., becomes positively
electrified at one terminature and negatively at the other. If now it
be suspended by a non-conducting thread it will act as a magnet: on
cooling, the charges on the poles reverse, positive becoming
negative. If a crystal with such a charge be dusted with a fine
mixture of sulphur and red lead, the yellow sulphur will be attracted
to the portions charged with positive electricity, while the red lead
goes to the negatively charged portions."
This experiment serves to illustrate the attraction of the mind
(represented by yellow sulphur), towards the positive pole, and
matter (represented by red lead), towards the negative pole, as
noted in the philosophical researches of the old alchemists. If in a
heated state, the tourmaline be shattered all the little pieces will
exhibit the forces of attraction and repulsion so marked in this
strange stone. It has been suspected, not without reason, that
tourmaline specimens were used by some of the Eastern students of
alchemy who held primarily that the substance of the Philosopher’s
Stone is Mercurial and that it should be treated with heat, for by that
means alone would its use be shown, warmth coming from the
Heavens to bless Man, Nature, and the Kingdoms of Nature.
The tourmaline is remarkable also for the variety of its colours,
indicated by various and not always appropriate names. SCHORL,
the black variety spoken of by Ruskin, was so called according to De
Costa (1761) by the German miners. The same writer says “our
English miners call them ‘bockle’ and ‘ball’.” The name appears as
shirl, schirl (so spelt by De Costa), schoerl, shorl. In the 16th century
it was known in Germany as SCHRUL, but later in the 18th century it
appears as SCHORL. The name is now becoming unpopular, the
simple term Black Tourmaline being preferred. The colourless variety
is termed ACHROITE, from a Greek word meaning colourless; pink
and rosy red are termed RUBELLITE; indigo blue, INDICOLITE; blue,
BRAZILIAN SAPPHIRE; green, BRAZILIAN EMERALD; yellow-green,
BRAZILIAN PERIDOT; honey-yellow, CEYLON PERIDOT; red violet,
SIBERITE. The brown variety is usually known as Brown Tourmaline,
although it has been known and still is known as Brazilian Topaz or
Ceylonese Topaz. It is not so hard as the topaz, however, ranging in
the scale somewhere between quartz and zircon. The refractive
powers are likewise not in agreement, and in Methylene Dioxide the
topaz (stone of Mars) sinks, whilst the Tourmaline (stone of Mercury)
floats. There are also amber-coloured, cinnamon, lilac, grey, blue-
grey, water-green and many beautiful parti-coloured specimens.
It is believed by some students that this gem was known to the
ancients by the name LYNCURIUM, which Mr. King believes to be a
species of jacinth, Dr. Brotero an orange-coloured hyacinth.
Professor Ajasson, believing the name to refer to Tourmaline,
suggests that LYN may be derived from the Sanscrit word LANKA,
the name of Ceylon, a place where the stone is plentifully found. The
general opinion now is that the stone described by Pliny under the
name of LYCHNIS is our tourmaline. Pliny writes in his 37th Book on
Natural History of the power of the LYCHNIS of drawing straws and
fluff towards it when heated by the sun or by the friction of the
hand.
The peculiar attractive and repulsive properties of the tourmaline
may be compared with the mysteries contained in the caduceus of
the wise and ever-restless Hermes. The symbolical snakes which
adorn the rod represent knowledge received and knowledge
imparted in the hermetic scheme of the Rosicrucians. The tourmaline
is symbolical of wisdom, strength of mind, eloquence, learning and
the power of knowledge. It is the stone for the author, poet, editor,
and teacher. To dream of it means—in harmony with ancient
philosophy—success through knowledge in all walks of life.
The tourmaline in all colours is under the zodiacal Gemini.

TURQUOISE

“The fair Queen of France


Sent him a turquoise ring and glove,
And charged him as her knight and love
For her to break a lance.”
Sir Walter Scott.

“Turquoise” has been written in a remarkable number of ways,


amongst them being turky, torkey, turquay, turkey stone, turkie,
turkeis, turkese, turkise, turkes, turkas, turkis (as used by
Tennyson), turkoise, turkez, turqueis, turques, turchis, turquesse,
torchas, turcasse, turquez, toorkes, turkesse. The Venetians call it
turchesa, the French turquoise, the Germans turkis. Andrea Bacci
(“De Gemmis et Lapidibus pretiosis,” etc., 1605) says that this stone
is called Turcicus, “Either on account of its admirable loveliness or
for the reason that it is obtained from the Turks.” The name as we
have it does not seem to go further back than the 13th century
when Saxo, agreeing with Albertus Magnus, writes of it and praises
its virtues as a preventive of accidents to the eye. The old Persians
called it PIRUZEH, the Triumphant, and the Arabians, whose special
luck stone the turquoise is, engrave on specimens the name “Allah”
with a verse from the Koran, or with some magical sign inserted in
pure gold. It is known to the Mexicans as CHALCHIHUITL. This stone
is identified with the Callais of Pliny, who relates symbolically that it
was shot down by means of slings from unapproachable rock lands.
The symbol has relation to the power of this stone of the Heavenly
Archer over seemingly terrifying obstacles when firmly directed by
the compelling will.
The turquoise is favoured by Eastern occult students who employ
it largely in the composition of amulets and charms. It was said to
have sprung up like an eye from its matrix, and is identified with the
Antares in the Archer of the Heavens. These stars were indicated as
affecting the eyes in the same degree as the Pleiades and the Asselli
of Taurus and Leo. In modern Egypt a turquoise is applied to the eye
as a remedy for cataract and other ophthalmic troubles, specimens
thus employed being usually engraved with the sacred name of
Allah. The turquoise is especially the stone of horses, mules and
camels, and from most ancient times specimens have adorned their
trappings. Leonardus said that so long as a horseman carried a piece
of turquoise with him whilst riding he would never have an accident,
nor would his horse be fatigued, for it was believed that the stone
would draw the pain of the accident to itself. Boetius de Boodt says
that when riding to his house along an uncertain road on a dark
night he fell with his horse down a declivity but neither he nor his
animal suffered hurt. His turquoise, however, was shattered. The
stone was carried by jockeys, huntsmen and horsemen generally as
a symbol of the special protection of Jupiter. In the Middle Ages the
turquoise was much worn by young girls who regarded it as a
religious jewel for the protection of their virtue and for the uplifting
of their thoughts. In the most ancient science the sign Sagittarius—
the house or mansion of the planet Jupiter—is the sign of sport,
horses, dreams, high philosophy, religion (not in the sense of creed),
the true lamp of life, long voyages, publications (not newspapers),
etc. Thus the turquoise—as the stone of Sagittarius—was a stone of
dreams, the horse, philosophy, religion, etc., and its grand symbolic
purpose was to help the spiritual person to resist the weakness, evils
and temptations so intermixed with material life. The turquoise was
said to be a charm against the evil eye and evil thoughts. The Arabs
say that the stone is sensitive to weather changes and that its colour
is affected by the state of the atmosphere. They knew Jupiter as the
“Cloud Gatherer,” “The Thunderer,” “The God of the Murky Cloud,”
etc., and they connected the turquoise with his powerful works. The
planet Jupiter strong at birth is held to indicate riches and worldly
advantage. The old Arabian writers note a form of magic for
inducing wealth and monetary advantages, performed in the hour of
Jupiter. During this ceremony a turquoise was held in the right hand
and the desires spoken into the stone at which a steady gaze was
directed.
Carelessness has led to error amongst writers. A 16th century
author confuses the topaz with the turquoise, describing the latter as
a “gem of yellow colour” and recommending it as a charm against
the bites of reptiles and stings of insects—qualities ascribed by the
old masters to the topaz, gem of the sign of the Scorpion. Another
writer repeats the error, saying that “this yellow stone reduced to a
powder is helpful in case of stings from scorpions and fearful and
venomous reptiles.” The turquoise was held in esteem for diseases of
the hip—a part of the body astrologically under the sway of
Sagittarius. In this connection the stone was reduced to a paste and
bound flat to the part affected, whole specimens being bound above
and below the seat of the trouble. The turquoise contains a high
percentage of Phosphoric Acid, which is employed in modern
homœopathy for affections of the lungs, astrologically under the sign
Gemini and therefore opposite to the sign Sagittarius. The ancients
advised the turquoise as a lung medicine, not to be taken internally.
The sign Sagittarius is also the sign of prophecy, and the turquoise
set in the foreheads of the statues of Buddha and other images
symbolizes the knowledge of things to come. The golden bow and
the turquoise arrow of the Tibetan legend has especial reference to
the Sun in the sign Sagittarius. Dr. Kunz, quoting from Dr. Berthold
Laufer of the Field Museum, Chicago, refers to this legend as
follows:
“A powerful saint touching the bow and arrow of a blacksmith
transforms the bow into gold and the arrow into turquoise.” The bow
represents the solar rays and the arrow the Heavens, hence it is little
wonder that the turquoise was termed the “gem of the Gods.” The
turquoise was also recommended for diseases of the throat and
heart—as phosphoric acid is today in Homœopathy. In harmony with
an ancient astro-philosophy known as “Planetary Interchanges,” the
turquoise was considered an ideal lovers’ gift—unless the stone was
otherwise than fortunate in the horoscope of the recipient—and a
gift of friendship.

Specimen of Rough Turquoise, Victoria, Australia

The changes of colour in a turquoise have been long noted, and


the lines of the poet Donne are frequently quoted:

“As a compassionate turquoise that doth tell


By looking pale the wearer is not well.”
Boetius tells a story of a wonderful turquoise possessed by a
Spanish gentleman which so lost its colour after his death that it
appeared “more like a malachite than a turkois.” Boetius then says
that his father bought it for very little at the sale of the Spaniard’s
effects and gave it to him. He relates that he had hardly worn it for a
month when “it resumed its pristine beauty and daily appeared to
increase in splendour.” Mr. Harry Emanuel gives a somewhat similar
story concerning a turquoise that lost its lustre with the death of its
owner “as if mourning for its master,” regaining it in its “former
exquisite freshness” when worn by its new owner. A case of this kind
came under the writer’s notice: The wife of a well-known pastoralist
of New South Wales had a bangle of turquoises cut into the shape of
Egyptian scarabs. While travelling in Japan she became ill and the
stones changed from a soft blue to a dull green, regaining their
former beauty when the lady regained her health. One of the oldest
firms of jewellers in the city of Melbourne, Australia, was worried to
find that an exquisite Persian turquoise entrusted to them to mount
in a tiara with diamonds was changing colour whilst in the hands of
their chief “setter.” This craftsman had been complaining for some
days of indisposition. Strangely enough, the gem regained its
beautiful colour on being entrusted to another and healthier
workman.
The connection of the turquoise with weather changes is not
confined merely to Oriental peoples. The Pueblo and Apache Indians
employ it as a rainstone, which they say is always found concealed
at the foot of the rainbow. They place pieces of turquoise on their
bows and fire arms as directing charms for trueness of aim.
This stone is also called the “gem of liberty and benevolence,” and
an old Eastern proverb says: “A turquoise given with the hand of
love carries with it true fortune and sweet happiness.” Another
Eastern belief runs that the turquoise turns pale when danger
threatens the giver. Felton in his “Secrete Wonders of Nature,” 1569,
states that “the turkeys does move when there is any peril prepared
to him that weareth it.” Dr. E. A. Wallis Budge identifies Tcheser of
the 3rd dynasty (3900 B.C.) who built the “Step Pyramid” at
Sakkarah as the Memphian King who worked the turquoise mines of
Sinai. His name is still perpetuated on a rock at Wadi Magharah. It
was at this place that Major C. MacDonald found turquoise in 1849,
and Professor Flinders Petrie in 1905. Professor Petrie also
discovered evidences here of very ancient mining operations. Archaic
specimens of worked turquoise are still being found in Egypt. The
colour appealed to the sons and daughters of Khem who imitated it
to a very great extent in their scarabs, beads, ornaments and other
articles of adornment. In the Vatican collection there are valuable
intaglios and cameos cut in this stone which in some instances retain
their heaven-blue colour to this day. Mr. King mentions a laureated
head of Augustus and the Head of a Gorgon in the Fould collection,
“the original azure converted into a dull green by the action of the
earth.” In Persia the stone was always highly esteemed and the most
perfect specimens are held by the Royal House. The Khorassan
mines near Nishapur are still famous for the remarkable beauty of
the stones won from them. So fashionable was the gem in Europe in
the 17th century that no true gentleman would consider his dress
complete unless his hand was adorned with a ring of Turquoise, for
it was (as a true stone of the Archer) symbolic of the fairness and
high sense of justice of the wearer. The famous turquoises in the
Royal Jewels of Spain were brought from New Mexico somewhere
about this period also. Sir Walter Scott in “Marmion” sings of the
turquoise ring and glove which the French Queen sent to the
Scottish King James IV, with 14,000 crowns of France, begging him
for the love she had for him to raise an army for her sake. It is a
curious fact that the turquoise was the death stone of James IV who
was killed at Flodden Field by an arrow from an archer’s bow. The
turquoise was to him a symbol of error and fatality. Henry VIII sent
the dying Cardinal Wolsey a ring of turquoise by Sir John Russel,
bidding him say to his fallen favourite that he, the King, “loved him
as well as ever he did and grieved for his illness.” For a talisman of
liberty and freedom Marbodus advises that a perfect turquoise be
engraved with a man standing under a beetle. It should be then set
in a brooch of gold and blessed and consecrated; “then the glory
which God hath bestowed shall manifest.” An astrological charm for
wealth and prosperity takes the form of a centaur firing an arrow
upwards, to be engraved on a turquoise, preferably in the hour of
Jupiter with the Moon in good aspect to Jupiter passing the 3rd and
4th degrees of Sagittarius.
True turquoise, termed “de vieille roche,” or Oriental Turquoise,
differs from the fossil turquoise or Odontolite, called “de nouvelle
roche,” or occidental turquoise. Fossil turquoise can be easily
marked by a steel instrument, while true turquoise acts as flint to
steel. A drop of Hydrochloric acid causes effervescence in fossil
turquoise, which when submitted to fire gives out an animal odour.
Fine turquoises are of that heavenly blue colour known as “turquoise
blue,” and they present a waxy appearance. The variety known as
Variscite, supposed to be the Callaina of Pliny, is a soft green stone
found in various forms in prehistoric graves near Mane er H’rock or
Fairy Rock in Brittany, in the State of Utah in the United States of
America, and other places.
The turquoise is under the zodiacal Sagittarius.

ZIRCON. The name zircon is said to be derived from the Arabic


ZIRK, a jewel. It was known in the Sanskrit as RAHURATNA or stone
of the Nodes of the Moon (Caput draconis and Cauda draconis),
called the dragons of Solar and Lunar eclipses. These dragons were
controlled by the magical power of Mercury and may also be
compared to the snakes of the Caduceus. The Zircon is a transparent
to opaque stone and has been noticed more fully under the names
JARGOON and HYACINTH.
The Zircon is under the zodiacal Virgo.
CHAPTER XXXII
STONES IN SHAKESPEARE’S PLAYS

“It seems she hangs upon the cheek of night


Like a rich jewel in an Ethiope’s ear.”
Romeo and Juliet.

Those who labour for the world belong to the world, no matter
which little part of it may be claimed as their birthplace. This applies to
the humblest as well as to the greatest, as in a play the excellence of
individual players contributes to the artistic harmony and influence of
the entire production. So it is that William Shakespeare, the inspired
master of the “spacious times of great Elizabeth,” breaks through the
narrow limits of sea-girt England and encompasses the whole world of
women and men, detaches his unmaterial self from the period of his
earth life and endures—a perpetual source of pleasure, philosophy,
wisdom and music. Throughout his works William Shakespeare
mentions seventeen distinct stones of adornment, viz.: agate, amber,
carbuncle, chrysolite, coral, crystal, diamond, emerald, flint, jet, lapis
lazuli, marble, opal, pearl, ruby, sapphire, turquoise.

AGATE
In Act I, Scene 4 of “Romeo and Juliet,” Mercutio tells of Queen Mab

“She is the fairies’ midwife, and she comes


In shape no bigger than an agate stone
On the forefinger of an alderman.”

In Act 3, Scene 1 of “Much Ado about Nothing,” Hero says that


“Nature never framed a woman’s heart
Of prouder stuff than that of Beatrice”

who would swear that if a man were tall he would be like

“A lance illheaded;
“If low, an agate very vilely cut.”

In Act 2, Scene 1 of “Love’s Labours Lost,” Boyet tells the Princess of


France that Navarre’s heart is

“Like an agate, with your print impressed.”

In King Henry IV, Part I, Act 2, Scene 4, Prince Hal says to Francis:

“Wilt thou rob this leathern jerkin, crystal button, knott-pated,


agate-ring, puke-stocking, caddis-garter, smooth tongue, Spanish-
pouch,...”

Falstaff in Part 2, Act 1, Scene 2, of the same play complains to his


page that he was never “manned with an agate till now.”
(These quotations all serve to show how popular the agate was as a
ring stone in Shakespeare’s time.)

AMBER
Hamlet, in answer to a question, tells Polonius that the “satirical
rogue” whose book he is reading says that old men’s eyes are “purging
thick amber and plum-tree gum” (Act 2, Scene 2), a thought no doubt
suggested by the ancient myth of the “weeping sisters.”
Petruchio asks his “Mistress Kate”:

“Will we return unto thy father’s house


... With amber bracelets, beads, and all this knavery?”
(“Taming of the Shrew,” Act 4, Sc.
3.)

Says Dumain in “Love’s Labours Lost” (Act 4, Scene 3):


Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like