Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Machine Learning Algorithms

You're reading from   Machine Learning Algorithms Popular algorithms for data science and machine learning

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789347999
Length 522 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Giuseppe Bonaccorso Giuseppe Bonaccorso
Author Profile Icon Giuseppe Bonaccorso
Giuseppe Bonaccorso
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. A Gentle Introduction to Machine Learning FREE CHAPTER 2. Important Elements in Machine Learning 3. Feature Selection and Feature Engineering 4. Regression Algorithms 5. Linear Classification Algorithms 6. Naive Bayes and Discriminant Analysis 7. Support Vector Machines 8. Decision Trees and Ensemble Learning 9. Clustering Fundamentals 10. Advanced Clustering 11. Hierarchical Clustering 12. Introducing Recommendation Systems 13. Introducing Natural Language Processing 14. Topic Modeling and Sentiment Analysis in NLP 15. Introducing Neural Networks 16. Advanced Deep Learning Models 17. Creating a Machine Learning Architecture 18. Other Books You May Enjoy

Biclustering

In some specific scenarios, the dataset can be structured like a matrix, where the rows represent a category and the columns represent another category. For example, let's suppose we have a set of feature vectors representing the preference (or rating) that a user expressed for a group of items. In this example, we can randomly create such a matrix, forcing 50% of ratings to be null (this is realistic considering that a user never rates all possible items):

import numpy as np

nb_users = 100
nb_products = 150
max_rating = 10

up_matrix = np.random.randint(0, max_rating + 1, size=(nb_users, nb_products))
mask_matrix = np.random.randint(0, 2, size=(nb_users, nb_products))
up_matrix *= mask_matrix

In this case, we are assuming that 0 means that no rating has been provided, while a value bounded between 1 and 10 is an actual rating. The resulting matrix is shown in the following...

lock icon The rest of the chapter is locked
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 €18.99/month. Cancel anytime