jubakit.weight のソースコード

# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, print_function, unicode_literals

import jubatus
import jubatus.embedded

from .base import GenericSchema, BaseDataset, BaseService, GenericConfig
from .compat import *

[ドキュメント]class Schema(GenericSchema): """ Schema for Weight service. """ pass
[ドキュメント]class Dataset(BaseDataset): """ Dataset for Weight service. """ @classmethod def _predict(cls, row): return Schema.predict(row, False)
[ドキュメント]class Weight(BaseService): """ Weight service. """
[ドキュメント] @classmethod def name(cls): return 'weight'
@classmethod def _client_class(cls): return jubatus.weight.client.Weight @classmethod def _embedded_class(cls): return jubatus.embedded.Weight
[ドキュメント] def update(self, dataset): """ Updates the weight using the given dataset and returns extracted feature vectors. """ cli = self._client() for (idx, d) in dataset: result = cli.update(d) yield (idx, result)
[ドキュメント] def calc_weight(self, dataset): """ Returns extracted feature vectors, without modifying the weight model. """ cli = self._client() for (idx, d) in dataset: result = cli.calc_weight(d) yield (idx, result)
[ドキュメント]class Config(GenericConfig): """ Configuration to run Weight service. """
[ドキュメント] @classmethod def methods(cls): return [None]
@classmethod def _default_method(cls): return None @classmethod def _default_parameter(cls, method): return None