Posts

Showing posts from 2018

Machine Learning

Image
What is Machine Learning ? Machine Learning is concerned with design and development of algorithms which allows a computer to improve performance  based on data. Applications of Machine Learning Gmail - Priority inbox  :A sample of user defined important mails are given and machine should identify new important  mails.    Handwritten digit recognition Generating captions with sentiments. Autonomous robotics bioinformatics Medical diagnosis Stock market analysis Types of Machine Learning Supervised Learning       : A pair of a training data and a target is given at a time. At each step,                                            machine learns and refine a mapping form Unsupervised Learning   : Only the data is given. Machine learns the structure inherited in data. Reinforcement Learning : Used in game playing. Other Machine Learning Types   Active Learning :   When building a model, algorithm may choose which data to come next at                         

Normalization

Image
Normalization is a process for evaluating and correcting table structures to minimize data redundancies, thereby reducing the likelihood of data anomalies. Normalization starts by identifying the dependencies of a given relation and progressively breaking up the relation (table) into a set of new relations (tables) based on the identified dependencies. Normal Forms 0NF            Multi-valued attributes exists 1NF           Any multi-valued attributes (repeating groups) have been removed. 2NF           Any partial functional dependencies have been removed 3NF           Any transitive dependencies have been removed BCNF           Any anomalies resulting from functional dependencies have been removed 4NF           Any multi valued dependencies have been removed 5NF           Any remaining anomalies have been removed The table in 0NF : eliminate the nulls by making sure that each repeating group attribute contains an appropriate data va

Constraints

Image
Constraints protect the database from errors. It puts restrictions on database state. Types of Constraints in Relational Model Domain Constraint Key Constraint Entity Integrity Constraint Referential Integrity Constraint  Types of Constraints that cannot be captured in relational model Semantic Constraints (Business Rules)                        eg : Buy one get one free Domain Constraint Value of each attribute in a tuple must be atomic (no repeating values) and consistent with its domain(data type). It could be null if allowed. Key Constraint key constraint specifies that the values in the column declared as a primary key must be unique. Types of keys Candidate Key            A relation has several keys referred to as candidate keys.but one candidate key is unique. it is               called the primary key . Primary Key           An attribute that uniquely identified the each row in a table. Composite Key           Two or

SQL vs NoSQL

Image
SQL databases are primarily called as Relational Databases (RDBMS). NoSQL databases are primarily called as non-relational, aggregate oriented or distributed databases. SQL databases represent data in form of a table. NoSQL databases represent data in a collection of documents, key-value pairs, graph or wide-column stores. SQL databases are vertically scalable ( scaled by increasing the horse-power of the hardware such as CPU, RAM, SSD  etc... ). NoSQL databases are horizontally scalable (scaled by increasing the no of database servers). In SQL databases, ACID (Atomicity, Consistency, Isolation and Durability)    is supported. In NoSQL databases, atomicity is only supported with the content of a single aggregate and ACID is not supported when updating across multiple aggregates. NoSQL database follows the  CAP theorem ( Consistency, Availability and Partition tolerance )

Entity Relationship Diagram (Pat II)

Image
Mapping Binary Relationships One to one Relationship  Partial participation (Partial participation is represented by single lines.)           Not every professor teaches every student. Every student is not learnt by every professor.             Relational Mapping                                                                   Professor ( Name , Phone , Address )                                                                                       ↑FK            Course   ( CourseId  , CourseName , Credits , Name) Total Participation (Total participation is represented by double lines.)             Every professor teaches every student. Every student is learnt by every professor           Relational Mapping                      Professor ( Name , Phone , Address , CourseId , CourseName , Credits) One to many Relationship (Partial participation)           Relational Mapping                                          

Basics of Python

Image
There are two main ways to write and run Python code. You can either: write many lines of code to a file using a  text editor  and then use the Python interpreter to run the entire file write  and  run each line of code, one after the other using the Python  console While the console enables us to quickly evaluate short pieces of code, the text editor enables us to save our code as a text file that we can run over and over again Run the following line of code in the console (notice the omitted  print()  statement) and see what happens: Piece of code: 1288+639 Python, and many programming languages, uses the  order of operations  rules from mathematics to determine the specific priority that expressions have. Here's the ordering: P arentheses E xponent M ultiplication or  D ivision A ddition or  S ubtraction An easy way to remember the order of operations is  PEMDAS . The equals sign ( = ) is called the  assignment operato