-
Python Argparse এ হাতে খড়ি
মেশিন লার্নিং জগতে কিংবা পাইথন এডভান্স প্রোগ্রামিং এ আর্গুমেন্ট পার্সিং একটি মহা প্রয়োজনীয় কাজ। মূলত এটিকে Command Line Argument ও বলা হয়ে থাকে। Command Line Argument হলো কিছু ভ্যারিয়েবল টাইপ আর্গুমেন্ট যেগুলো কোন প্রোগ্রামিং স্ক্রিপ্ট রান টাইমে প্রদান করা হয়। যেমনঃ python test.py --value1 2 --value2 3 এখানে --value1 2...
-
Pandas Dataframe- Plot Examples with Matplotlib and Pyplot
Sample pandas dataframe for examples import pandas as pd df = pd.DataFrame({ 'name':['john','mary','peter','jeff','bill','lisa','jose'], 'age':[23,78,22,19,45,33,20], 'gender':['M','F','M','M','M','F','M'], 'state':['california','dc','california','dc','california','texas','texas'], 'num_children':[2,0,0,3,2,1,4], 'num_pets':[5,1,0,5,2,2,3] }) df name age gender state num_children num_pets 0 john 23 M california 2 5 1 mary 78 F dc 0 1 2 peter 22 M california 0 0 3 jeff 19...
-
Working with directory in python
Working with multiple directory is one of the trickiest work in python. We will solve this trickiest work in simple way. Defining base path using os.getcwd() we will define currect working directory as basepath. Our working path is ‘home/sagor/Desktop/hello’ import os BASE_PATH = os.getcwd() print(BASE_PATH) # output: home/sagor/Desktop/hello Done! initializing...
-
Word Embedding
Word Embedding is the vector representation of a particular word. In word embedding words or phrases from the vocabulary are mapped to vectors of real numbers. Word Embedding Software Word2Vec GloVe FastText Gensim word2vec Word2vec is a two-layer neural net that processes text. Its input is a text corpus and...
-
Extracting Compressed File in Python
In our daily life data compressing is a must need work for handling large data file. And also we need to decompress or extract data from compress data. Common compress file extension are zip, tar, tar.gz, bz2, 7z and so on. While working with python we need to know how...
-
A Gentle Introduction to Google Colaboratory
You are an enthusiastic learner on Machine Learning but you have no capability to purchase a big machine to train and test your model. Don’t worry! Google Colab is a perfect solution for you. Google Colab(Colaboratory) is a free cloud service to encourage machine learning research. Here is a simple...
-
Generate Bag of Word(Step by Step)
We know Neural Network or Machine Learning Algorithm need features to train. Bag of Words(BOW) is a method to extract features from text. STEPS: Document»Clean Text»Tokenize»Build Vocabulary»Generate Vectors Cleaning Text import re document = "Joe waited for the train. The train was late. Mary and Samantha took the bus. I...
-
Text Preprocessing
It’s important to preprocess text to make it machine understandable. Like image after obtaining text we need to normalize it. Text Normalization Text Normalization includes: Converting all letters to lower or upper case Converting number into words or removing numbers Removing punctuation mark, accent mark Removing whitespaces Expanding abbreviations Removing...