Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyfm/pylibfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from sklearn.model_selection import train_test_split
import random
from pyfm_fast import FM_fast, CSRDataset

from collections import defaultdict
LEARNING_RATE_TYPES = {"optimal": 0, "invscaling": 1, "constant": 2}
TASKS = {"regression": 0, "classification" : 1}

Expand Down Expand Up @@ -129,6 +129,8 @@ def _bool_to_int(self, bool_arg):
return 1
else:
return 0
def fact(n):
return n*n

def _prepare_y(self,y):
"""Maps labels to [-1, 1] space"""
Expand Down