Back

Sanskar

Keen Learner and Exp... • 1m

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

Sanskar

Keen Learner and Exp... • 23d

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

Sanskar

Keen Learner and Exp... • 21d

Day 7 of learning Data Science as a beginner. Topic: Indexing and Slicing NumPy arrays Since a past few days I have been learning about NumPy arrays I have learned about creating arrays from list and using other numpy functions today I learned abou

See More
Reply
1
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 • 1m

🚀 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... • 1m

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

Sanskar

Keen Learner and Exp... • 15d

Day 9 of learning Data Science as a beginner. Topic: Data Types & Broadcasting NumPy offers various data types for a variety of things for example if you want to store numerical data it will be stored in int32 or int64 (depending on your system's a

See More
Reply
3

Sanskar

Keen Learner and Exp... • 16d

Day 8 of learning Data Science as a beginner topic: multidimensional indexing and axis NumPy also allows you to perform indexing in multidimensional arrays i.e. in simple terms numpy allows you to access and manipulate elements even in arrays conta

See More
Reply
2

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

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