コード例 #1
0
ファイル: model.py プロジェクト: krishangupta/python
    def docstring(self):
        """Returns the docstring describing the model.

        """
        docstring = u"Predictor for %s from %s\n" % (self.fields[self.tree.objective_id]["name"], self.resource_id)
        self.description = (
            unicode(markdown_cleanup(self.description).strip())
            or u"Predictive model by BigML - Machine Learning Made Easy"
        )
        docstring += u"\n" + INDENT * 2 + (u"%s" % prefix_as_comment(INDENT * 2, self.description))
        return docstring
コード例 #2
0
ファイル: model.py プロジェクト: araymund/python
    def docstring(self):
        """Returns the docstring describing the model.

        """
        docstring = (
            u"Predictor for %s from %s\n" %
            (self.fields[self.tree.objective_id]['name'], self.resource_id))
        self.description = (
            unicode(markdown_cleanup(self.description).strip())
            or u'Predictive model by BigML - Machine Learning Made Easy')
        docstring += u"\n" + INDENT * 2 + (
            u"%s" % prefix_as_comment(INDENT * 2, self.description))
        return docstring
コード例 #3
0
ファイル: model.py プロジェクト: umarfirja16/python
def docstring(model):
    """Returns the docstring describing the model.

    """
    objective_name = model.fields[model.objective_id]['name'] if \
        not model.boosting else \
        model.fields[model.boosting["objective_field"]]['name']
    docstring_cmt = ("Predictor for %s from %s\n" %
                     (objective_name, model.resource_id))
    model.description = (
        str(markdown_cleanup(model.description).strip())
        or 'Predictive model by BigML - Machine Learning Made Easy')
    docstring_cmt += "\n" + INDENT * 2 + (
        "%s" % prefix_as_comment(INDENT * 2, model.description))
    return docstring_cmt