FTRLProximal¶
FTRL-Proximal optimizer.
Parameters¶
-
alpha
Default →
0.05
-
beta
Default →
1.0
-
l1
Default →
0.0
-
l2
Default →
1.0
Attributes¶
-
z (collections.defaultdict)
-
n (collections.defaultdict)
Examples¶
from river import datasets
from river import evaluate
from river import linear_model
from river import metrics
from river import optim
from river import preprocessing
dataset = datasets.Phishing()
optimizer = optim.FTRLProximal()
model = (
preprocessing.StandardScaler() |
linear_model.LogisticRegression(optimizer)
)
metric = metrics.F1()
evaluate.progressive_val_score(dataset, model, metric)
F1: 87.56%
Methods¶
look_ahead
Updates a weight vector before a prediction is made.
Parameters: w (dict): A dictionary of weight parameters. The weights are modified in-place. Returns: The updated weights.
Parameters
- w — 'dict'
step
Updates a weight vector given a gradient.
Parameters
- w — 'dict | VectorLike'
- g — 'dict | VectorLike'
Returns
dict | VectorLike: The updated weights.
-
McMahan, H.B., Holt, G., Sculley, D., Young, M., Ebner, D., Grady, J., Nie, L., Phillips, T., Davydov, E., Golovin, D. and Chikkerur, S., 2013, August. Ad click prediction: a view from the trenches. In Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining (pp. 1222-1230) ↩