小编Chr*_*itz的帖子

预期的二进制或Unicode字符串,得到nan-TensorFlow / Pandas

我是TensorFlow / Machine Learning的新手,因此遇到了一些困难。我有CSV格式的数据集在这里,想与熊猫们喜欢读它这里。它在不同的数据集上工作,但我进行了修改和扩展,但我认为这里缺少重要的内容。基本上,我要做的所有工作都是根据给定的数据集预测“总体”评分。这是我的代码和得到的追溯:

import pandas as pd
import tensorflow as tf
import tempfile


COLUMNS = ["reviewerID", "asin", "reviewerName", "helpful_0", "helpful_1", "reviewText",
           "overall", "summary", "unixReviewTime"]

CATEGORICAL_COLUMNS = ["reviewerID", "reviewerName", "reviewText", "summary"]
CONTINUOUS_COLUMNS = ["helpful_0", "helpful_1", "unixReviewTime"]

df_train = pd.read_csv('Digital_Music_5.csv', names=COLUMNS, skipinitialspace=True,
                       low_memory=False, skiprows=1)
df_test = pd.read_csv('Digital_Music_5_test.csv', names=COLUMNS,
                      skipinitialspace=True, skiprows=1)

LABEL_COLUMN = "label"


df_train[LABEL_COLUMN] = df_train["overall"]
df_test[LABEL_COLUMN] = df_train["overall"]

print(df_train)


def input_fn(df):
    # Creates a dictionary mapping from each continuous feature column name (k)
    # to the …
Run Code Online (Sandbox Code Playgroud)

python machine-learning tensorflow

3
推荐指数
1
解决办法
4191
查看次数

标签 统计

machine-learning ×1

python ×1

tensorflow ×1