使用数据帧作为 MLP(张量流)的输入
我创建/操作了一个关于以下形式的航班的大熊猫数据框:
origin dep_delay temp dewp humid wind_dir wind_speed visib late
0 EWR 19.0 39.02 28.04 64.43 260.0 12.65858 10.0 True
1 LGA 4.0 39.92 24.98 54.81 250.0 14.96014 10.0 False
2 JFK 18.0 39.02 26.96 61.63 260.0 14.96014 10.0 True
3 JFK -8.0 39.02 26.96 61.63 260.0 14.96014 10.0 False
4 LGA -6.0 39.92 24.98 54.81 260.0 16.11092 10.0 False
我想使用 MLP(多层感知器,最好使用张量流),根据输入值来预测哪些航班将晚点 (出发延迟、温度、湿度等)。我认为 MLP 是明智的,但如果我错了,请告诉我。
我不太确定如何解决这个问题,因为我只在图像上使用了 MLP,有人可以帮助我吗?
我知道我必须首先将数据帧转换为更合理的数据类型,例如 numpy 数组,但我不知道如何开始。
I have created/manipulated a large pandas dataframe about flights of the following form:
origin dep_delay temp dewp humid wind_dir wind_speed visib late
0 EWR 19.0 39.02 28.04 64.43 260.0 12.65858 10.0 True
1 LGA 4.0 39.92 24.98 54.81 250.0 14.96014 10.0 False
2 JFK 18.0 39.02 26.96 61.63 260.0 14.96014 10.0 True
3 JFK -8.0 39.02 26.96 61.63 260.0 14.96014 10.0 False
4 LGA -6.0 39.92 24.98 54.81 260.0 16.11092 10.0 False
I would like to use MLP (multi-layer perceptron ideally with tensorflow), to predict which flights will be late given the input values of (dep_delay, temp, humid etc.). I think MLP is sensible but let me know if I am mistaken.
I'm not too sure how to approach this as I have only used MLP on images, could anyone help me out?
I know I have to convert the dataframe to a more sensible data type first like a numpy array but I'm not sure how to get started.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须知道要准备和输入模型的数据类型。例如,origin 和 late 列是分类的,而所有其他列似乎都是数字的。准备数据的多种方法之一是使用 keras 预处理层。
You have to know the type of data you want to prepare and feed your model. The origin and late columns for example are categorical whilst all the other columns seems to be numerical. One of the many ways to prepare your data is using keras preprocessing layers.