使用数据帧作为 MLP(张量流)的输入

发布于 2025-01-17 00:55:02 字数 734 浏览 3 评论 0原文

我创建/操作了一个关于以下形式的航班的大熊猫数据框:

  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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天煞孤星 2025-01-24 00:55:02

您必须知道要准备和输入模型的数据类型。例如,originlate 列是分类的,而所有其他列似乎都是数字的。准备数据的多种方法之一是使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文