Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

Advanced Course on PYTHON

Prof. Ravishankar Holla, Assistant Professor, ECE, RVCE


Prof. Mahendra B M, Assistant Professor, ECE, RVCE
Prof. Rajesh Sudi, Assistant Professor, ECE, JIT

08/11/2020 Stay Home Stay Safe 1


https://kcir.pwr.edu.pl/~witold/ai/aie_learn_h.pdf

08/11/2020 Stay Home Stay Safe 2


• Define adequately our problem (objective, desired outputs…).
• Gather data.
• Choose a measure of success.
• Set an evaluation protocol and the different protocols available.
• Prepare the data (dealing with missing values, with categorical values…).
• Spilt correctly the data.
• Differentiate between over and under-fitting, defining what they are and explaining
the best ways to avoid them.
• An overview of how a model learns.
• What is regularization and when is appropriate to use it.
• Develop a benchmark model.
• Choose an adequate model and tune it to get the best performance possible.
08/11/2020 Stay Home Stay Safe 3
https://i.imgur.com/mZdJLdg.png

08/11/2020 Stay Home Stay Safe 4


Numerical, Categorical and Ordinal

Mean - The average value


Median - The mid point value
Mode - The most common value
import numpy
data = [99,86,87,88,111,86,103,87,94,78,77,85,86]
x = numpy.mean(data)
x = numpy.median(data)
x = stats.mode(data)
x = numpy.std(data)
x = numpy.var(data)
print(x)
https://i.imgur.com/mZdJLdg.png

08/11/2020 Stay Home Stay Safe 5


BIG DATA SET
import numpy
import matplotlib.pyplot as plt
x = numpy.random.uniform(0.0, 5.0, 250)
plt.hist(x, 5)
plt.show()

Create an array with 100000 random numbers, and display them


using a histogram with 100 bars:
08/11/2020 Stay Home Stay Safe 6
BIG DATA SET

import numpy
import matplotlib.pyplot as plt
x = numpy.random.normal(5.0, 1.0, 100000)
plt.hist(x, 100)
plt.show()

08/11/2020 Stay Home Stay Safe 7


BIG DATA SET

import matplotlib.pyplot as plt
x = [5,7,8,7,2,17,2,9,4,11,12,9,6]
y = [99,86,87,88,111,86,103,87,94,78,77,85,86]
plt.scatter(x, y)
plt.show()

08/11/2020 Stay Home Stay Safe 8


BIG DATA SET

import matplotlib.pyplot as plt
import seaborn as s

s.distplot([0, 1, 2, 3, 4, 5,6,7,8,9])

plt.show()

08/11/2020 Stay Home Stay Safe 9


BIG DATA SET

import matplotlib.pyplot as plt
import seaborn as s

s.distplot([0, 1, 2, 3, 4, 5,6,7,8,9], hist=False )

plt.show()

08/11/2020 Stay Home Stay Safe 10


BIG DATA SET
Generate a random normal distribution of size 2x3 with mean at 1 and
standard deviation of 2:
from numpy import random
x = random.normal(loc=1, scale=2, size=(2, 3))
print(x)

from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns
sns.distplot(random.normal(size=1000), hist=False)
plt.show()
08/11/2020 Stay Home Stay Safe 11
BIG DATA SET
from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns

sns.distplot(random.normal(scale=2, size=1000), hist=False, label='normal')


sns.distplot(random.logistic(size=1000), hist=False, label='logistic')

plt.show()

08/11/2020 Stay Home Stay Safe 12


BIG DATA SET
1. Plot a histogram for the airline
delays
2. Plot the histograms with bar width
corresponding to delay (only
positive delays).
3. Histograms for comparing delay
across airlines

08/11/2020 Stay Home Stay Safe 13


BIG DATA SET
1. Exponential, rayleigh distribution
2. Create an array of weight of individuals. Plot them. Take log
of the values. Plot them. Comment on two plots.

08/11/2020 Stay Home Stay Safe 14


ಧನ್ಯವಾದಗಳು

08/11/2020 Stay Home Stay Safe 15

You might also like