PwC Austria & Alpen Adria Universität Klagenfurt
Klagenfurt 2021
1. Regression
Machine learning task are categorized by the target of the studies problems as follows:
is the problem of identifying the relationship (mathematical model) among different variables
A liner modeling of the relation between two or more variables
Text
\( \omega_1 \) , \( \omega_0 \) are the weights
\( x \) is the independent variable (input/feature)
\( y \) is the dependent variable (decision/output)
The training target of a linear regression is to find the optimum weights \( \omega_1 \) , \( \omega_0 \) that minimize the mean square error \( mse \)
Text
The training target of a linear regression is to find the optimum weights \( \omega_1 \) , \( \omega_0 \) that minimize the mean square error \( mse \)
Text
Text
The training target of a linear regression is to find the optimum weights \( \omega_1 \) , \( \omega_0 \) that minimize the mean square error \( mse \)
Text
\( \ \frac{\partial J}{\partial \omega} \) is the gradient
\( \ \rho \) is the learning rate. Large \(\rho \) large steps
The training target of a linear regression is to find the optimum weights \( \omega_1 \) , \( \omega_0 \) that minimize the mean square error \( mse \)
\( \ \frac{\partial J}{\partial \omega} \) is the gradient
\( \ \rho \) is the learning rate. Large \(\rho \) large steps
def gradient_descent(alpha, x, y, ep=0.0001, max_iter=10000):
converged = False
iter = 0
m = x.shape[0] # number of samples
# initial theta
w0 = np.random.random(x.shape[1])
w1 = np.random.random(x.shape[1])
# total error, J(theta)
J = sum([(t0 + t1*x[i] - y[i])**2 for i in range(m)])
# Iterate Loop
while not converged:
# for each training sample, compute the gradient (d/d_theta j(theta))
grad0 = 1.0/m * sum([(w0 + w1*x[i] - y[i]) for i in range(m)])
grad1 = 1.0/m * sum([(w0 + w1*x[i] - y[i])*x[i] for i in range(m)])
# update the theta_temp
temp0 = w0 - alpha * grad0
temp1 = w1 - alpha * grad1
# update theta
w0 = temp0
w1 = temp1
# mean squared error
e = sum( [ (w0 + w1*x[i] - y[i])**2 for i in range(m)] )
if abs(J-e) <= ep:
print 'Converged, iterations: ', iter, '!!!'
converged = True
J = e # update error
iter += 1 # update iter
if iter == max_iter:
print 'Max interactions exceeded!'
converged = True
return w0,w1
1. Classification
Machine learning task are categorized by the target of the studies problems as follows:
is the problem of identifying to which of a set of categories (sub-populations) a new observation
Text
Text
Dendrites
Axons
Cell body
\( x_1 \)
\( x_2 \)
\( y \)
Text
\( \omega= [\omega_1,\omega_2 ]^T \)
\( x=[x_1,x_2 ]^T \)
\( w_1 \)
\( w_2 \)
Text
Dendrites
Axons
Cell body
\( x_1 \)
\( x_2 \)
\( y \)
\( w_1 \)
\( w_2 \)
\( \omega= [\omega_1,\omega_2 ,\omega_0]^T \)
\( x=[x_1,x_2,-1 ]^T \)
Text
\( -1 \)
\( w_0 \)
The perceptron algorithm is an optimization method to compute the unknown weights \( w^T \)
The perceptron algorithm is an optimization method to compute the unknown weights \( w^T \)
For nonlinear separable problems a single neuron/line model in not enough
| OR | Class | ||
|---|---|---|---|
| 0
|
0 | 0 | B |
| 0 | 1 | 1 | A |
| 1 | 0 | 1 | A |
| 1 | 1 | 1 | A |
Text
\( y \)
\( w_2 =1 \)
Text
\( -1/2 \)
\( w_0 \)
\( w_1 =1 \)
\( y =x_1 +x_2 -0.5\)
| AND | Class | ||
|---|---|---|---|
| 0
|
0 | 0 | B |
| 0 | 1 | 0 | B |
| 1 | 0 | 0 | B |
| 1 | 1 | 1 | A |
Text
\( y \)
\( w_2 =1 \)
Text
\( -3/2 \)
\( w_0 \)
\( w_1 =1 \)
\( y =x_1 +x_2 -3/2\)
| XOR
|
Class | ||
|---|---|---|---|
| 0
|
0 | 0 | B |
| 0 | 1 | 1
|
A
|
| 1 | 0 | 1
|
A
|
| 1 | 1 | 0
|
A
|
Text
\( y \)
\( -3/2 \)
\( 1 \)
\( y =(x_1 +x_2 -1/2)+2(x_1 +x_2 -3/2)- 1/2\)
Text
\( 1 \)
\( 1 \)
\( 1 \)
\( -1/2 \)
\( -1/2 \)
\( 2 \)
\( 1 \)
Topology is one field of mathematics that can be used to understand how neural networks work
Text
Topology is one field of mathematics that can be used to understand how neural networks work
Text
Topology is one field of mathematics that can be used to understand how neural networks work