Back

Sanskar

Keen Learner and Exp...ย โ€ขย 2d

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.

2 Replies
1
13
1
Replies (2)

More like this

Recommendations from Medial

Image Description

Inayat Hasan

Software engineerย โ€ขย 1y

[This post has been deleted by the creator]

1 Reply
1
3

Prince Singh Chouhan

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
Reply
2

Shubham

Fearlessย โ€ขย 3d

๐Ÿš€ Day 4/21 โ€“ My JavaScript Learning Journey Todayโ€™s focus: Arrays in JavaScript ๐Ÿ“ฆ An Array is a special object in JS used to store multiple values in a single variable. ๐Ÿ”น Creating Arrays let fruits = ["Apple", "Banana", "Mango"]; ๐Ÿ”น Common Me

See More
Reply
3

Sanskar

Keen Learner and Exp...ย โ€ขย 3d

Day 11 of learning AI/ML as a beginner. Topic: TF-IDF (Term Frequency - Inverse Document Frequency). Yesterday I have talked about N-grams and how they are useful in Bag of Words (BOW) however it has some serious drawbacks and for that reason I am

See More
Reply
2

Somen Das

Senior developer | b...ย โ€ขย 1y

Array.reduce() is Goated the Swiss army knife Summing Numbers: Using reduce() to calculate the sum of numbers in an array. Flattening Arrays: Flattening a nested array into a single array. Grouping Objects: Grouping objects based on a speci

See More
Reply
5

Akash

ย โ€ขย 

Infosysย โ€ขย 1y

Do you know the difference between Framework and Library? If not then read this article - https://adv01.medium.com/framework-vs-library-885c944c3050

Reply
2
14

Arihant Jain

Crafting Impactful A...ย โ€ขย 2m

๐Ÿง  Programming Challenge of the Day Can you solve this? You're given an integer array (with both positive and negative values). Each element in the array represents the number of stars (*) to be printed vertically in its column: ๐Ÿ”น Positive values

See More
Reply
2
3

Abu Sufiyan

Businessย โ€ขย 9m

I want to open a library in my hometown. Where the number of students is very high, then it can be a good profitable business. Where children like to come and study in the library, then I need up to 30 lakh rupees. With this much money, a good librar

See More
Reply
3

Abu Sufiyan

Businessย โ€ขย 9m

I want to open a library in my hometown. Where the number of students is very high, then it can be a good profitable business. Where children like to come and study in the library, then I need up to 30 lakh rupees. With this much money, a good librar

See More
Reply
3
Image Description

Kevin Patel

Learner ๐Ÿ‚๐ŸคŽย โ€ขย 1y

Some one please guide me for the road map of the data science: Skill I do have right now is Python, numpy , pandas (learning) After completing pandas, numpy and Excel can I do freelancing.. It will be so helpful if someone guides me

2 Replies
5

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