Photo by Cezar Sampaio on Unsplash

If Music is a Place — then Jazz is the City, Folk is the Wilderness, Rock is the Road, Classical is a Temple.

— Vera Nazarian

Music is an essential part of our lives and, music streaming companies like Spotify are nowadays using machine learning to create recommendations for us. Music genres play a big role in creating these recommendations. In this story, we will build a model for the classification of music tracks into their respective genres. For this tutorial, we‘ll use librosa, a library for music and audio analysis. …


Photo by Solen Feyissa on Unsplash

Do you often receive emails saying that you have won $1 million or free mobile recharges for life? These emails are generally spam and are sent in bulk to users to trick them. In this story, we’ll build a classifier that will mark emails as spam or non-spam based on the text that they contain. We will use the Spam Mails Dataset from Kaggle to train the classifier.

Importing Libraries

Let’s first import the required libraries. If you don’t have a particular library installed, run the command ‘pip install <package_name>’ to install it.

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import…


Photo by Jorge Ramirez on Unsplash

What is a Cache?

A cache is a memory used for the storage of frequently used data so that this data can be fetched quickly for subsequent calls. In Python, the library functools gives us the ability to implement a cache. This cache stores the result of previous operations to speed up our function calls.

LRU Cache

The LRU Cache is a type of cache in which the least recently used data is discarded first. This LRU algorithm keeps track of which data was used when. For speeding up the python functions, we will use an LRU cache. …


Photo by Catalin Pop on Unsplash

Disasters can be unexpected and life-threatening. We will analyze and classify disaster tweets in this tutorial. For this purpose, we will use the Disaster Tweets dataset from Kaggle.

Importing Libraries

Let’s first import the required libraries. If you don’t have a particular library installed, run the command ‘pip install <package_name>’ to install it.

import re
import string
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from wordcloud import WordCloud
from collections import defaultdict
from collections import Counter
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import Embedding,LSTM,Dense,SpatialDropout1Dfrom…


Photo by Clay Banks on Unsplash

Dogecoin (DOGE) is a cryptocurrency created as a joke, making fun of the wild speculation in cryptocurrencies at the time. Dogecoin features the face of the Shiba Inu dog from the “Doge” meme as its logo. It has quickly developed its own online community, reaching a gigantic market capitalization. In this tutorial, we will predict the prices of Dogecoin. For this purpose, we’ll use the Dogecoin Historical Data from Kaggle.

Importing Libraries

Let’s first import the required libraries. If you don’t have a particular library installed, run the command ‘pip install <package_name>’ to install it.

import numpy as np
import pandas as pd
import…


Photo by Jan Antonin Kolar on Unsplash

Alexa is an AI-based virtual assistant developed by Amazon. It is today used in devices like Echo, Dot, and Firestick. It is capable of voice interaction, music playback, setting alarms, home automation, and providing weather information. We will do sentiment analysis on the reviews of Alexa products posted on Amazon. For this, we’ll use the Alexa Reviews dataset from Kaggle.

Importing Libraries

Let’s first import the required libraries. If you don’t have a particular library installed, run the command ‘pip install <package_name>’ to install it.

import os
import re
from string import punctuation
from textblob import Word
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as…


Credits: heart.org

A stroke occurs when the blood supply to part of your brain is interrupted, preventing brain tissue from getting oxygen and nutrients. Due to this, brain cells begin to die in minutes. We’ll use 11 features of a person to predict whether they will get a stroke or not.

Importing Libraries

Let’s first import the required libraries. If you don’t have a particular library installed, run the command ‘pip install <package_name>’ to install it.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.preprocessing import LabelEncoder
from imblearn.over_sampling import SMOTE
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier…


Photo by Markus Winkler on Unsplash

Can we predict the price of Bitcoin, an asset that is so volatile? Let’s try to find out. We will use the Bitcoin Historical dataset to predict Bitcoin price.

Importing Libraries

Let’s first import the required libraries. If you don’t have a particular library installed, run the command ‘pip install <package_name>’ to install it.

import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression

Loading the Dataset

We’ll have downloaded the data from Kaggle and unzipped it. Let us load it into our notebook now.

bitcoin = pd.read_csv('./bitcoin/bitstampUSD_1-min_data_2012-01-01_to_2021-03-31.csv')

Exploring the Dataset

Let’s print the shape of the dataset.

bitcoin.shape


Photo by Alonso Reyes on Unsplash

The Titanic struck an iceberg on 15 April 1912 that caused its sinking, leading to the death of more than 1,500 people. This made it one of the deadliest sinking of a single ship. We will try to predict whether a particular person on Titanic survived or not using 11 features about them. For this purpose, we will use the Titanic dataset from Kaggle.

Importing Libraries

Let’s first import the required libraries. If you don’t have a particular library installed, run the command ‘pip install <package_name>’ to install it.

import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as…


Photo by Ralph Kelly on Unsplash

A house’s price can depend on surprisingly weird features. We will try to predict a house’s price through its 79 features. For this purpose, we’ll be using the House Prices dataset from Kaggle.

Importing Libraries

Let’s first import the required libraries. If you don’t have a particular library installed, run the command ‘pip install <package_name>’ to install it.

import os
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import skew
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor

Loading the Datasets

We’ll have downloaded the data from Kaggle and unzipped it in a directory named…

Sidharth Pandita

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store