Python Machine Learning Test

Test real-world Python Machine Learning skills that matter in a world with AI. Protected by AI proctoring.

For jobseekers

Practice your skills and earn a certificate of achievement when you score in the top 25%.

Take a Practice Test

For companies

Screen real Python Machine Learning skills, flag human or AI assistance, and interview the right people.

About the test

The Python Machine Learning online test assesses knowledge of using Python and machine learning libraries such as NumPy, Pandas, SciPy, and Scikit-learn to build, train, evaluate, and improve machine learning models through a series of live coding questions. This test requires applying data preprocessing, model selection, and evaluation techniques to solve machine learning problems.

The assessment includes work-sample tasks such as:

  • Preparing, cleaning, and transforming datasets for model training.
  • Training and evaluating machine learning models.
  • Performing classification using different machine learning algorithms.

A good machine learning practitioner using Python should be able to take advantage of Python’s machine learning ecosystem to prepare data, build predictive models, evaluate their performance, and apply the right techniques to solve real-world machine learning tasks.

Sample public questions

Hard
30 min
code
Public
Python for Machine Learning
Data Science
Linear Regression
NumPy
Scikit-Learn

Implement the desired_marketing_expenditure function, which returns the required amount of money that needs to be invested in a new marketing campaign to sell the desired number of units.

Use the data from previous marketing campaigns to evaluate how the number of units sold grows linearly as the amount of money invested increases.

For example, for the desired number of 60,000 units sold and previous campaign data from the table below, the function should return the float 250,000.

Previous campaigns

Campaign Marketing expenditure Units sold
#1 300,000 60,000
#2 200,000 50,000
#3 400,000 90,000
#4 300,000 80,000
#5 100,000 30,000
Easy
15 min
code
Public
Python for Machine Learning
Classification
Data Science
NumPy
Scikit-Learn

As a part of an application for iris enthusiasts, implement the train_and_predict function which should be able to classify three types of irises based on four features.

The train_and_predict function accepts three parameters:

  • train_input_features - a two-dimensional NumPy array where each element is an array that contains: sepal length, sepal width, petal length, and petal width.
  • train_outputs - a one-dimensional NumPy array where each element is a number representing the species of iris which is described in the same row of train_input_features. 0 represents Iris setosa, 1 represents Iris versicolor, and 2 represents Iris virginica.
  • prediction_features - two-dimensional NumPy array where each element is an array that contains: sepal length, sepal width, petal length, and petal width.

The function should train a classifier using train_input_features as input data and train_outputs as the expected result. After that, the function should use the trained classifier to predict labels for prediction_features and return them as an iterable (like list or numpy.ndarray). The nth position in the result should be the classification of the nth row of the prediction_features parameter.

For jobseekers: get certified

Earn a free certificate by achieving top 25% on the Python Machine Learning test with public questions.

Take a Certification Test

Sample silver certificate

Sunshine Caprio

Java and SQL
TestDome
Certificate
TestDome logo icon

For companies: premium questions

Buy TestDome to access premium questions that can't be practiced.

7 more premium Python Machine Learning questions

Baseline Prediction, Delivery Delay, Machine Failure, Model Comparison, Customer Churn, Credit Score, Cubic Approximation.

Skills and topics tested

  • Python for Machine Learning
  • Classification
  • NumPy
  • Data Preprocessing
  • Nonlinear Regression
  • Decision Boundary
  • Curve Fitting
  • Data Science
  • K-Nearest Neighbors
  • Pandas
  • Scikit-Learn

For job roles

  • Data Scientist
  • Machine Learning Specialist

Sample candidate report

Need it fast? AI-crafted tests for your job role

TestDome generates custom tests tailored to the specific skills you need for your job role.
Sign up now to try it out and see how AI can streamline your hiring process!

Use AI Test Generator

What others say

Decorative quote

Simple, straight-forward technical testing

TestDome is simple, provides a reasonable (though not extensive) battery of tests to choose from, and doesn't take the candidate an inordinate amount of time. It also simulates working pressure with the time limits.

Jan Opperman, Grindrod Bank

Product reviews

G2 - Crowd Badge
G2 - High Performer - Winter (2025)
Capterra - 4.5 Stars
Capterra - Ease of Use (2025)

Used by

Solve all your skill testing needs

150+ Pre-made tests

From web development and database administration to accounting and MS Excel. See all pre-made tests.

130+ skills

From SQL and Python to Attention to Detail and Logical Reasoning. See all questions to filter by skill.

AI-ready assessments

Test what matters in a world with AI, protected by AI proctoring that flags any assistance.

How TestDome works

1

Choose a pre-made test
or create a custom test

2

Invite candidates via
email, URL, or your ATS

3

Candidates take
a test remotely

4

Sort candidates and
get individual reports

Enterprise-ready technical solutions

Multi-user Account

Support multiple users with shared permissions and role-based access control.

GDPR compliance

TestDome is fully GDPR compliant, see our legal pages .

Single Sign-On (SSO)

Use SSO for easy and secure user authentication for multiple users in your company. Request access.

Data anonymization

Automatic data anonymization after a defined period of time — or on-demand.

Want to know more?

Related Python Machine Learning Tests: