This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Download a file from the web using requests with a nice progress bar. | |
from __future__ import print_function | |
from tqdm import tqdm | |
import requests | |
import warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Author: Taylor G Smith | |
# | |
# More scratch code in my collection of random recommender | |
# system utilities. Someday I'll get around to building | |
# an actual repository... in the meantime, here are some | |
# train/test split utilities for collaborative filtering | |
# with sparse matrices. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Author: Taylor G Smith | |
# | |
# Recommender system ranking metrics derived from Spark source for use with | |
# Python-based recommender libraries (i.e., implicit, | |
# http://github.com/benfred/implicit/). These metrics are derived from the | |
# original Spark Scala source code for recommender metrics. | |
# https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Author: Taylor Smith | |
# | |
# This function provides an interface for splitting a sparse ratings | |
# matrix RDD into a train and test set for use in collaborative | |
# filtering in PySpark applications. | |
# | |
# Dependencies: | |
# * scikit-learn >= 0.18 |