04-Django Basic

Models in Django

Django Models

  • A Django model is the built-in feature that Django uses to create tables, their fields, and various constraints.
  • Each model class maps to a single table in the database.
  • Django Model is a subclass of django.db.models.Model and each field of the model class represents a database field (column).
[Read More]

HTTP request-response lifecycle

Web Request in Django

1.1 ๐—ช๐—ต๐—ฎ๐˜ ๐—ต๐—ฎ๐—ฝ๐—ฝ๐—ฒ๐—ป๐˜€ ๐˜„๐—ต๐—ฒ๐—ป ๐˜†๐—ผ๐˜‚ ๐˜๐˜†๐—ฝ๐—ฒ ๐—ฎ ๐—จ๐—ฅ๐—Ÿ ๐—ถ๐—ป๐˜๐—ผ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฏ๐—ฟ๐—ผ๐˜„๐˜€๐—ฒ๐—ฟ?

The process involves the browser, your computerโ€™s operating system, your internet service provider, the server where you host the site, and services running on that server.

  1. You type url.com in your browser
  2. The browser looks up the IP address for the domain url.com
  3. Then the browser initiate TCP connection with the server
  4. The browser the sends the HTTP request to the server
  5. The server processes the request and sends back a response
  6. The browser then renders the content
[Read More]

05-Statistics

Inferential statistics

Percentiles and Quartiles

A percentile is a value below which a certain percentage of observation or data points lies.

Percentiles show how a given value compares to others. The general rule is that if a value is in the kth percentile, it is greater than K per cent of the total values.

Find percentile of n

P = (n/N) * 100

n = Ordinal rank of values
  = No of values below n
N = Total values in the dataset

P% of the entire distribution falls below the value n

[Read More]

04-Statistics

Inferential statistics

While descriptive statistics summarize the characteristics of a data set, inferential statistics help you come to conclusions and make predictions based on your data.

Inferential statistics have two main uses:

  • making estimates about populations (for example, the mean SAT score of all 11th graders in the US).
  • testing hypotheses to draw conclusions about populations (for example, the relationship between SAT scores and family income).
[Read More]

03-Statistics

Probability distributions

3.1 Probability Distribution Function

A probability distribution is a mathematical function that describes the probability of different possible outcomes for an experiment. Probability distributions are often depicted using graphs or probability tables.

Probability Distribution Function can be categorized into

  • Probability Density Function(PDF)
  • Probablity Mass Function(PMF)
  • Cumulative Distribution Function(CDF)
[Read More]

02-Statistics

Covariance, Correlation, Symmetric Distribution, Histogram

2.1 Covariance

Covariance and Correlation are very helpful in understanding the relationship between two continuous variables.

Covariance tells whether both variables vary in the same direction (positive covariance) or in the opposite direction (negative covariance).

Covariance(x, y) Cov(x,y)=โˆ‘i=1n(xiโˆ’xยฏ)(yiโˆ’yยฏ)nโˆ’1 Cov(x, y) = \sum_{i=1}^{n} \frac{(x_i - \bar{x})(y_i - \bar{y})}{n-1}

[Read More]

01-Statistics

Descriptive stats, Inferential stats

1.1 Statistics

  • Statistics is the science of collecting, organizing and analyzing the data.
  • Used for decision making process
  • Data - facts or pieces of information

1.2 Types of Statistics

  • Descriptive stats
    • It consists of organizing and summarizing the data.
  • Inferential stats
    • It consists of using data you have measured to form conclusion, make predictions.
    • By using sample-data make conclusion on population-data
[Read More]