简单贝叶斯分类器 - 函数预测误差

时间:2017-12-02 21:47:41

标签: r

我正在尝试运行一个简单的贝叶斯分类,但我遇到函数预测问题。 当我运行我的代码时,我得到一个0级别的因子。 来自Kaggle的速度约会数据集有8个变量。正在预测的是"匹配"。没有NA。 我把女人和女人分开了。然后我划分了女性数据集" Bayes_data_women"进入火车和测试。 这是我的代码:

class ProductType(DjangoObjectType):
    class Meta:
        model = Product
        filter_fields = {'description': ['icontains']}
        interfaces = (graphene.relay.Node,)


class CreateProduct(graphene.Mutation):
    class Arguments:    # change here
        barcode = graphene.String()

    product = graphene.Field(lambda: ProductType)

    def mutate(self, info, barcode):
        # change here
        # somehow the graphene documentation just state the code I had in my question which doesn't work for me.  But this one does
        product = Product.objects.create(barcode=barcode)
        return CreateProduct(product=product)


class ProductMutation(graphene.ObjectType):  # change here
    create_product = CreateProduct.Field()

class ProductQuery(object):
    product = relay.Node.Field(ProductType)
    all_products = DjangoFilterConnectionField(ProductType)

    def resolve_all_products(self, info, **kwargs):
        return Product.objects.all()

代码运行,但我得到:default_pred:因子w / 0级

提前谢谢。

0 个答案:

没有答案