-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfeaturemaps.py
More file actions
31 lines (23 loc) · 773 Bytes
/
Copy pathfeaturemaps.py
File metadata and controls
31 lines (23 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""This modules contains feature map implementations.
We only use the identity as a feature map so far, i.e., no feature map.
"""
class FeatureMapIdentity:
"""A feature map that simply returns the original features."""
def __init__(self):
"""
Initialize the feature map.
"""
self.n_components = None
def __call__(self, *args, **kwargs):
"""Apply the feature map."""
return self.transform(*args, **kwargs)
def fit(self, x, y=None):
"""Fit the feature map."""
self.n_components = x.shape[1]
def transform(self, x):
"""Transform the input."""
return x
class FeatureMapRBF:
def __init__(self):
# TODO: could use random fourier features instead
pass