# Logistic Regression Interview Questions – Part 1

Q1. What is a logistic function? What is the range of values of a logistic function?
The logistic function is as defined below:

f(z)=1(1+e−z)

The values of a logistic function will range from 0 to 1. The values of Z will vary from −∞ to +∞.

# Inferential Statistics – Part 1

## Introduction: Inferential Statistics :

The process of “inferring” insights from sample data is called “Inferential Statistics”

### Basics of Probability:

In the topic we will go through:

• Basic definition of probability
• Multiplication rule of probability
• nCr (Combinatorics)

### Random Variables

Random variables are quantities with distinct characteristics and behavior.

1. Random variables are denoted by capital letters
2. Random variables are associated with random processes
3. Random variables give numbers to outcomes of random events.

# Data Analysis using SQL – Part 3 – Advanced SQL

You now know two types of SQL commands, namely:

• Data Definition Language
• Data Manipulation Language

The Data Definition Language (DDL) is used to create and modify the schema of the database. Commands like CREATE, ALTER and DROP are part of this language.

As a data analyst, you would always be actively involved in data retrieval activities. Here, the Data Manipulation Language (DML) commands would come in handy, e.g. the DML command SELECT, its purpose, various clauses and filtering operations.

### Order by Clause

The SQL ORDER BY clause is used to sort the data in ascending or descending order, based on one or more columns. Some databases sort the query results in an ascending order by default.

The basic syntax of the ORDER BY clause is as follows −

```SELECT column-list
FROM table_name
[WHERE condition]
[ORDER BY column1, column2, .. columnN] [ASC | DESC];
```

The order in which it appears is “select * from table where some_variable = x order by some_variable”.

# Data Analysis using SQL – Part 2 – Database design

## Defining Data Warehouse

A data warehouse would be a central repository of the data of the entire enterprise.

A data warehouse is a collection of data. It exhibits the following properties:

• Subject-oriented: A data warehouse should contain information about a few well-defined subjects rather than containing information about the entire enterprise.
• Integrated: A data warehouse is an integrated repository of data. It contains information from various systems within an organisation.
• Non-volatile: Data values cannot be changed without a valid reason.
• Time-variant: A data warehouse contains historical data for analysis.

## Structure of Data Warehouse

One of the primary methods of designing a data warehouse is called dimensional modelling.

The two key elements of dimensional modelling are facts and dimensions, which are basically different types of variables used to design a warehouse. They are arranged together in a specific way known as a schema diagram.

## OLAP vs. OLTP

### What is OLAP?

Online Analytical Processing, a category of software tools which provide analysis of data for business decisions. OLAP systems allow users to analyze database information from multiple database systems at one time.

The primary objective is data analysis and not data processing.

### What is OLTP?

Online transaction processing shortly known as OLTP supports transaction-oriented applications in a 3-tier architecture. OLTP administers day to day transaction of an organization.

The primary objective is data processing and not data analysis

### Example of OLAP

Any Datawarehouse system is an OLAP system. Uses of OLAP are as follows

• A company might compare their mobile phone sales in September with sales in October, then compare those results with another location which may be stored in a sperate database.
• Amazon analyzes purchases by its customers to come up with a personalized homepage with products which likely interest to their customer.

### Example of OLTP system

An example of OLTP system is ATM center. Assume that a couple has a joint account with a bank. One day both simultaneously reach different ATM centers at precisely the same time and want to withdraw total amount present in their bank account.

However, the person that completes authentication process first will be able to get money. In this case, OLTP system makes sure that withdrawn amount will be never more than the amount present in the bank. The key to note here is that OLTP systems are optimized for transactional superiority instead data analysis.

Other examples of OLTP system are:

• Online banking
• Online airline ticket booking
• Sending a text message
• Order entry
• Add a book to shopping cart

## Star Schema

Facts and dimensions are the two key elements of dimension modelling. A typical problem might involve multiple databases with many different variables and we may not be interested in all the variables. Hence, only some facts and dimensions are combined in a specific manner to create the structure of data warehouse. This structure is called as a schema diagram

A schema is an outline of the entire data warehouse. It shows how different data sets are connected and the different attributes of each data being used for the data warehouse.

# Summary

You learnt about what a data warehouse is and the difference between a data warehouse and a transactional database. You learnt that OLAP systems are Subject-oriented, Integrated, Non-volatile and Time variant.

You learnt that the data warehouse gives an integrated view of the entire organisation and the data is organised for efficiently carrying out analysis. You also learnt the difference between a data warehouse and a transactional database.

You also learnt about facts and dimensions. You also learnt how to arrange facts and dimensions to design a data warehouse. You saw how dimension tables act as the metadata that is the data about data and they enhance the facts table to enhance insights about the data.

# Data Analysis using SQL – Basics of SQL – Part 1

### An introduction to RDBMS and SQL

There are various ways to arrange and manage data in a database. The most common is to arrange the data in tables, which is similar to an Excel file. The table contains multiple columns and rows.

A Database is a collection of related data. But a question still remains unanswered — how do you access this data? The answer is a specific language designed for this purpose, called the Structured Query Language, or SQL.

## Concepts

Tables − In relational data model, relations are saved in the format of Tables. This format stores the relation among entities. A table has rows and columns, where rows represents records and columns represent the attributes.

Tuple − A single row of a table, which contains a single record for that relation is called a tuple.

Relation instance − A finite set of tuples in the relational database system represents relation instance. Relation instances do not have duplicate tuples.

Categories: Machine Learning Tags: Tags: ,

# Euler Problem 4: Largest palindrome product : C Programming Solution

Problem 4:

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.

Find the largest palindrome made from the product of two 3-digit numbers.

Solution Approach:

Brute force method:

1. Create a function that checks a number for being a palindrome.
2. keep multiplying the numbers from 999 X 999 decretmenting one at a time.
3. Find the multiplication and get the highest product and  print
Categories: Programming

# Euler Problem 3: Largest prime factor : C Programming Solution

Problem :

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

Solution Approach :

Simple approach would be to identify all the prime numbers under the square root of the number 600851475143 which divide the the number 600851475143. When you find a prime factor using this method, keep the track of largest such number to get our result. Read More…

Categories: Programming

# Euler Problem 2: Even Fibonacci numbers : C Programming Solution

Problem 2:

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

Solution Approach:

Question starts of with introduction to Fibonacci sequence, which by the way, is a very interesting topic and highly encourage you guys to read about it in web whenever you get time.

Idea is to get the “next” element of Fibonacci series by adding the “present” and “previous” element.  When the element is an even number, add to the “sum” variable. Very simple indeed. Give it a try for yourself before checking the problem solution below. Read More…

Categories: Programming

# Euler Problem 1: Multiples of 3 and 5 : C programming solution

Problem Statement :

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

Solution Approach:

Being the first problem of the series, its quite a simple one. there are many ways to approach this problem.

Most simplest one is  to iterate through all the numbers from 3 to 1000 and check if its divisible by 3 or 5. If they are, just add them to the sum. Read More…

Categories: Programming Tags: Tags: , , ,

# Checklist before formatting your android phone

Well lately I was experiencing some sluggish performance with my android phone. So I decided to format the baby and  bring it back to life. I was sure that later down the road , I will be requiring to do same again. So thought of adding this post in the blog, so that other also can use it.

You can format the phone for other reasons as well. Maybe you install a lot of apps, and some of them are acting a little mischievous, or maybe something has just gone wrong deep down in the system where you have little chance of fixing it. At times like this, you could agonize over tweaks and possible fixes, or you could spend time uninstalling different combinations of apps. But maybe wiping the phone clean and starting over is the best overall option sometimes. Read More…

Categories: Professional, Technology Tags: Tags: , , , ,