# Self Assessment

Become a certified data master with our live, online, instructor-led training. We use live code, real-world data sets and Jupyter notebooks so our instructors can help you with your models in real time.

At Pragmatic Institute, we have data courses for every level of expertise, but knowing where to start can be difficult to figure out.

This self assessment will help you determine if *Practical Machine Learning* is the best fit for you. If you get **at least six of the questions below correct**, then this class is for you. If you don’t, no worries. You’ll simply want to start with *Essential Data Tools*.

**Question 1**

In Python, what is returned when evaluating *[n for n in range(10) if n % 2 == 1]*?**Question 2**

In Python, if *x = numpy.array([30, 45])*, what does *x.sum()* return?**Question 3**

How would you cast the *string* variable *a* that is equal to “2” into the integer 2?**Question 4**

If you have a Python dictionary *dict = {‘banana’: 5, ‘apple’: 2}*, how do you access the value associated with key ‘apple’?**Question 5**

If you have a Python list *mylist = [1,2,3,4]*, how do you print the first element?

**Question 6**

Let the following be the definition of function *myfunc. *What does *myfunc([3,5,1,6], 4)* return?

*def myfunc(input_l, th):*

*if len(input_l) >= th:*

*return True*

*else:*

*return False*

**Question 7**

*In Python, what kind of error is returned by the following code? (e.g. NameError, ValueError, IOError, etc.)" *

*d = {‘a’: 2, ‘b’: 4}print(d[‘c’])*

Question 8

*What is the value of mylist after the following Python code is executed?*

*class MyListClass(object): def __init__(self, n): self.n = n*

*def make_list(self, a = 5): return [a]*self.n*

*mylistobject = MyListClass(3)mylist = mylistobject.make_list(2)*

Basic calculus and basic linear algebra also play a big part in this course. Here are a couple of sample questions so you can get a feel for the level of math you can expect in this course.

**Sample 1**

Let *f*(*z) = *2z² — 5. Let *z* = 2. What is *f*(*z*)?

**Sample 2**

What is the value of x where function *f*(*x*) = *x²* — *x* + 3 has a minimum?

**Sample 3**

What is the matrix product of

**Sample 4**

What is *Wx* + *b, *where

**Answers**

**Assessment Answers:**

Question 1: [1, 3, 5, 7, 9]

Question 2: 75

Question 3: *int(a)*

Question 4: *dict[‘apple’]*

Question 5: *print(mylist[0])*

Question 6: True

Question 7: KeyError

Question 8: [2, 2, 2]

Now that you know you've got the stuff, attend *Advanced Machine Learning*