Test.fm
Testing framework for Collaborative Filtering
Install / Use
/learn @grafos-ml/Test.fmREADME
Introduction
Test.fm is (yet another) testing framework for Collaborative Filtering models. It integrates well with pandas as the default data manipulation library and gives an easy way to investigate how well your models perform and why. You can build a model using okapi and then check how it performs on the testing data. Or if you have only a little data set, you can use it directly.
Example of using the Test.fm framework
import pandas as pd
import testfm
from testfm.models.baseline_model import Popularity, RandomModel
from testfm.models.tensorcofi import TensorCoFi
from testfm.evaluation.evaluator import Evaluator
evaluator = Evaluator()
# Prepare the data
df = pd.read_csv(..., names=["user", "item", "rating", "date", "title"])
training, testing = testfm.split.holdoutByRandom(df, 0.9)
# Tell me what models we want to evaluate
models = [
RandomModel(),
Popularity(),
TensorCoFi()
]
# Evaluate
items = training.item.unique()
for m in models:
m.fit(training)
print m.getName().ljust(50),
print evaluator.evaluate_model(m, testing, all_items=items)
See other examples here...
Installation
You can check the official documentation here.
- download and extract the sources.
- check the dependencies in conf/requirements.txt
- run #sudo python setup.py install
- if you are a developer of test.fm better do python setup.py develop
- enjoy and contribute
- Check travis for the latest builds...
- Check yaml for the build script.
Nosetests
$ nosetests -w src/ -vv --with-cover --cover-tests --cover-erase --cover-html --cover-package=testfm --with-doctest --doctest-tests tests testfm/evaluation testfm/models testfm/fmio testfm/splitter
Build Documentation
$ sphinx-build -b html source_folder doc_folder
Similar Projects
- mrec from Mendeley. Good at building models. (python, ?)
- okapi from Telefonica Research. Good at distributed model building using Apache Giraph (java, giraph, apache2).
- graphlab from CMU. Probably the richest library of modern algorithms (c++, apache2).
- mymedialite from Uni Hildesheim. Has ranking implementations. (c#, GPL).
- mahout of apache. Uses hadoop to build the models. (java, hadoop, apache2)
- lenskit Grouplens (java, GPL2.1)
Related Skills
node-connect
352.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
