【问题标题】:How to extract individual variable from a given dataset?如何从给定的数据集中提取单个变量?
【发布时间】:2021-06-26 17:27:54
【问题描述】:

我想询问从给定数据集中提取数据的问题(我猜它类似于数据分解)。 目标是分解数据集以提取特征?

例如:在不知道individual features(长度、宽度、高度)的情况下提取rectangle prismvolume 的各个组件。

请推荐最佳实践来执行该操作。另外,有什么书或文章可以详细解释这个过程吗?

更新

分析示例代码:

using DataFrames
mutable struct rect
    length
    breadth
    height
end
r = rect(rand(Int, 40), rand(Int, 40), rand(Int, 40))
volume(rect) = rect.length .* rect.breadth .* rect.height
volume_val = volume(r)
df = DataFrame(:length => r.length, :width=> r.width, :height=> r.height, :volume => volume_val)

# For this df dataframe, I would like to extract length, width and height from volume without the use of volume equation

提前致谢!

【问题讨论】:

    标签: julia feature-extraction feature-engineering


    【解决方案1】:

    你的意思是搜索你得到给定体积的长度、宽度、高度的值吗?

    using DataFrames
    mutable struct rect
        length
        width
        height
    end
    r = rect(rand(1:100, 10), rand(1:100, 10), rand(1:100, 10))
    volume(rect) = rect.length .* rect.width .* rect.height
    volume_val = volume(r)
    
    julia> df = DataFrame(:length => r.length, :width=> r.width, :height=> r.height, :volume => volume_val)
    10×4 DataFrame
     Row │ length  width  height  volume
         │ Int64   Int64  Int64   Int64
    ─────┼───────────────────────────────
       1 │     41     82      58  194996
       2 │     41     57      92  215004
       3 │     88     42      63  232848
       4 │     32     98      12   37632
       5 │     26     65      14   23660
       6 │     94     26      40   97760
       7 │     14     72      65   65520
       8 │     51     72      79  290088
       9 │     36     50      26   46800
      10 │     63     22      94  130284
    
    julia> df[df.volume .== 46800,:]
    1×4 DataFrame
     Row │ length  width  height  volume
         │ Int64   Int64  Int64   Int64
    ─────┼───────────────────────────────
       1 │     36     50      26   46800
    

    【讨论】:

    • 感谢您的反馈!!我的问题更多是在不知道volume 列中的值的情况下提取lengthwidthheight(特征)。
    • 对不起,我不明白你在做什么
    • 抱歉回复晚了!问题的解释,对于一个直角棱镜,默认情况下应该有长度、宽度和高度三个组件。但是如果缺少高度怎么办!那么我如何估计一个合适的高度变量向量可以说使用统计方法甚至任何数学建模?哈哈
    • 让我试着改写一下,看看我是否理解。缺少length|width|height|volume 之一(并且只有一个),您想要找到缺失的值。你应该知道length*width*height=volume 吗?
    • 您的问题可能没有简单的解决方案。您可以尝试线性/二次/等回归,甚至可以训练人工神经网络
    猜你喜欢
    • 2017-11-17
    • 1970-01-01
    • 2013-07-22
    • 2014-08-20
    • 2020-07-12
    • 2018-11-25
    • 2022-08-19
    • 1970-01-01
    • 2023-01-08
    相关资源
    最近更新 更多