Recommender System using Python & python-recsys

python-recsys is a Python Library for implementing a Recommender System. Currently, python-recsys supports two Recommender Algorithms: Singular Value Decomposition (SVD) and Neighborhood SVD. Here is a QuickStart tutorial on using python-recsys for Recommender Systems. It takes movielens’s movie ratings dataset and shows examples about computing similarity between movie items and recommending movies to users. Here, … Read more

Recommender System using Python & Crab

Crab as known as scikits.recommender is a Python framework for building recommender engines integrated with the world of scientific Python packages (numpy, scipy, matplotlib). Currently, Crab supports two Recommender Algorithms: User-based Collaborative Filtering and Item-based Collaborative Filtering. Here is a tutorial on Introduction to Recommender Systems with Crab. It briefly explains about what Recommendation is, … Read more

Python: Read Write JSON

In this article, I will be showing how to read data from a JSON file and write data to a new JSON file using Python programming language. Suppose, I have the following JSON data which is saved in a file named sample-1.json. Download: sample-1.json {"votes": {"funny": 25, "useful": 59, "cool": 29}, "user_id": "1", "name": "User … Read more

Python: Read Write CSV

In this article, I will be showing how to read data from a CSV file and write data to a new CSV file using Python programming language. Here’s a scenario: Suppose, I have a CSV file with 3 columns (user_id, item_id, and star_rating). It has data of 100 users. Each user has rated 20 different … Read more

Python: Graph plotting with Matplotlib (Bar Chart)

This article deals with plotting line graphs with Matplotlib (a Python’s library). Below is the data which we will use to plot the bar chart. The data is saved in a CSV file named result3-blog.csv. As seen above, the CSV file contains result in terms of F1 measure which is an accuracy measure generally used … Read more

Python: Graph plotting with Matplotlib (Line Graph)

This article deals with plotting line graphs with Matplotlib (a Python’s library). In the article Machine Learning & Sentiment Analysis: Text Classification using Python & NLTK, I had described about evaluating three different classifiers’ accuracy using different feature sets. In this article, I will be using the accuracy result data obtained from that evaluation. Below … Read more

Machine Learning & Sentiment Analysis: Text Classification using Python & NLTK

This article deals with using different feature sets to train three different classifiers [Naive Bayes Classifier, Maximum Entropy (MaxEnt) Classifier, and Support Vector Machine (SVM) Classifier]. Bag of Words, Stopword Filtering and Bigram Collocations methods are used for feature set generation. Text Reviews from Yelp Academic Dataset are used to create training dataset. Cross-validation is … Read more

Python: Print variable in human readable form like print_r in PHP

print_r prints a PHP variable into human readable form. The same can be achieved in Python using pprint module. Here is an example python code: from pprint import pprint student = {'Student1': { 'Age':10, 'Roll':1 }, 'Student2': { 'Age':12, 'Roll':2 }, 'Student3': { 'Age':11, 'Roll':3 }, 'Student4': { 'Age':13, 'Roll':4 }, 'Student5': { 'Age':10, 'Roll':5 … Read more