Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Bioinformatics with Python Cookbook

You're reading from   Bioinformatics with Python Cookbook Use modern Python libraries and applications to solve real-world computational biology problems

Arrow left icon
Product type Hardcover
Published in Jan 2026
Publisher Packt
ISBN-13 9781836642756
Length
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Tiago Antao Tiago Antao
Author Profile Icon Tiago Antao
Tiago Antao
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

1. Bioinformatics with Python Cookbook, Fourth Edition: Solve advanced computational biology problems and build production pipelines with Python & AI tools FREE CHAPTER
2. Chapter 1: Computer Specifications and Python Setup 3. Chapter 2: Basics of Data Manipulation 4. Chapter 3: Modern Coding Practices and AI-generated coding 5. Chapter 4: Data Science and Graphing 6. Chapter 5: Alignment and Variant Calling 7. Chapter 6: Annotation and Biological Interpretation 8. Chapter 7: Genomes and Genome Assembly 9. Chapter 8: Accessing Public Databases 10. Chapter 9: Protein Structure and Proteomics 11. Chapter 10: Phylogenetics 12. Chapter 11: Population Genetics 13. Chapter 12: Mectabolic Modeling and Other Applications 14. Chapter 13: Genome Editing

Exploring breast cancer traits using Decision Trees

Next, we will discuss exploratory analysis based on Decision Trees. Decision trees are a set of rules that classify our data – they may sound simple at first, but they can be very powerful. The big advantage of Decision Trees is that they will give us the rules that constructed the decision tree, providing some understanding of what is going on with our data.

Getting ready

We’ll use the sklearn Breast Cancer dataset as before. The code for this recipe can be found in Ch04/Ch04-4-decision-trees.ipynb.

How to do it...

  1. First, we’ll import our libraries:
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier, plot_tree
from sklearn.metrics import (
    accuracy_score,
    confusion_matrix,
    classification_report,
    precision_score,
    recall_score,
    f1_score
)
import matplotlib.pyplot as plt
import seaborn as...
lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Bioinformatics with Python Cookbook
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime
Modal Close icon
Modal Close icon