1603105200

A lot of events in our daily life follow the binomial distribution that describes the number of successes in a sequence of independent Bernoulli experiments.For example, assuming that the probability of James Harden making his shot is constant and each shot is independent, the number of field goals follows the binomial distribution.If we want to find the relationship between the success probability (*p*) of a binomially distributed variable Y with a list of independent variables _x_s, the binomial regression model is among our top choices.The link function is the major difference between a binomial regression and a linear regression model. Specifically, the linear regression model uses *p* directly as the response variable.

*linear regression*

*The problem of the linear regression is that its response value is not bounded. However, the binomial regression uses a link function (l*) of *p* as the response variable.

*Binomial regression with a link function*

_The link function maps the linear combination of x_s to a value that is between 0 and 1 but never reaches 0 or 1. Based on such criteria, there are mainly three common choices:

*Binomial regression link functions*

_When the link function is the logit function, the binomial regression becomes the well-known _logistic regression. As one of the most first examples of classifiers in data science books, logistic regression undoubtedly has become the spokesperson of binomial regression models. There are mainly three reasons for that.

```
1\. Applicable to more general cases.
2\. Easy interpretation.
3\. Works in retrospective studies.
```

Let’s go over them in detail.

#data-science #classification #binomial #logistic-regression #r

1603105200

A lot of events in our daily life follow the binomial distribution that describes the number of successes in a sequence of independent Bernoulli experiments.For example, assuming that the probability of James Harden making his shot is constant and each shot is independent, the number of field goals follows the binomial distribution.If we want to find the relationship between the success probability (*p*) of a binomially distributed variable Y with a list of independent variables _x_s, the binomial regression model is among our top choices.The link function is the major difference between a binomial regression and a linear regression model. Specifically, the linear regression model uses *p* directly as the response variable.

*linear regression*

*The problem of the linear regression is that its response value is not bounded. However, the binomial regression uses a link function (l*) of *p* as the response variable.

*Binomial regression with a link function*

_The link function maps the linear combination of x_s to a value that is between 0 and 1 but never reaches 0 or 1. Based on such criteria, there are mainly three common choices:

*Binomial regression link functions*

_When the link function is the logit function, the binomial regression becomes the well-known _logistic regression. As one of the most first examples of classifiers in data science books, logistic regression undoubtedly has become the spokesperson of binomial regression models. There are mainly three reasons for that.

```
1\. Applicable to more general cases.
2\. Easy interpretation.
3\. Works in retrospective studies.
```

Let’s go over them in detail.

#data-science #classification #binomial #logistic-regression #r

1598352300

Machine learning algorithms are not your regular algorithms that we may be used to because they are often described by a combination of some complex statistics and mathematics. Since it is very important to understand the background of any algorithm you want to implement, this could pose a challenge to people with a non-mathematical background as the maths can sap your motivation by slowing you down.

In this article, we would be discussing linear and logistic regression and some regression techniques assuming we all have heard or even learnt about the Linear model in Mathematics class at high school. Hopefully, at the end of the article, the concept would be clearer.

**Regression Analysis **is a statistical process for estimating the relationships between the **dependent variables ( say Y)** and one or more

#regression #machine-learning #beginner #logistic-regression #linear-regression #deep learning

1600123860

Linear Regression and Logistic Regression are** two algorithms of machine learning **and these are mostly used in the data science field.

**Linear Regression**:> It is one of the algorithms of machine learning which is used as a technique to solve various use cases in the data science field. It is generally used in the case of **continuous output**. For e.g if ‘Area’ and ‘Bhk’ of the house is given as an input and we have found the ‘Price’ of the house, so this is called a regression problem.

Mechanism:> In the diagram below X is input and Y is output value.

#machine-learning #logistic-regression #artificial-intelligence #linear-regression

1592023980

Take your current understanding and skills on machine learning algorithms to the next level with this article. What is regression analysis in simple words? How is it applied in practice for real-world problems? And what is the possible snippet of codes in Python you can use for implementation regression algorithms for various objectives? Let’s forget about boring learning stuff and talk about science and the way it works.

#linear-regression-python #linear-regression #multivariate-regression #regression #python-programming

1597019820

In this article, I will be explaining how to use the concept of regression, in specific logistic regression to the problems involving classification. Classification problems are everywhere around us, the classic ones would include mail classification, weather classification, etc. All these data, if needed can be used to train a Logistic regression model to predict the class of any future example.

This article is going to cover the following sub-topics:

- Introduction to classification problems.
- Logistic regression and all its properties such as hypothesis, decision boundary, cost, cost function, gradient descent, and its necessary analysis.
- Developing a logistic regression model from scratch using python, pandas, matplotlib, and seaborn and training it on the Breast cancer dataset.
- Training an in-built Logistic regression model from sklearn using the Breast cancer dataset to verify the previous model.

Classification problems can be explained based on the Breast Cancer dataset where there are two types of tumors (Benign and Malignant). It can be represented as:

where

This is a classification problem with 2 classes, 0 & 1. Generally, the classification problems have multiple classes say, 0,1,2 and 3.

The link to the Breast cancer dataset used in this article is given below:

Predict whether the cancer is benign or malignant

- Let’s import the dataset to a pandas dataframe:

```
import pandas as pd
read_df = pd.read_csv('breast_cancer.csv')
df = read_df.copy()
```

2. The following dataframe is obtained:

```
df.head()
![Image for post](https://miro.medium.com/max/1750/1*PPyiGgocvjHbgIcs9yTWTA.png)
```

df.info()

Let us plot the mean area of the clump and its classification and see if we can find a relation between them.

```
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import preprocessing
label_encoder = preprocessing.LabelEncoder()
df.diagnosis = label_encoder.fit_transform(df.diagnosis)
sns.set(style = 'whitegrid')
sns.lmplot(x = 'area_mean', y = 'diagnosis', data = df, height = 10, aspect = 1.5, y_jitter = 0.1)
```

We can infer from the plot that most of the tumors having an area less than 500 are benign(represented by zero) and those having area more than 1000 are malignant(represented by 1). The tumors having a mean area between 500 to 1000 are both benign and malignant, therefore show that the classification depends on more factors other than mean area. A linear regression line is also plotted for further analysis.

#machine-learning #logistic-regression #regression #data-sceince #classification #deep learning