From 2a1a55726680dbd71e0c9e4400ad7b6c48291645 Mon Sep 17 00:00:00 2001 From: Karthik Mahendra Date: Thu, 29 Mar 2018 08:52:04 -0700 Subject: [PATCH 1/2] ML course assignments day2 and day3 --- karthik_mahendra_day_2_mlmbc.py | 1 + precourse.py | 55 +++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 karthik_mahendra_day_2_mlmbc.py mode change 100644 => 100755 precourse.py diff --git a/karthik_mahendra_day_2_mlmbc.py b/karthik_mahendra_day_2_mlmbc.py new file mode 100644 index 0000000..ed2e99c --- /dev/null +++ b/karthik_mahendra_day_2_mlmbc.py @@ -0,0 +1 @@ +print 54321 * 12345 diff --git a/precourse.py b/precourse.py old mode 100644 new mode 100755 index 75f29ad..ef190d2 --- a/precourse.py +++ b/precourse.py @@ -8,6 +8,61 @@ # Free example function definition # This function passes one of the 11 tests contained inside of test.py. Write the rest, defined in README.md, here, and execute python test.py to test. Passing this precourse work will greatly increase your odds of acceptance into the program. +from scipy.misc import derivative +import numpy as np + def f(x): return x**2 +def f_2(x): + return x**3 + +def f_3(x): + return (x**3) + (5*x) + +def d_f(x): + return derivative(f,x) + +def d_f_2(x): + return round(derivative (f_2,x,dx=1e-3)) + + +def d_f_3(x): + return round(derivative(f_3,x,dx=1e-3)) + + +def vector_sum(x,y): + x = np.array(x) + y = np.array(y) + return x+y + +def vector_less(x,y): + x = np.array(x) + y = np.array(y) + return x-y + +def vector_magnitude(x): + return np.linalg.norm(x) + +def vec5(): + return np.array([1,1,1,1,1],dtype=int) + +def vec3(): + return np.array([0,0,0],dtype=int) + +def vec2_1(): + return np.array([1,0],dtype=int) + +def vec2_2(): + return np.array([0,1],dtype=int) + +def matrix_multiply(vec,matrix): + return np.dot(vec, matrix) + + + + + + + + From edaa284535078ce62b27fdae737464d0422249ca Mon Sep 17 00:00:00 2001 From: Karthik Mahendra Date: Thu, 29 Mar 2018 12:27:10 -0700 Subject: [PATCH 2/2] Create why.md --- why.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 why.md diff --git a/why.md b/why.md new file mode 100644 index 0000000..08ef1d6 --- /dev/null +++ b/why.md @@ -0,0 +1,11 @@ +Why do I want to learn ML? +* ML brings better career opportunities. +* Have good prospect of higher compensation. +* Applications in various domains,scope of ML is not narrow. +* Meet with other people working on interesting projects. +* Several job opportunities in ML. Demand>Supply at the moment. +* Opportunity for me to excericse my analytical skills which I don't in my current job. +* Opportunity to create something that others may use or find useful. +* Hopefully, help me escape wage slavery eventually. + +