<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shahidul Salim Shakib on Medium]]></title>
        <description><![CDATA[Stories by Shahidul Salim Shakib on Medium]]></description>
        <link>https://medium.com/@shakibkhanrock?source=rss-1c4e9d02ec47------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8gJDPX9VDlQp57Y0o-v1FA.jpeg</url>
            <title>Stories by Shahidul Salim Shakib on Medium</title>
            <link>https://medium.com/@shakibkhanrock?source=rss-1c4e9d02ec47------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 14:51:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shakibkhanrock/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Machine learning Lecture]]></title>
            <link>https://medium.com/@shakibkhanrock/machine-learning-lecture-6ef0c0d9ee47?source=rss-1c4e9d02ec47------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ef0c0d9ee47</guid>
            <category><![CDATA[lecture-notes]]></category>
            <category><![CDATA[teaching-and-learning]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Shahidul Salim Shakib]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 13:14:56 GMT</pubDate>
            <atom:updated>2022-02-25T13:16:08.404Z</atom:updated>
            <content:encoded><![CDATA[<h3>In the 1st lecture, we covered the basics of machine learning.</h3><p><strong>Resources:</strong></p><p><strong>Slide:</strong> <a href="https://drive.google.com/file/d/1b14nfvQAZ87Eg9rgl3cB24udaXO_Qu2b/view">Basics of machine learning</a></p><p><strong>Details:</strong> <a href="https://drive.google.com/file/d/1pfeW2QqoNOEoW7RgiXZowM2fx8H6jVbF/view">Basics of machine learning</a></p><p><strong>Website:</strong> <a href="https://www.javatpoint.com/machine-learning">Machine Learning Tutorial | Machine Learning with Python — Javatpoint</a></p><h3>In the 2nd lecture, we covered how to preprocess the data for machine learning.</h3><p><a href="https://colab.research.google.com/drive/16--0uhRd-8QjxeV0su3DDmrKg5gHEv4p?usp=sharing">Code</a></p><h3>In the 3rd lecture, we covered regression.</h3><p><strong>Slide:</strong> <a href="https://drive.google.com/file/d/1Q6cTCx0I8wbsx70I1jdzXFzawzRPAxQX/view">Regression analysis in machine learning</a></p><h3>In the 3rd lecture, we covered Linear regression.</h3><p><strong>Slide:</strong> <a href="https://drive.google.com/file/d/1V7fH26RXDs7ok8IWC44kfGoKVqnTYjon/view">Linear regression</a></p><p><a href="https://colab.research.google.com/drive/1sZCib6AXS2-OSCfqxobjUVU0t0P16U7x?usp=sharing"><strong>code</strong></a></p><h3>In the 4th lecture, we covered Multiple Linear regression.</h3><p><strong>Slide: </strong><a href="https://drive.google.com/file/d/1DlReCqBaD7k1rKiSKCkQSfZ3mYtbRNV4/view">Multiple Linear regression</a></p><p><a href="https://colab.research.google.com/drive/19lul3o8b6nFvEhxbKS54fzHt-0pUtwcz?usp=sharing"><strong>Code</strong></a></p><h3>In the 5th lecture, we covered Polynomial Linear regression.</h3><p><strong>Slide: </strong><a href="https://drive.google.com/file/d/1EgkDeRvSWJbGHAI2tmTPDqQKfesJbvD_/view">Polynomial Linear regression</a></p><p><a href="https://colab.research.google.com/drive/18uXq6G6pAqxB6FDOy0_bCZRPJD5JASM5?usp=sharing"><strong>Code</strong></a></p><h3>In the 6th lecture, we covered ML Model Evaluation, Over Fitting, Under Fitting, Bias, Variance.</h3><p><strong>Slide: </strong><a href="https://drive.google.com/file/d/1sLNQHUA94ek3Y8p4lspydABKXZhkS5wp/view">ML Model Evaluation, Over Fitting, Under Fitting, Bias, Variance</a></p><h3>In the 7th lecture, we covered support vector machine.</h3><p><strong>Slide:</strong> <a href="https://drive.google.com/file/d/1rYA6g3ZYdSGhBKlqmeS4rD0MtnrQ2tcN/view">Support vector machine</a></p><p><a href="https://drive.google.com/file/d/1bTimrzUt2hGMp-lFKtazNhOaVbX9wsda/view"><strong>Video</strong></a></p><h3>In the 8th lecture, we covered PCA.</h3><p><a href="https://drive.google.com/file/d/1qOgrg9C19e-yFPNHy2qTyryp6BpafC5F/view">Video 1</a></p><p><a href="https://drive.google.com/file/d/1tcLVFhPnlrKKWKo6YBd4fZYUn_iiwdTb/view">Video 2</a></p><h3>In the 9th lecture, we covered Bi-variate data and covariance.</h3><p><strong>Slide:</strong> <a href="https://drive.google.com/file/d/1LB0gP3wr1SYS00wXoXzxHdMZVE_KcGqR/view">Bi-variate data and covariance</a></p><h3>In the 10th lecture, we covered How to work with dataset.</h3><p><strong>Resources:</strong></p><p><a href="https://huggingface.co/course/chapter5/2?fw=tf">What if my dataset isn’t on the Hub?</a></p><p><a href="https://huggingface.co/course/chapter5/3?fw=tf">Time to slice and dice</a></p><p><a href="https://huggingface.co/course/chapter5/4?fw=tf">Big data? 🤗 Datasets to the rescue!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ef0c0d9ee47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bangla-Word-2-Vector]]></title>
            <link>https://medium.com/ieee-sb-kuet/bangla-word-2-vector-e67243216045?source=rss-1c4e9d02ec47------2</link>
            <guid isPermaLink="false">https://medium.com/p/e67243216045</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Shahidul Salim Shakib]]></dc:creator>
            <pubDate>Mon, 30 Sep 2019 06:11:14 GMT</pubDate>
            <atom:updated>2024-04-17T08:26:58.875Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*eRIhxfnhCP7yDkWh8cGZ3A.jpeg" /></figure><p>We know about mathematical vectors. A vector stores an array of numbers. Every image has a pixel. We can represent those pixels as a vector. Same as finding a way to represent words in a vector. What happens when we convert a word to a vector? We know that machine learning works with a numerical value, which is actually a vector. If we convert words into vectors, we can easily train our millions of pieces of data (numerical data) within a few minutes or a few hours (it depends on computer capability).</p><p>Word2Vec is a group of models which helps derive relations between a word and its contextual words.</p><p>We try to build Bangla word to vector. We follow this pipeline for this</p><ul><li>Collect data</li><li>Sentence tokenization</li><li>Removing punctuation</li><li>Detect common phrases</li><li>Removing Stop words</li><li>Lemmatization</li><li>Training</li></ul><h3>Sentence tokenization</h3><p>We tokenize sentence using some boundary condition. Example: দাঁড়ি(।), বিস্ময় চিহ্ন(!), প্রশ্নবোধক চিহ্ন(?) ইত্যাদি.These boundary condition helps to find the boundary of the sentence. We separate those data in a sentence. They have some boundary condition to separate in a sentence. Suppose we find a ‘.’(full stop),’” “‘(invaded coma) sign to separate the data to the sentence.</p><p>We can use NLTK (Natural Language Toolkit) python library for the English language. This library automatically tokenizes the sentence.</p><p><strong>Input</strong></p><p>ত্রিদেশীয় সিরিজের গ্রুপপর্বের শেষ ম্যাচে আজ চট্টগ্রামে আফগানিস্তানের মুখোমুখি হচ্ছে বাংলাদেশ। টস জিতে আগে ফিল্ডিং করবে সাকিব আল হাসানের দল। দলে মাত্র এক পরিবর্তন আনা হয়েছে। আবার দলে ফিরে এসেছেন সাব্বির রহমান।</p><p><strong>Output</strong></p><p>ত্রিদেশীয় সিরিজের গ্রুপপর্বের শেষ ম্যাচে আজ চট্টগ্রামে আফগানিস্তানের মুখোমুখি হচ্ছে বাংলাদেশ</p><p>টস জিতে আগে ফিল্ডিং করবে সাকিব আল হাসানের দল</p><p>দলে মাত্র এক পরিবর্তন আনা হয়েছে</p><p>আবার দলে ফিরে এসেছেন সাব্বির রহমান</p><p>Sample code using NLTK library for English:</p><pre>import nltk<br>text = &quot; In a catastrophic hurricane like Dorian, the loss of lives and homes can be overwhelming. But even in the midst of devastating sadness and disbelief, a far less urgent but perennial question can tug at the back of the mind.&quot;<br>sentences = nltk.sent_tokenize(text)</pre><pre>for sentence in sentences:<br>    print(sentence)</pre><h3>Removing punctuation</h3><p>In sentence, they have some unused punctuation. We should remove these punctuation because these creates ambiguity between words.</p><p>Example:</p><p><strong>Input</strong></p><p>ত্রিদেশীয় সিরিজের গ্রুপপর্বের”” শেষ ?,ম্যাচে আজ; চট্টগ্রামে আফগানিস্তানের মুখোমুখি হচ্ছে বাংলাদেশ</p><p><strong>Output</strong></p><p>ত্রিদেশীয় সিরিজের গ্রুপপর্বের শেষ ম্যাচে আজ চট্টগ্রামে আফগানিস্তানের মুখোমুখি হচ্ছে বাংলাদেশ</p><pre>from nltk.tokenize import RegexpTokenizer</pre><pre>tt=&quot;&quot;</pre><pre>sentences2=[]</pre><pre>for x in sentences:</pre><pre>tokenizer = RegexpTokenizer(r&#39;\w+&#39;)</pre><pre>text2=tokenizer.tokenize(x)</pre><pre>cnt=1</pre><pre>for x2 in text2:</pre><pre>if cnt==1:</pre><pre>tt+=x2</pre><pre>cnt=0</pre><pre>tt+=&quot; &quot;+x2</pre><pre>sentences2.append(tt)</pre><pre>tt=&quot;&quot;</pre><h3>Removing Stop words</h3><p>They have some word which does not affect our sentence meaning. These words do not express any sentiment in the sentence. We remove those stop words from the sentences. Some stop words example:</p><p><strong>Bangla stop words</strong></p><p>অতএব, অথচ, অথবা, অনুযায়ী,</p><p>অনেকে ে, অনেকেই, অন্তত,</p><p>অবধি, অবশ্য, অন্য, অনেক</p><p>Sample code using NLTK library for English:</p><pre>from nltk.corpus import stopwords</pre><pre>stop_words = set(stopwords.words(&quot;english&quot;))</pre><pre>m=[]</pre><pre>for sentence in sentences2:</pre><pre>words = nltk.word_tokenize(sentence)</pre><pre>without_stop_words = [word for word in words if not word in     stop_words]<br>  m.append(without_stop_words)</pre><h3>Lemmatization</h3><p>In this part, we convert our word into the base word. Suppose, we can write ‘do’ word in different form like does, done, doing. It is inefficient to write vector for every word. Because we have a huge number of word. Suppose we have 3 million words, it is difficult for us to map 3 million words as a vector. We can use WordNetLemmatizer in NLTK library which helps you to convert any word in base word in English.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*__070jo718GJ1XP7FPd8eA.png" /></figure><p>Sample code using NLTK library for English:</p><pre>from nltk.stem import PorterStemmer, WordNetLemmatizer<br>from nltk.corpus import wordnet<br>mm=[]</pre><pre>for x in m:<br>  m2=[]</pre><pre>for x2 in x:<br>     lemmatizer = WordNetLemmatizer()</pre><pre>x3=lemmatizer.lemmatize(x2, wordnet.VERB)</pre><pre>m2.append(x3)<br>  mm.append(m2)</pre><h3>Training</h3><p>Here, we use genism library to use skim gram, CBOW algorithm. We take a temporary file “word2vec.model”.</p><pre>path = get_tmpfile(&quot;word2vec.model&quot;)</pre><p>We initialize our model. We use some parameter.</p><pre>model = Word2Vec(mm,size=10,window=10, min_count=1,workers=13)</pre><p>1st parameter: refers to the text file.</p><p>2nd parameter: Size of the vector. Ex: They have size 150 which means our vector size is 150. To represent any word we need 150 size array.</p><p>3rd parameter: the size of the window They have a picture we see the first window take 3 word and 2nd window take 4 word which defines window size.</p><p>4th parameter: min_count means minimum frequency count of words.</p><p>5th parameter: workers means how many threads to use behind the scenes.</p><pre>model.save(&quot;word2vec.model&quot;)</pre><p>Then we save our model.</p><p>Sample code:</p><pre>import nltk<br>from gensim.models import Word2Vec<br># train model<br>model = Word2Vec(mm,size=10,window=10, min_count=1,workers=13)</pre><pre># summarize the loaded model<br>print(model)</pre><pre># summarize vocabulary</pre><pre>words = list(model.wv.vocab)<br>print(words)</pre><pre># access vector for one word</pre><pre>print(model[&#39;know&#39;])<br># save model</pre><pre>model.save(&#39;model.bin&#39;)</pre><pre># load model<br>new_model = Word2Vec.load(&#39;model.bin&#39;)</pre><pre>print(new_model)</pre><p>Now we check word 2 vector representation of any word.</p><pre>vector = model.wv[&#39;know&#39;]</pre><p>Find a similar word of ‘know’ word.</p><pre>w1=[&#39;know&#39;]<br>model.wv.most_similar(positive=w1)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e67243216045" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ieee-sb-kuet/bangla-word-2-vector-e67243216045">Bangla-Word-2-Vector</a> was originally published in <a href="https://medium.com/ieee-sb-kuet">IEEE SB KUET</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>