Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Ira Joshi

Ira Joshi

Community Learner
Share
15Questions
14Answers
36.0KViews on questions

How to calculate information gain for each attribute with respect to a class in a document term matrix using sklearn in Python?

By using mutual_info_classif from sklearn in python we can implement information gain. Below is the code from sklearn.datasets import fetch_20newsgroups from sklearn.feature_selection import mutual_info_classif from sklearn.feature_extraction.text import CountVectorizer categories = ['talk.religion.misc',…

Data Science

Answered Nov 7, 2019 · 1.6K Views Read answer →

More members from the Data Science community

Learners asking and answering questions on the same topics — follow their questions and join in.

Latest Data Science Blogs

Guides, tips and career advice on Data Science from JanBask experts.

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.