Principles of Data Science is the OpenStax textbook for a first course in the subject, written for data science majors and minors as well as students of business, health care, engineering and the sciences. Shaun V. Ault, Soohyun Nam Liao and Larry Musolino led the author team, with Wisam Bukaita and Aeron Zentner contributing, and OpenStax published it on January 24, 2025. Its 10 chapters in four units take you from the data science cycle and data collection through statistics, forecasting, machine learning and neural networks to ethics, visualization and reporting.
BS Data Science and BSCS students can use it as the course book for Introduction to Data Science. It assumes no more than college algebra and no real coding experience, so Python is taught from the first chapter, with Excel and R covered in the appendices. This page adds a plain summary, key points, a tip, a common mistake and two practice questions for every chapter, plus a study plan, so you know what to read first. You can download the free PDF from the official OpenStax site.
Book Overview
| Course | Principles of Data Science (Introduction to Data Science) |
| Degree Programs | BS Data Science, BSCS |
| Level | University, introductory level; no more than college algebra and no significant coding experience assumed |
| Authors | Shaun V. Ault, Soohyun Nam Liao and Larry Musolino (senior contributing authors), with contributing authors Wisam Bukaita and Aeron Zentner |
| Publisher | OpenStax, Rice University |
| Published | January 24, 2025 |
| Structure | 10 chapters in four units (Introducing Data Science and Data Collection; Analyzing Data Using Statistics; Predicting and Modeling Using Data; Maintaining a Professional and Ethical Data Science Practice), plus Appendices A to D on Excel, R Studio and Python; this page gives one block per chapter and one for the appendices |
| Exercises | Chapters end with study aids such as key terms, group projects, chapter review questions, critical thinking questions and quantitative problems (the set varies by chapter); a back-matter answer key covers selected questions |
| Language | English |
| License | Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) |
| Format | Free PDF and free online (web view) edition on OpenStax |
Chapter List
Chapter 1: What Are Data and Data Science?
Unit 1: Introducing Data Science and Data Collection · Difficulty: Easy · Key topics: data science cycle, data management, data types, structured and unstructured data, CSV, JSON, XML, Python, Pandas, Google Colab
The opening chapter defines data science as the field that collects, manages and analyzes data to pull meaning from it, and it walks through the five steps of the data science cycle. It then tours applications in business, engineering, public policy, education, health care and sports, and raises the issues of data volume, privacy and bias. Next it sorts data into types and dataset formats, compares spreadsheets, Python, R, Tableau and Power BI, and ends with a first hands-on session in Google Colab using Pandas and Matplotlib.
Key Points:
- The data science cycle has five steps: problem definition, data collection, data preparation, data analysis and data reporting.
- Quantitative data is numeric (continuous or discrete); categorical data is nominal (no order) or ordinal (ranked).
- A dataset is made of items (rows) and attributes (columns); structured data shares one set of attributes, unstructured data does not.
- CSV is a simple flat text format, JSON stores key-value pairs and XML wraps data in nested tags; JSON and XML can carry metadata, CSV generally cannot.
- In Pandas,
read_csv()loads a file into a DataFrame,describe()summarizes it andloc[]filters rows with a condition. - A 2020 survey cited in the section says data scientists spend about half their time on collection and cleaning.
Practice Tip: In Google Colab, load any small CSV with pd.read_csv(), call describe(), filter some rows with loc[] and draw plt.scatter() of two columns. You will have touched collection, preparation, analysis and reporting in ten lines.
Common Mistake: Running notebook cells out of order and trusting the output. The chapter warns that reassigning a variable and re-running cells in a different order gives surprising results, so use Run all to check.
Important Questions:
- What are the five steps of the data science cycle? Problem definition, data collection, data preparation, data analysis and data reporting.
- What is the difference between nominal and ordinal data? Both are categorical; nominal categories have no order (such as instructor names), while ordinal categories have a meaningful rank (such as rating levels).
Chapter 2: Collecting and Preparing Data
Unit 1: Introducing Data Science and Data Collection · Difficulty: Easy · Key topics: surveys, sampling, bias, web scraping, APIs, regular expressions, missing data, outliers, normalization, compression, indexing
Chapter 2 treats collection and preparation as the first steps of the cycle. It compares ways to collect data, including experiments, surveys, observation, interviews and document analysis, then looks closely at survey design, leading-question bias and nine sampling techniques. Next it shows how to pull data from websites with regular expressions and pandas, and from social media through APIs. The last two sections cover cleaning (missing values, outliers, duplicates, scaling, encoding) and the storage, compression, indexing and cloud tools used for large datasets.
Key Points:
- Observational data records behavior without the researcher taking part; transactional data records events such as purchases, clicks or appointments.
- The sampling methods named include simple random, stratified, cluster, convenience, systematic, purposive, snowball, quota and volunteer sampling.
- The 1936 Literary Digest poll is the book’s example of how a biased sampling frame produces a wrong forecast.
- Missing data is classed as MCAR, MAR or MNAR and handled by deletion or imputation; outliers are found with box plots, histograms or the IQR.
- Min-max normalization rescales values to a 0 to 1 range, and one-hot encoding turns categories into numbers.
- Lossless compression (ZIP, PNG) keeps all the data; lossy compression (MP3, JPEG) discards less important detail.
Practice Tip: Use pd.read_html() on a web page that has a table, convert a text column with pd.to_numeric() and save the result with to_csv(). Notice how much of the work was cleaning rather than analysis.
Common Mistake: Treating a convenient sample as a representative one. A larger sample reduces sampling error, but it cannot repair a biased sampling frame.
Important Questions:
- What is the difference between open-ended and closed-ended survey questions? Open-ended questions give detailed and sometimes unexpected answers; closed-ended questions offer fixed choices and produce data that is easy to quantify.
- How does lossy compression differ from lossless compression? Lossy compression throws away less important detail to save space, while lossless compression preserves all of the data.
Chapter 3: Descriptive Statistics: Statistical Measurements and Probability Distributions
Unit 2: Analyzing Data Using Statistics · Difficulty: Medium · Key topics: mean, median, mode, variance, standard deviation, percentiles, quartiles, z-score, probability, Bayes’ Theorem, binomial, Poisson, normal distribution
This chapter builds the statistics toolkit the rest of the book relies on. It starts with measures of center (mean, trimmed mean, median, mode), then measures of variation (range, variance, standard deviation, coefficient of variation) and measures of position (percentiles, quartiles, IQR, z-scores). Sections 3.4 and 3.5 turn to probability: sample spaces, events, conditional probability and Bayes’ Theorem, followed by the binomial, Poisson, exponential and normal distributions. Python’s describe() and scipy.stats functions do the calculations, with Excel and R shown in the appendices.
Key Points:
- Outliers pull the mean but barely move the median; a trimmed mean drops a set percentage from both ends before averaging.
- Sample variance divides by
n - 1; population variance divides byN. - Standard deviation is the square root of variance, in the same units as the data; the coefficient of variation is the standard deviation divided by the mean, as a percentage.
- Outlier bounds sit 1.5 IQRs below Q1 and above Q3, and a z-score beyond -3 or +3 is often flagged.
- Conditional probability is P(A and B) divided by P(B); Bayes’ Theorem revises a probability with new evidence, such as a screening test result.
- The empirical rule says about 68%, 95% and 99.7% of normal values fall within one, two and three standard deviations of the mean.
Practice Tip: Run describe() on a numeric column, add one extreme value and run it again. Watch the mean jump while the median hardly moves, then try binom.pmf from scipy.stats on a success-count question.
Common Mistake: Dividing by n when you should divide by n - 1. Use the sample formula whenever your data is only a sample of the population.
Important Questions:
- Why is the median often better than the mean for salary data? One very large income inflates the mean, but the median stays near what most employees earn.
- When is the Poisson distribution used instead of the binomial? Poisson counts events in a fixed interval given an average rate (such as vehicles per 10 minutes), while binomial counts successes in a fixed number of independent two-outcome trials.
Chapter 4: Inferential Statistics and Regression Analysis
Unit 2: Analyzing Data Using Statistics · Difficulty: Medium · Key topics: confidence intervals, central limit theorem, hypothesis testing, p-value, Type I and II errors, correlation, least squares, ANOVA
Chapter 4 shows how to draw conclusions about a population from a sample. Section 4.1 covers point estimates, confidence intervals, margin of error and the central limit theorem. Section 4.2 sets up hypothesis tests with null and alternative hypotheses, p-values, significance levels and Type I and II errors, using z-tests and t-tests for means and proportions. Section 4.3 introduces scatterplots, Pearson’s correlation coefficient and the least-squares line, and Section 4.4 finishes with one-way ANOVA and the F-statistic for comparing three or more means.
Key Points:
- Higher confidence widens an interval, and a larger sample narrows it.
- Sample means are roughly normal when the sample has at least 30 observations or the population is normal (central limit theorem).
- With an unknown population standard deviation, use the t critical value with
n - 1degrees of freedom; scipy.stats offerst.ppf. - Reject the null hypothesis when the p-value falls below the significance level (typically 0.01, 0.05 or 0.10); a Type I error rejects a true null, a Type II error fails to reject a false one.
- The correlation coefficient
rruns from -1 to 1, and the least-squares line minimizes the squared residuals. - One-way ANOVA tests whether all group means are equal using the F-statistic, between-group variation divided by within-group variation, with
f_oneway()in SciPy.
Practice Tip: Take ten x-y pairs, compute pearsonr and linregress from scipy.stats, plot the points with plt.scatter and draw the fitted line. The gaps between points and line are the residuals.
Common Mistake: Reading a significant ANOVA result as telling you which group is different. It only says that at least one mean differs.
Important Questions:
- What does a p-value tell you in a hypothesis test? It measures how surprising your sample result would be if the null hypothesis were true; if it is below the significance level, you reject the null.
- What is the difference between a Type I and a Type II error? A Type I error rejects a null hypothesis that is true, and a Type II error fails to reject one that is false.
Chapter 5: Time Series and Forecasting
Unit 3: Predicting and Modeling Using Data · Difficulty: Medium · Key topics: time series, trend, seasonality, decomposition, moving average, differencing, ARIMA, MAE, RMSE, MAPE, prediction intervals
Chapter 5 begins with the idea that we cannot see the future, but patterns in past data make some outcomes more likely. Section 5.1 defines time series data and compares naive, moving-average and linear-regression forecasts on S&P 500 data. Section 5.2 splits a series into trend, cyclic, seasonal and noise components. Section 5.3 covers detrending with moving averages, differencing, regression and STL, then the ARIMA procedure with autocorrelation functions. Section 5.4 measures forecast error and builds prediction intervals with statsmodels.
Key Points:
- Time series data is measurements of one variable recorded at regular intervals and kept in order.
- Decomposition separates trend, cyclic, seasonal and noise parts; they combine additively (summed) or multiplicatively (multiplied), and logarithms turn a multiplicative model into an additive one.
- Residuals estimate the noise, which should behave like white noise.
- Moving averages can be simple, weighted or exponential, and differencing helps reveal a trend.
- MAE and RMSE depend on the scale of the data; MAPE and sMAPE do not, but they should not be used when values are zero or negative.
- Holding out part of the data for testing reduces the risk of overfitting a forecast.
Practice Tip: Load a price CSV, convert the date column with pd.to_datetime(), plot it with DataFrame.plot() and mark by eye where you see a trend or a repeating season before you compute any moving average.
Common Mistake: Judging a forecast on the same data used to build it. A model can look perfect on its own history and still forecast badly.
Important Questions:
- What are the components of a time series? Trend, cyclic, seasonal and noise; the cyclic part is often merged with the trend into a trend-cycle component.
- Why might you prefer MAPE to RMSE? MAPE is a percentage, so it can compare forecasts across series of different scales, but it should not be used when values are zero or negative.
Chapter 6: Decision-Making Using Machine Learning Basics
Unit 3: Predicting and Modeling Using Data · Difficulty: Medium · Key topics: supervised and unsupervised learning, overfitting, logistic regression, k-means, DBScan, confusion matrix, decision trees, entropy, random forest, naive Bayes
Chapter 6 introduces machine learning as models that adjust internal parameters to turn inputs into outputs. Section 6.1 contrasts supervised and unsupervised learning, explains training and test data, and warns about overfitting and underfitting. Section 6.2 uses logistic regression for yes or no classification and k-means and DBScan for clustering. Section 6.3 adds bootstrapping and multiple linear and logistic regression with scikit-learn, Section 6.4 builds decision trees with entropy and information gain, and Section 6.5 covers random forests, naive Bayes classifiers and strategies for big data.
Key Points:
- Supervised learning uses labeled data with known outcomes; unsupervised learning looks for clusters and structure in unlabeled data.
- Data is typically split about 60 to 80 percent for training and the rest for testing.
- Overfitting captures noise and generalizes poorly; underfitting misses real patterns.
- Logistic regression fits an S-shaped sigmoid curve for yes or no outcomes; k-means groups points around centroids; DBScan groups by local density and labels isolated points as noise.
- Entropy measures unpredictability, and information gain (the drop in entropy after a split) chooses the best split; pruning removes splits that isolate tiny subsets.
- A random forest is a set of bagged decision trees; scikit-learn gives
RandomForestRegressor,GaussianNB,accuracy_scoreandconfusion_matrix.
Practice Tip: Fit DecisionTreeClassifier(max_depth=3) on a small dataset and call tree.plot_tree to read the questions the tree asks. Then raise max_depth and compare accuracy on the training and test sets.
Common Mistake: Reporting accuracy on the training data. A model that has memorized noise scores well there and fails on new data, which is why the chapter keeps a test set.
Important Questions:
- What is the difference between supervised and unsupervised learning? Supervised learning trains on labeled data to predict known outcomes, while unsupervised learning searches unlabeled data for clusters or structure.
- What is overfitting and why is it a problem? An overfitted model captures noise in the training data, so it generalizes poorly to new data.
Chapter 7: Deep Learning and AI Basics
Unit 3: Predicting and Modeling Using Data · Difficulty: Hard · Key topics: neural networks, activation functions, perceptron, backpropagation, loss functions, gradient descent, Keras, convolutional neural networks, natural language processing
Chapter 7 starts from the human brain as inspiration and defines artificial intelligence as a branch of computer science and data science. Section 7.1 explains neurons, weights, biases, layers and activation functions, with the perceptron as the simplest network. Section 7.2 covers loss functions, gradient descent, learning rate, epochs and static backpropagation. Section 7.3 builds a Keras classifier for handwritten digits, Section 7.4 introduces convolutional networks with filters, pooling and feature maps, and Section 7.5 traces natural language processing from ELIZA to transformer-based large language models.
Key Points:
- A neuron multiplies its inputs by weights, adds a bias and passes the result through an activation function such as step, sigmoid, tanh, ReLU or softmax.
- A perceptron is a single-layer network for true or false decisions, trained by nudging weights and bias with an error and a learning rate.
- Backpropagation adjusts weights and biases to reduce loss by working backward from the output layer; the learning rate is the step size and an epoch is one full pass through the training data.
- Loss should match the task: mean squared error for continuous predictions, binary cross-entropy or hinge loss for two classes, sparse categorical cross-entropy with softmax for many classes.
- The Keras workflow in the book is
Sequential,Dense,compile,fitandevaluate. - A convolutional network slides a small filter over an image, pools feature maps to shrink them, and finishes with fully connected layers; transformers with self-attention power modern large language models.
Practice Tip: Build the Sequential and Dense digit classifier, then change the number of epochs and compare the evaluate() scores. You will see for yourself what training longer does and does not buy.
Common Mistake: Choosing a loss function that does not match the output layer. A multi-class problem needs softmax outputs with a categorical loss, not a loss meant for a single continuous value.
Important Questions:
- What does a single artificial neuron compute? It multiplies each input by a weight, adds a bias and passes the total through an activation function.
- What is backpropagation used for? It works backward from the output layer to adjust the weights and biases so that the loss gets smaller.
Chapter 8: Ethics Throughout the Data Science Cycle
Unit 4: Maintaining a Professional and Ethical Data Science Practice · Difficulty: Easy · Key topics: privacy, informed consent, anonymization, GDPR, HIPAA, algorithmic bias, fairness, transparency, honest visualization, accessibility
Chapter 8 follows ethics through each stage of the cycle. Section 8.1 covers collection: privacy, informed consent, anonymization and pseudonymization, confidentiality, and regulations such as GDPR, CCPA/CPRA and HIPAA, along with breach planning and data governance. Section 8.2 covers analysis and modeling, defining bias and fairness, using the COMPAS recidivism tool as a case, and stressing transparency and accountability. Section 8.3 covers honest charts, source attribution and accessibility for audiences facing disability, language, literacy or digital-divide barriers.
Key Points:
- Informed consent involves disclosure, understanding, voluntariness and agreement, and it should be ongoing.
- Anonymization and pseudonymization protect identities; confidentiality covers personally identifiable information.
- Biased data, whether accidental or deliberate, produces unfair models, which is called algorithmic bias.
- Interpretability, transparency, human oversight and accountability apply to automated decisions.
- Charts need clear titles, labels, legends and consistent, proportionate axes; hiding or cherry-picking data distorts findings.
- Causal claims need supporting evidence, and non-public data needs permission before you attribute or share it.
Memory Tip: Ask one question at each stage of the cycle. Collecting: who is this data about? Modeling: who could this model treat unfairly? Reporting: who could this chart mislead?
Common Mistake: Treating ethics as a final checkbox. The chapter places it at every stage, from the survey form to the last chart.
Important Questions:
- What makes consent informed? Disclosure of what the data will be used for, understanding by the person, voluntary participation and clear agreement, with consent revisited as the project changes.
- What is algorithmic bias? Unfair model results that come from biased data, whether the bias is accidental or deliberate; fairness means the absence of such bias.
Chapter 9: Visualizing Data
Unit 4: Maintaining a Professional and Ethical Data Science Practice · Difficulty: Medium · Key topics: boxplot, histogram, Pareto chart, line chart, probability distribution plots, heatmap, choropleth, GeoPandas, Seaborn, 3D graphs
Chapter 9 presents visualization as a way to find patterns, trends, relationships and outliers and to share them with decision makers. Section 9.1 produces boxplots, histograms and Pareto charts for a single variable. Section 9.2 draws labeled line charts for data over time, with rules for titles, units and color. Section 9.3 plots binomial, Poisson and normal distributions and reads probability as area. Section 9.4 covers spatial and grid heatmaps and choropleth maps, and Section 9.5 shows scatterplots that use color for a third variable, correlation heatmaps and 3D graphs.
Key Points:
- A boxplot shows minimum, quartiles and maximum and helps spot outliers and skew; a histogram shows the shape of a numeric variable across equal-width bins.
- A Pareto chart pairs descending bars with a cumulative-percentage line to find the biggest contributors to a problem.
- A line chart puts time on the horizontal axis; include a title, labeled axes with units and the data source.
- Use three to five high-contrast colors and avoid red-green pairs, which colorblind readers cannot tell apart.
- Plot discrete distributions as bars with
binom.pmfandpoisson.pmf, and a continuous one as a curve withnorm.pdf. - A choropleth colors regions by a measured value,
sns.heatmap()draws grid heatmaps, andcorr()builds the matrix behind a correlation heatmap.
Practice Tip: Plot the same numeric column with plt.hist and plt.boxplot, then write one sentence on what each chart shows that the other hides.
Common Mistake: Picking a chart because it looks impressive instead of because it answers the question. The chapter matches each goal, such as comparing groups or showing parts of a whole, to a chart type.
Important Questions:
- When should you use a Pareto chart? When you want to find the few categories that contribute most to a problem, because it shows descending bars and a cumulative-percentage line.
- What does a choropleth show? It colors geographic regions, such as counties or countries, according to a measured value.
Chapter 10: Reporting Results
Unit 4: Maintaining a Professional and Ethical Data Science Practice · Difficulty: Medium · Key topics: report structure, audience, data dictionary, model validation, cross-validation, bootstrapping, error measures, executive summary
The last chapter argues that communicating findings is part of data science, not an extra. Section 10.1 covers report structure, four types of audience, and documentation with data dictionaries and version control. Section 10.2 covers validating a model: train, validation and test splits, k-fold and leave-one-out cross-validation, bootstrapping, grid search, error measures such as accuracy, precision, recall, F1, RMSE, AIC and BIC, and sensitivity analysis. Section 10.3 explains how to write a one-to-two-page executive summary, with a Python example that produces a PDF summary for a diabetes detection study.
Key Points:
- A standard report has a title page, executive summary, methodology, data exploration and analysis, results and discussion, and conclusion.
- The four audiences are experts, technicians, executives and nonspecialists; executives often get a KPI dashboard.
- A data dictionary (codebook) documents each variable, and version control such as Git or SVN tracks changes.
- A three-way split (training, validation, testing) is used to choose among models; scikit-learn gives
cross_val_scoreandGridSearchCV. - An executive summary moves through the business problem, data and methods, main findings in plain language, and recommendations.
- Advice in a summary should offer options rather than orders, ordered by likely impact and feasibility.
Practice Tip: Take a classifier from Chapter 6, run cross_val_score on it and then write a four-sentence executive summary in the order problem, method, finding, recommendation.
Common Mistake: Filling a summary with raw statistics. The chapter wants you to explain what the results mean for the reader, in plain language, not list every number.
Important Questions:
- What are the four parts of an executive summary? The business problem, the data and methods, the main findings in plain language, and the closing recommendations.
- Why use cross-validation instead of a single train and test split? It tests the model on several different splits, so the score depends less on one lucky or unlucky division of the data.
Appendices A to D: Excel, R Studio and Python References
Appendix · Difficulty: Easy · Key topics: Excel charts and statistics, R Studio, correlation and regression in R, Python algorithm index, Python function index
The four appendices are review and reference material. Appendix A reviews Excel for data science, including its menus and functions, bar charts and scatterplots, and basic statistics such as averages and standard deviations. Appendix B introduces R Studio, the free open-source statistics tool, with commands for scatter plots, correlation and regression based on S&P 500 stock returns. Appendix C is a cross-reference to the Python algorithms in the book, linked to the sections where they appear. Appendix D lists Python functions for data handling, statistics and visualization, and groups the machine learning methods by purpose.
Key Points:
- Appendix A is for spreadsheet users: Excel menus and functions, bar charts, scatterplots, averages and standard deviations.
- Appendix B shows R as an alternative to Python for exploring and visualizing data, including correlation and regression.
- Appendix C maps each Python algorithm in the book back to its section, from data handling and visualization to machine learning and neural networks.
- Appendix D groups Python functions by library and groups machine learning methods by purpose, such as forecasting, classification and regression.
Practice Tip: When you forget a function name while doing a chapter exercise, look it up in Appendix D, then type it into a Colab cell and run it on a small example.
Common Mistake: Skipping the appendices. Chapter 3 points to Excel and R for the same statistics, so spreadsheet users can follow the chapter with Appendix A beside them.
Important Questions:
- Which appendix is a cross-reference to the Python algorithms in the book? Appendix C, which links each algorithm to the section where it is explained.
- Which tools do Appendices A and B cover? Appendix A covers Microsoft Excel and Appendix B covers R through R Studio.
Download Principles of Data Science PDF (Free)
Principles of Data Science is free from its official publisher, OpenStax. Click the button below to open the official OpenStax book page, where you can download the complete PDF or read every chapter online in your browser.
↓ Download PDFHow to Study This Book
Principles of Data Science has 10 chapters in four units, plus four appendices, and this page gives one block for each chapter and one for the appendices. Unit 1 (Chapters 1 and 2) introduces the data science cycle and data collection. Unit 2 (Chapters 3 and 4) is a self-contained statistics unit. Unit 3 (Chapters 5 to 7) is described by the authors as the core of the book: forecasting, machine learning and deep learning. Unit 4 (Chapters 8 to 10) covers ethics, visualization and reporting. The book assumes no more than college algebra and no real coding experience.
Start with Chapters 1 and 2 and set up Google Colab before you read Section 1.5, because the Pandas and Matplotlib commands there are used in every later chapter. Read Section 1.3 slowly: the split between quantitative and categorical data, and between structured and unstructured data, decides which method fits in later chapters. Chapter 2 is practical and easy to read, but practise the pandas commands for reading tables and converting text columns as you go.
Chapters 3 and 4 are the part to study slowly, because everything after them leans on them. Read Chapter 3 before Chapter 4: the standard deviation, z-score and normal distribution in Sections 3.2, 3.3 and 3.5 are the base for the confidence intervals and hypothesis tests in Chapter 4. Chapter 4 covers z-tests and t-tests, correlation, least squares and one-way ANOVA. It does not cover chi-square tests, and the text itself calls two-way ANOVA beyond its scope, so use a dedicated statistics book if your course needs them.
Read Chapter 5 before Chapter 6, because Section 5.4 introduces forecast error and the idea of holding out test data, which Chapter 6 develops as training, testing, overfitting and underfitting. In Chapter 6, learn the idea of supervised versus unsupervised learning first, then logistic regression and k-means, and then decision trees, since Section 6.5 builds random forests on them. Chapter 7 is the hardest in the book: do Section 6.1 first, then follow Sections 7.1 to 7.3 in order, because backpropagation and Keras make sense only after weights, biases and loss are clear. Sections 7.4 and 7.5 are introductions to convolutional networks and language models, not full courses.
Chapter 8 can be read at any time and is a good break after Chapter 7. Its COMPAS case and the four elements of informed consent are good material to revise for short-answer questions. Chapter 9 reuses the plotting commands from earlier chapters, so skim the sections you already know and spend time on the heatmap, choropleth and 3D sections, which are new. Finish with Chapter 10, which turns your analysis into a report: do the validation Section 10.2 before the executive summary Section 10.3.
Every chapter has its own end-of-chapter study aids, and the set varies by chapter: key terms, group projects, chapter review questions, critical thinking questions and quantitative problems. A back-matter answer key covers selected questions, not full solutions, so attempt each question on paper first and compare your answers with a classmate or teacher. Use the key terms list to revise before exams.
Know what the book does not do. It is an introduction, so the machine learning and deep learning chapters give you the ideas and working examples but not the mathematics behind them, and Section 2.5 explains big data concepts without teaching a framework such as Hadoop or Spark. Many examples and datasets come from the United States, so add local examples when you write exam answers. Python is the main tool, with Excel and R in the appendices, so you need an internet connection and a Google account to follow the Colab examples.
Used In These Programs
This book is used for the Introduction to Data Science course in: BS Data Science · BS Computer Science. Browse all Data Science books or all Computer Science books.
Who Should Read This
Principles of Data Science is written for first-course students: BS Data Science and BSCS students in their early semesters, students of BS Software Engineering and BS Information Technology who need a data science elective, and students from business, health sciences, engineering and the sciences who want to work with data. Because it needs only college algebra, it also suits self-learners who are starting from zero. It is not a deep statistics or machine learning theory text, so pair it with a specialist book when your course goes further.
If you have never programmed, Python for Everybody or Think Python gives you a slower start in the language before the Pandas code in Chapter 1. If mean, median, probability and regression feel rusty, the intermediate-level Statistics Class 12 (ICS) and Statistics Class 11 (ICS) books cover the basics in a gentler way before you start Chapters 3 and 4.
Applicable Universities
This book is useful for students at Pakistani universities offering BS Data Science, BS Computer Science and related programs, including Punjab University, Virtual University, COMSATS, FAST, UET, NUST, and other HEC-recognized institutions.
FAQs
Is Principles of Data Science by OpenStax free?
Yes. OpenStax publishes it under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) licence. You can read it online or download the PDF for free from openstax.org. You may share and adapt it for non-commercial use if you credit OpenStax and keep the same licence.
Which edition is this, and is it up to date?
OpenStax published the book on January 24, 2025, and its title carries no edition number. The tools it teaches, Python with Pandas, Matplotlib, SciPy, scikit-learn and Keras, are the standard ones in 2026, and the machine learning and AI chapters are recent. Check the OpenStax book page for the latest version before you download.
Do I need programming experience to use this book?
No. The authors assume no more than college algebra and no significant coding background. Section 1.5 sets up Google Colab and teaches Pandas and Matplotlib from the start, and foundational statistics is included in Chapters 3 and 4 for students with a limited statistics background. A short Python course alongside it still helps.
Does it include solved exercises or answers?
Partly. Chapters end with key terms, group projects, chapter review questions, critical thinking questions and quantitative problems, and the set varies by chapter. A back-matter answer key covers selected questions, not full solutions. This page gives two practice questions with short answers for every chapter, and you should attempt the book’s own questions first.
Does it cover machine learning and deep learning?
Yes, at an introductory level. Chapter 6 covers supervised and unsupervised learning, logistic regression, k-means, DBScan, decision trees, random forests and naive Bayes. Chapter 7 covers neural networks, backpropagation, Keras, convolutional networks and natural language processing. It gives the ideas and working examples, not the full mathematics, so use a specialist book for theory.
Does it use Python, R or Excel?
Python is the main tool, run in Google Colab with Pandas, Matplotlib, SciPy and scikit-learn. Excel and R Studio are covered in Appendices A and B for students who prefer a spreadsheet or R, and Appendices C and D list the Python algorithms and functions used in the book.
Related Books
- Python for Everybody (a gentle start in Python before the Pandas code in Chapter 1)
- Think Python (stronger Python fundamentals for the code in Chapters 2 to 10)
- Statistics Class 12 (ICS, Punjab Board) (probability and regression basics before Chapters 3 and 4)
- Statistics Class 11 (ICS, Punjab Board) (measures of center and spread explained at intermediate level)
Principles of Data Science gives BS Data Science and BSCS students a free, complete first course in the subject, from collecting and cleaning data to statistics, machine learning and honest reporting. Browse more Computer Science books or all University Books.
Principles of Data Science, by Shaun V. Ault, Soohyun Nam Liao and Larry Musolino (senior contributing authors) and contributing authors Wisam Bukaita and Aeron Zentner. OpenStax, Rice University, 2025. Free under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International licence (CC BY-NC-SA 4.0). Access for free at https://openstax.org/details/books/principles-data-science
© Copyright Policy
Freebooks.pk is an educational resource for students in Pakistan. Textbooks and other books belong to their respective boards, authors and publishers, and all rights remain with them. If you are the copyright holder of any material on this page and want it changed or removed, please contact us or file a request under our DMCA policy. We review every request and remove reported content promptly.
