Machine Learning Interview Questions (Part 1)

Machine Learning Job Interview
Machine Learning Job Interview – Questions with answers

This the first part of machine learning interview question. You can also read second part of this series with more questions here:

Machine Learning Interview Question Part 2

Nearly all big tech companies have an artificial intelligence project, and they are willing to pay experts millions of dollars to help get it done. – By CADE METZ

Machine learning is a part of artificial intelligence. According to IBM’s forecast, job opening for artificial intelligence, machine learning and data science will increase 28% by 2020 (Forbes).

So if you are looking for a machine learning job or need to prepare for machine learning interview, then take a look at following questionaries.

What is machine learning?

Machine learning is a branch of Artificial Intelligence. It allows systems to automatically learn and improve from experience without being explicitly programmed.

What is artificial intelligence?

Artificial Intelligence is a branch of Computer Science that studies and researches to develop machines that have intelligence like human being. Most importantly, they can learn from experience and deal with new situations smartly.

What is the difference between artificial intelligence and machine learning?

Artificial Intelligence (AI) has many branches. One of them is ML. AI deals with broader context of developing a machine that can act like human and smartly. On the other hand, in machine learning we provide data to machines and they learn for themselves from that data.

What are the types of machine learning?

There are 3 types of machine learning. 1. Supervised learning, 2. Unsupervised learning and 3. Reinforced learning

What is Supervised machine learning?

In supervised machine learning, you provide a set of data with problems and answers. Machine learns from that set of data and applies learning in future.

What is Unsupervised machine learning?

In unsupervised learning, we don’t provide any solution data to machine. We provide them a set of data. The machine learns for itself.

What is Reinforcement machine learning?

Reinforcement learning is training by rewards and punishments. Here we train a computer as if we train a dog. If the dog obeys and acts according to our instructions we encourage it by giving biscuits or we punish it (by not providing biscuit or any other mean). Similarly, if the system works well then the teacher gives positive value (i.e. reward) or the teacher gives negative value (i.e. punishment). The learning system which gets the punishment has to improve itself. Thus it is a trial and error process.

Click here to learn more about Reinforcement Machine Learning

What are the algorithms used in machine learning?

1. Linear Regression,

2. Logistic Regression,

3. Decision Tree,

4. SVM,

5. Naive Bayes,

6. KNN,

7. K-Means,

8. Random Forest,

9. Dimensionality Reduction Algorithms,

10. Gradient Boosting algorithms,

10.1. GBM,

10.2. XGBoost,

10.3. LightGBM,

10.4. CatBoost

Explain Linear Regression

Linear regression is a statistical method that attempts to model relationship between different scalar variables. There can be two or more variables. Among them, one is dependent variable. Others are independent variables.

What do you know about logistic regression?

Like all regression analyses, the logistic regression is a predictive analysis. Logistic regression is used to describe data and to explain the relationship between one dependent binary variable and one or more nominal, ordinal, interval or ratio-level independent variables.

Click here for details about logistic regresion

What is the difference between linear regression and correlation?

From correlation we can only get an index describing the linear relationship between two variables; in regression can predict the relationship between more than two variables and can use it to identify which variables x can predict the outcome variable y. … While regression means going back towards average .

Read More

When to use decision tree vs logistic regression?

A logistic regression model is searching for a single linear decision boundary in your feature space, whereas a decision tree is essentially partitioning your feature space into half-spaces using axis-aligned linear decision boundaries. The net effect is that you have a non-linear decision boundary, possibly more than one.

This is nice when your data points aren’t easily separated by a single hyperplane. On the other hand, decision trees are so flexible that it depends on your specific problem and the data you have. Both decision trees (depending on the implementation, e.g. C4.5) and logistic regression should be able to handle continuous and categorical data just fine. It can be prone to overfitting. To combat this, you can try pruning. Logistic regression tends to be less susceptible (but not immune!) to overfitting.

Lastly, another thing to consider is that decision trees can automatically take into account interactions between variables. For example xyxy if you have two independent features xx and yy. With logistic regression, you’ll have to manually add those interaction terms yourself.

Which algorithms do we use for supervised machine learning?

Classification Algorithms: 1. Support vector machines (SVM), 2. Neural networks, 3. Naïve Bayes classifier, 4. Decision trees, 5. Discriminant analysis, 6. Nearest neighbors (kNN); Regression Algorithms: 1. Linear regression, 2. Nonlinear regression, 3. Generalized linear models, 4. Decision trees, 5. Neural networks

Read More

Which algorithms do we use for unsupervised machine learning?

a. Clustering: k-means, mixture models, hierarchical clustering, b. Neural Networks: Hebbian Learning, Generative Adversarial Networks. c. Approaches for learning latent variable models: Expectation–maximization algorithm (EM) Method of moments.

Click here to learn more about supervised and unsupervised machine learning

How is KNN different from k-means clustering?

K-nearest neighbors is a classification algorithm, which is a subset of supervised learning. K-means is a clustering algorithm, which is a subset of unsupervised learning. … In sum, they are two different algorithms with two very different end results

Read More

What is ROC curve and how it works?

In statistics, a receiver operating characteristic curve, i.e. ROC curve, is a graphical plot. It illustrates the diagnostic ability of a binary classifier system as its discrimination threshold is varied. ROC analysis is related in a direct and natural way to cost/benefit analysis of diagnostic decision making.

Read More

What is semi supervised machine learning?

Semi-supervised machine learning is a mixure of supervised learning and unsupervised learning. Here, some data is labeled but most of it is unlabeled.

Read More

What is Ordinary Least Squares Regression?

In statistics, ordinary least squares (OLS) or linear least squares is a method for estimating the unknown parameters in a linear regression model.  The goal of it is to minimizing the sum of the squares of the differences between the observed responses (values of the variable being predicted) in the given dataset and those predicted by a linear function of a set of explanatory variables.

Read More

Briefly describe Naïve Bayes Classification

Naive Bayes is a collection of classification algorithms based on Bayes Theorem. It is not a single algorithm but a family of algorithms that all share a common principle, that every feature being classified is independent of the value of any other feature. So for example, a fruit may be considered to be an apple if it is red, round, and about 3″ in diameter. A Naive Bayes classifier considers each of these “features” (red, round, 3” in diameter) to contribute independently to the probability that the fruit is an apple, regardless of any correlations between features. Features, however, aren’t always independent which is often seen as a shortcoming of the Naive Bayes algorithm and this is why it’s labeled “naive”.

Read More

Do you know the meaning of SVM?

“Support Vector Machine” (SVM) is a supervised machine learning algorithm which can be used for both classification or regression challenges. However, it is mostly used in classification problems. In this algorithm, we plot each data item as a point in n-dimensional space (where n is number of features you have) with the value of each feature being the value of a particular coordinate. Then, we perform classification by finding the hyper-plane that differentiate the two classes very well.

Read More

 

What is Machine Learning

Machine Learning
IBM Cognitive Hypervisor uses machine learning and cognitive computing to analyze medical data for real-time care

Summary: If you are not living in a cave or rural area, you must have heard the word “Machine Learning”. Although it is a term more related to “Computer Science”, people from other fields are also interested about it. So what is machine learning?

It is a branch of Artificial Intelligence (AI). It deals with huge amount of data. Different statistical algorithms and formula are applied to data to find pattern in the dataset or get a result. Simply speaking, it is a set of algorithms plus statistics.

Details: Machine learning is a buzz word of modern age. Literally it means, machines can learn from experience or data. In fact, machine learns more, if you provide more data.

Why machine learning is so popular?

Because if you can correctly choose right algorithm and statistical formula, then you can predict many things. For example, weather condition of future (Okay, near future), customer’s buying trend, share market movements etc.

What you need to learn to start machine learning?

  1. Hardware: from single computer to cluster of inter-connected computers. Or, amazon’s EC2 instances.
  2. Some machine learning algorithms
  3. Some Statistics formulas
  4. Framework (Tensorflow or deeplearning4j etc)
  5. Any one programming language – python, java, scala.

Photo Credit:

IBM Research

 

Types of Machine Learning : Supervised and Unsupervised

Machine Learning Types
“Machine Learning” can categorize objects into groups and find patterns

When it’s time to learn “Machine Learning”, the first thing that you will hear is “Types of Machine Learning”. Because this is where you will begin to learn.

Based on learning algorithms, machines can learn in two ways. In supervised way and the other is un-supervised way. So these are the types of machine learning. Let’s discuss about them with examples.

1. Supervised machine learning

Here at the very beginning you teach your machine. Then the machine gives you result based on your  lessons. Let me give you a real world example:

Suppose, you want to teach the machine to recognize images of fruits. In supervised learning process you show the image of apple and tell machine that this is apple. Again you take image of orange and let it know that the image contains orange.

By this way you teach your machine with lot of images and their labels.

After that, if you show a new image to the machine, most likely it will recognize the fruit’s name.

2. Unsupervised machine learning

Here you don’t teach machine. It learns itself. Lets jump into an example. In this scenario,  you show many images of apples and oranges. But don’t say which one is apple and which one is orange. The machine will be able to predict that these two things are different. It will categorize apple in one category and orange in another category.

That is, it will cluster different things in different groups.

Isn’t it that simple?

Photo Credit:

Army Photography Contest – 2007

How to make Http request and handle errors in Ionic Framework

In most of the cases in our mobile application we’ve to fetch data from a server. If you are using Ionic Framework, it’s not a big deal. Http plugin made it easy for us. Let’s see how to make http request in Ionic Framework using Http plugin to get data from server.

  1. Install the plugin: Run the following command in command line in your project:

    Add this module in providers array of your app.module.ts file:

Import the Http plugin:

Suppose we are going to use this plugin in HomePage.ts file. First we have to import the plugin and add it in constructor as argument:

GET request:

It is comparatively easy to make a GET request. So let’s do it first.  Just write the following code in the method of your home page:

Here you have to change the example url to your server’s url. After receiving the data from server, you can get it in server_data variable.

POST Request:

Everything is same as GET request. Here you have to add header values and post parameters before performing the request. In most of the cases, header values are same as above. Just change postParams as per your data.

Error Handling:

I was working on an ionic project for a while that sends request to server to fetch data. I faced a problem while working on it. If there is no internet connection my busy dialog keeps loading and no error message occurs. Because, the Http GET or POST methods didn’t have any handler to control the errors. After searching for a while I didn’t find any solution on internet. Finally I found it myself. Let me share it with you.

Here I’ve added error handler in subscribe section. Whenever a problem occurs, you can get the error message inside error section.

How Ionic Framework works

Ionic Framework is a mobile app development framework. The apps developed using this framework runs on android, ios and windows.  Now you may ask how it works.

The answer is very simple. It’s just an application with a web view or browser. Everything that you write in html and css are displayed in this browser from the very begining. So the user doesn’t notice the browser.

That’s the answer with a little bit more.

Now you may ask, what if I want to use native function in my app?

That’s also possible. Javascript will call the native function or method for you.

So, in short the system works as follows:

WEBBROWSER <<>> JAVASCRIPT <<>> ANDROID

OR

WEBBROWSER <<>> JAVASCRIPT <<>> IOS

Important commands of Ionic Framework

If you have decided to learn and work with Ionic Framework, then it’s good to have important commands of it.

So we have listed those handy commands here.

Installing ionic:

Start a new project:

You can use any template name listed below as template_name :

Add android platform:

Add iOS platform:

Create a new page:

Note: Remember to add page-name in declarations and entryComponents arrays in app.module.ts file

Create a new provider:

Run in browser:

Run on android device:

Run on iOS device:

Add a cordova plugin:

Note: Here we’ve used cordova-plugin-camera as example plugin. You can use any other plugin name. Remember to add plugin-name in providers array in app.module.ts file

Remove a cordova plugin:

 

Advantages and disadvantages of Ionic Framework

I’m a fan of native app development. I’ve been developing both Android and iOS app for more than 5 years and still continuing.

However,  I always search for new technologies. If I get anything better, I try to adopt that.

From my this habit, I’ve found angularJS. It’s a very powerful javascript framework that is used in frontend development.

After finding this framework, a question came out of my head. Can we use it in our mobile app development.  While searching for the answer of it I found this ionic framework.

Ionic framework is a multi-platform app development framework powered by cordova. After playing with it for a while the following advantages and disadvantages are found:

Pros or advantages of Ionic Framework:

1. Easy to learn: If you have familiarity with html, css and javascript you can learn it very fast

2. Easy documentation: Ionic has very good and well documentation. Most of the things are covered in their official site. So you don’t have to move around different sites to learn.

3. Rapid development: By running some command line commands, you can create pages (e.g. ionic g page your_page_name), providers etc. When you run a command it generates all files with template codes.  So you don’t have to write everything from scratch.

4. Ionic apps run on different platforms. e.g. Android, iOS, windows etc. As a result you don’t have to write codes for each platform. It reduces development time a lot.

Cons or disadvantages of Ionic Framework:

1. Performance: Native mobile application’s performance is better than ionic app. However, in most of the cases, performance gap is not noticeable.

2. Security: If you are developing financial app e.g. app for bank, ionic framework is not recommended. It may not provide as much security as native application.

3. Limited native functionality: There may be some native functions that may be not available in ionic framework.  In that case you have to develop the plugin yourself. However, there are many plugins available to cover native functionalities.

 

 

Freelance : Chose your area and prepare yourself

There are many type of freelance works.  From accounting to copyrighting. Data entry to server based api development. Php to java. So first decide in which field you want to dive in. Check which skills do you have.  Which skills you are lacking.

You may decide in which field you will work based on two things :

1. Your previous experience and study

2. Statistics on current market

If you’ve studied accounting then you may search for freelance jobs related to accounting. LLB degree holders can look for jobs related to legal support. Additionally, Those who are studying or just finished software engineering can search for programming job. Furthermore, if you have some computer literacy and good English communication skills, you can get data entry related jobs. Other areas may include translation, admin and logistic support, copy writing etc. In addition you can think about photography, customer support, training etc.

Freelance

Prepare yourself

If you think that your skill is not enough to do freelancing, don’t worry. Sit back and relax.

There are many online courses that help you to improve your skills. Some courses are free and for others you have to pay.

Three online learning sites are: coursera.com, edx, lynda.com.

My career started to dramatically improve after learning from lynda.com. And now I’m learning from coursera.com. One good thing about coursera is that you can access most of the courses for free. Just enroll for a course. when they ask for payment or purchase, select “Audit Only” option.

They will charge you only when you need certificates from them.

Photo Credit: Flickr

Getting Freelance job

In this post we’ll discuss about getting freelance job.

After chosing your desired field or area, your first task is to create your profile. Here you showcase your previous works. Previous works may include the works that you have done for your client or sample project.

Prepare your profile in a Word document or any other word processing software.

For each project add one attractive title, short description and a beautiful image. One thing you must remember when you prepare your profile or write a project proposal make sure that your text do not contain any grammatical or spelling error.
Maybe there is no relation between your work and your spelling errors. However employers are always aware about them. So be very careful about you spelling mistakes.

It’s time to open accounts in different freelance sites. For example upwork.com, freelancer.com and Guru.com.

Three secrets of getting freelance job 

Now I’ll tell you 3 secrets of getting freelance job from my experience.

1. Bid on small or low budget project – for first few projects. First 3 projects should be for  advertisement only. Don’t expect money. But, don’t do it for free.

2. Bid on projects as early as possible

3. If any client or employer contacts you, reply instantly.

Let me tell you one thing before I finish.  It may take many days or even months to get your first job. But don’t give up. Keep trying. Once you get your first project and complete it with good feedback from client, you don’t have to look back. 🙂

Happy freelancing.

Freelance : How will you start

When I started freelance job back in 2006, number of Freelancers were very few. So it was easy to find freelance jobs. However now it has become very hard. Because there are many freelancers out there to compete.

But don’t worry. I have some secrets for you. There  are some clients who want their job to be done at cheaper price. They know only new Freelancers will do this without asking any question. They are your potential customers.  So target them.

I like to finish my works step by step.  Let’s do the same here.

1. Decide what will you do

There are variety of works you can find in freelance sites. They range from accounting to online advertisement, data entry to server api development,  administration support, legal advice etc. So first choose what will you do.

2. Prepare yourself with skills

After selecting your area of freelancing, think yourself whether you have enough skills to perform tasks related to your area of concern. If not then take online courses to improve your skills.

Read my other article Freelance : Chose your area and prepare yourself

3. Prepare your portfolio

If you are new to freelance, you will not have any previous working record, feedback or rating in your freelance account. In such situation only thing that you can show is your profile. So createll your profile wisely with sample works or prejects.

4. Write sample project proposal

Write some sample proposals or create some basic structures. But when you submit your project proposal,  don’t use same template text. Write some more detail related to the project. For example overview of how will you finish the job, ask questions related to project.

5. Open accounts on different freelance sites.

There are many websites that offer freelance jobs. Open accounts on some of them. Currently, good platforms include guru.com, upwork.com,  freelancer.com etc

6. Bid on small projects which requirement you understand and have confidence that you can finish.

You may follow this rule for first few projects only

7. Response to client carefully

If any client contacts you, response with attention,  try to understand what he or she asked, answer precisely.

8. Be patient

It may take 1 week to 1 month to even 1 year to get first freelance job. So be patient. As soon as you receive one probject and finish it successfully, you do not have to look back.

9. Finish awarded project in time
Details

Once you receive a project, try to finish it with full effort. Finish it in time and maintain quality.

Give good feedback to client and request for feedback.