UCIHousing¶
该类是对`UCI housing <https://archive.ics.uci.edu/ml/datasets/Housing>`_ 测试数据集的实现。
参数¶
返回值¶
Dataset
,UCI housing数据集实例。
代码示例¶
import paddle
from paddle.text.datasets import UCIHousing
class SimpleNet(paddle.nn.Layer):
def __init__(self):
super(SimpleNet, self).__init__()
def forward(self, feature, target):
return paddle.sum(feature), target
uci_housing = UCIHousing(mode='train')
for i in range(10):
feature, target = uci_housing[i]
feature = paddle.to_tensor(feature)
target = paddle.to_tensor(target)
model = SimpleNet()
feature, target = model(feature, target)
print(feature.numpy().shape, target.numpy())