Skip to content
elevatedevco

Data & MLOps

Finding and using datasets

Learn Finding and using datasets: 34 practice questions and answers with an interactive quiz — from the offline AI Learning app.

Intermediate34 questions34 quiz questions

Questions & Answers

Tap a question to reveal its answer. Written for self-study and interview preparation.

What is a dataset?

A dataset is a collection of related data organized so that a computer or person can analyze it. It usually looks like a table with rows (each row is one example or record) and columns (each column is one piece of information about that example). For example, a dataset of animals might have rows for each animal and columns for name, weight, and habitat.

What does 'structured data' mean?

Structured data is organized in a neat table with rows and columns, like a spreadsheet or a CSV file. Each row is one record, and each column holds one specific type of information. A list of students with their names, grades, and ages is structured data. In contrast, unstructured data (like photos or free-form text) does not fit neatly into tables.

What does CSV stand for, and why is it a popular format for sharing datasets?

CSV stands for Comma-Separated Values. It is a simple text format where each line represents one row of data and values within that row are separated by commas. Almost every programming language and tool — including Python and Excel — can read CSV files, which makes them one of the most popular and portable formats for sharing datasets.

Which of the following is a well-known free platform where data scientists share machine-learning datasets and compete in challenges?

Kaggle is a popular platform where data scientists share datasets, Jupyter notebooks, and compete in machine-learning challenges. It hosts thousands of free datasets on topics ranging from sports to health to climate. Beginners can explore and download datasets directly through the web interface without writing any code.

In a labeled dataset used for machine learning, what does a 'label' represent?

A label is the correct answer or outcome that a machine-learning model is trying to learn to predict. For example, in a dataset of cat and dog photos, each image has a label that says 'cat' or 'dog.' The model studies many examples along with their labels so it can later predict labels for new images it has never seen.

What is a 'feature' in a machine-learning dataset?

A feature is an individual measurable property used as input to a machine-learning model. In a house-price dataset, features might include the number of bedrooms, location, and floor area. The model learns how different combinations of features relate to the output (the label), such as the sale price of the house.

Why are missing values in a dataset a problem for machine learning?

Machine-learning algorithms generally need complete data to find patterns correctly. If some cells in a dataset are empty, the algorithm may crash or produce inaccurate results. Data scientists handle missing values by either removing the affected rows, filling in a sensible replacement (like the column average), or using algorithms that can tolerate incomplete data.

What is a train/test split, and why do data scientists use it?

A train/test split divides a dataset into two parts: the training set (used to teach the model) and the test set (used to check how well the model performs on data it has never seen before). This is crucial because a model that memorizes training data might fail on new data. A common split is 80% for training and 20% for testing.

What does 'bias in a dataset' mean, and why is it harmful for AI systems?

Dataset bias occurs when the data does not fairly represent the real world, often by over-representing or under-representing certain groups. For example, if a facial-recognition training set contains mostly photos of one skin tone, the model will likely be less accurate for other skin tones. Biased data leads to unfair AI systems that can discriminate against certain groups of people.

Why is it important to protect personal data in a dataset?

Datasets that contain personal information — such as names, addresses, or health records — can harm real people if shared without permission. Regulations like GDPR (in Europe) require that personal data be collected and used responsibly. In AI projects, researchers often remove or disguise identifying details (a process called anonymization) to protect individuals' privacy.

The UCI Machine Learning Repository is a famous source of free datasets. Which organization hosts it?

The UCI Machine Learning Repository is hosted by the University of California, Irvine. It has been a central archive for machine-learning datasets since 1987, providing hundreds of free datasets that researchers and students can download. Many classic AI experiments — such as learning to classify Iris flowers by petal measurements — use UCI datasets.

What is 'open data,' and where can you find government open data?

Open data is data that anyone can freely access, use, and share without needing special permission. Many governments publish open datasets about topics like population, weather, transportation, and public health. For example, data.gov (USA) and data.gov.in (India) are official portals where you can download government datasets for free.

Why does the license of a dataset matter before you use it in a project?

A dataset's license tells you what you are legally allowed to do with it — for example, whether you can use it for school projects, modify it, or share work based on it. Some licenses allow free use for any purpose (like Creative Commons CC0), while others restrict commercial use. Ignoring a license can lead to copyright violations, even in a student project.

What is 'overfitting,' and how does having too little training data cause it?

Overfitting happens when a model learns the training data so precisely — including its noise and random quirks — that it fails to work well on new, unseen data. With a very small dataset, the model memorizes the few examples it sees instead of learning general patterns. Using more diverse data, or techniques like cross-validation, helps reduce overfitting.

What is data augmentation, and which type of dataset benefits most from it?

Data augmentation means creating new training examples by making small changes to existing ones — for example, flipping, rotating, or adjusting the brightness of images. Image datasets benefit greatly because a model trained on augmented photos learns to recognize objects at different angles and lighting conditions. This technique is widely used when collecting large amounts of real-world data is expensive or impractical.

What is an imbalanced dataset, and why can it mislead a machine-learning model?

An imbalanced dataset has far more examples of one class than another — for instance, 990 'healthy' cases and only 10 'sick' cases in a medical dataset. A model trained on such data might simply predict 'healthy' every time and still appear 99% accurate, yet it would miss every real sick case. Techniques like oversampling the minority class or collecting more minority examples help fix this problem.

Ice cream sales and drowning incidents both increase in summer. Does this mean eating ice cream causes drowning?

No — this is an example of correlation without causation. Both ice cream sales and drowning incidents increase in summer because hot weather causes more people to buy ice cream and to swim, not because one causes the other. In data science, finding a statistical relationship between two variables does not automatically mean one causes the other; a shared outside factor (called a confounder) can explain the link.

What is the MNIST dataset, and why is it famous in the history of AI?

MNIST is a dataset of 70,000 handwritten digit images (0–9), each labeled with the correct digit. It is one of the most famous benchmarks in AI because many early and modern classification algorithms were tested on it, making it easy to compare different approaches. Beginners often start with MNIST as their first hands-on image-classification project.

What does the following Python code do when you first load a new dataset?

This code uses the pandas library to load a CSV file called 'animals.csv' into a DataFrame — a table-like structure in Python. The head() function then prints the first five rows so you can quickly inspect what the data looks like. This is usually one of the very first steps a data scientist takes after loading a new dataset.

import pandas as pd
df = pd.read_csv("animals.csv")
print(df.head())
What is an outlier in a dataset, and how should a data scientist handle it?

An outlier is a data point that is very different from the rest — for example, a student's height recorded as 250 cm when everyone else is around 160 cm. Outliers can result from measurement errors, typos, or genuinely unusual cases. Data scientists investigate outliers before training a model: if they are errors, they are corrected or removed; if they are real, they may carry important information and should be kept.

Which of the following is an example of categorical data?

Categorical data represents groups or categories rather than numbers — for example, eye color with values like 'Brown,' 'Blue,' or 'Green.' Unlike numerical data such as temperature or distance, you cannot meaningfully add or average categorical values. Machine-learning models often need categorical data to be converted into numbers (a process called encoding) before they can process it.

What is data anonymization, and how does it protect people in AI projects?

Data anonymization is the process of removing or disguising information that could identify a specific person, such as replacing real names with random codes or rounding exact ages to age ranges. This allows researchers to use and share datasets for AI training without revealing private details about individuals. Proper anonymization is a key step in building privacy-respecting AI systems, especially in health or education contexts.

A dataset has no labels at all. Which type of machine learning would you most likely use with it?

Unlabeled datasets are used for unsupervised learning, where the model tries to find hidden structure or patterns on its own without being told the correct answer. Clustering is a common unsupervised technique — for example, automatically grouping customers by shopping habits without any pre-defined categories. Supervised learning, by contrast, requires labels so the model can learn to predict a specific outcome.

Why does having a larger and more diverse dataset generally lead to a better machine-learning model?

A model learns patterns from examples, so the more varied the examples it sees, the better it can handle new, unseen situations. A small dataset might not capture all the variety that exists in the real world, causing the model to fail on uncommon cases. Diversity in data also ensures the model works fairly for many different people and scenarios, not just the most frequently occurring ones.

Is it ethical to automatically scrape (collect) data from a website without the site owner's permission?

Scraping data from a website without permission is often against the site's terms of service, and in some countries it may also violate privacy laws. Even if it is technically possible, collecting personal data without consent raises serious ethical concerns. Responsible data scientists check a website's robots.txt file and terms of service before scraping, and they never collect personal data without proper authorization.

What is an API, and how can it help you gather data for a machine-learning project?

An API (Application Programming Interface) is a way for two software systems to communicate and exchange information. Many websites offer APIs that let you request structured data — such as weather readings, social media posts, or sports scores — directly in your program. For example, a weather service API can send real-time temperature data in JSON format, which you can store and use to train a rain-prediction model.

Why is it important to normalize (scale) numerical features before training many machine-learning models?

Many algorithms use distance or gradient calculations that are sensitive to the scale of numbers. If one feature ranges from 0 to 1 (like a probability) and another ranges from 0 to 1,000,000 (like annual income in rupees), the large-scale feature can unfairly dominate the model. Normalization transforms all features to a similar range (for example, 0 to 1), so each feature contributes more equally to what the model learns.

What is cross-validation, and why is it more reliable than a single train/test split?

Cross-validation divides the dataset into several equal parts (called folds), then trains the model multiple times — each time using a different fold as the test set — and averages the results. This means every data point is used for both training and testing at different times, giving a more accurate and stable picture of how the model will perform on truly new data. A single train/test split can give misleadingly good or bad results if that particular split is unrepresentative.

ImageNet is a benchmark dataset containing over 14 million images. What is it primarily used for in AI?

ImageNet is primarily used to train and evaluate image classification and object-detection models. The annual ImageNet Large Scale Visual Recognition Challenge (ILSVRC) pushed the development of deep learning — it was on this challenge in 2012 that AlexNet demonstrated how deep convolutional networks could dramatically outperform older methods. ImageNet helped establish the foundation for modern computer vision.

What do the following two lines of Python code tell you about a dataset?

df.shape prints the total number of rows and columns in the DataFrame, telling you how large the dataset is. df.isnull().sum() counts how many missing (null) values exist in each column — one of the first data-quality checks a data scientist performs. Together these two commands give a quick health check of any newly loaded dataset.

print(df.shape)
print(df.isnull().sum())
What is synthetic data, and when is it especially useful in AI development?

Synthetic data is artificially generated data that mimics real data without coming from actual events or real people. It is useful when real data is scarce, expensive to collect, or too private to share — for example, generating simulated patient records to train a medical AI without using real patient files. Synthetic data can also be used to create rare or dangerous scenarios that almost never appear in real-world datasets.

Give one example of sensor data and explain how it could help train an AI model.

A step-counter (accelerometer) sensor in a smartphone records movement readings many times per second. This time-series data could be used to train an AI model that automatically classifies physical activities — such as walking, running, or cycling — based on the detected movement patterns. Sensor datasets are important in health, robotics, and smart-home applications because they continuously capture real-world physical information.

What does it mean for a dataset to be 'representative,' and what goes wrong when it is not?

A representative dataset covers the full range of situations a model will encounter in the real world. If a dataset is not representative — for example, a voice-recognition dataset recorded only in quiet rooms — the model will struggle with noisy environments. Non-representative data is a leading cause of AI systems that work well in a lab but fail for real users, especially those from groups not included in the training data.

In an AI data pipeline, what is the correct order of these four steps: (A) Train the model, (B) Collect raw data, (C) Clean and preprocess data, (D) Evaluate model performance?

The correct order is B → C → A → D: first collect raw data, then clean and preprocess it (handling missing values, encoding categories, normalizing numbers), then train the model on the prepared data, and finally evaluate how well it performs on the test set. Skipping or reordering steps — especially training before cleaning — leads to unreliable models, a principle often called 'garbage in, garbage out.'

Put it into practice with AI Learning

This topic — and hundreds more — comes from our free, offline AI Learning app. Practice Q&A, quizzes and cheat sheets anywhere, no account needed.

  • Free
  • No account
  • Works offline
Coming soon toGoogle Play