Keen Learner and Exp... • 2m
Day 12 of learning AI/ML as a beginner. Topic: TF-IDF practical. Yesterday I shared my theory notes and today I have done the practical of TF-IDF. For the practical I reused my spam classifier code and for TF-IDF I first imported it from the sklearn python library and then initialized it setting the max word to 100 then I converted it to an array. The I used numpy because array printing are configuration belongs to numpy library. I set edge item = 30 because I wanted to print the first and last 30 elements (usually numpy prints arrays as [1, 2, 3, ...., 98, 99,100] i.e. it hides the middle letters in ...). Then I set line width as 100000 so that the arrays are printed in a single line and is not wrapped (this also avoids confusion). Then in lambda function I used "%.3g" to make sure that there are normal numbers behind decimal (float) and it does not exceeds the three digits after that. I also got one step ahead and tried to use n grams in this and also printed a new array. Here's my code and its result.


Keen Learner and Exp... • 1m
Day 6 of learning Data Science as a beginner. Topic: creating NumPy arrays NumPy arrays can be created using various ways one of them is using python list and converting it into a numpy array however this is a long way here you first create a pytho
See More

Front-end Developer • 1y
#Array in #javascript: Array in Javascript enables storing a collection of multiple items under a single variable name, and has members for performing common array operations. Arrays aren't primitives but are instead Array #objects with the followin
See More



Download the medial app to read full posts, comements and news.