寻找数据模式

数据挖掘 机器学习 scikit-学习 数据挖掘 可视化 算法
2022-02-21 02:04:36

我是这个数据科学领域的新手。

我有 3D 空间中的点数据,每个点“帮助”一个指标。我有一组点和相应的指标。

数据可能如下所示:

[Pt_set1_1], [Pt_set1_2], [Pt_set1_3], ..., [Pt_set1_20], Metric1, Metric2, Metric3  
[Pt_set2_1], [Pt_set2_2], [Pt_set2_3], ..., [Pt_set2_20], Metric1, Metric2, Metric3

我想确定哪些点有助于哪些指标。这个问题可以用数据科学算法解决吗?哪种算法对我有帮助?请告诉我。任何帮助,将不胜感激。

1个回答

如果我对您的理解正确,您有一组 20 个 3D 点,并且对于每组点,您都有与之关联的三个指标。

是的,绝对有可能了解哪些点对每个指标最具预测性。我建议您拆分数据,使点集位于一个看起来像的 numpy 数组中

x1_1, y1_1, z1_1, x1_2, y1_2, z1_2, ..., x1_20, y1_20, z1_20
x2_1, y2_1, z2_1, x2_2, y2_2, z2_2, ..., x2_20, y2_20, z2_20
...

然后为每个指标创建一个 1D numpy 数组,其中包含每个点集的每个指标的值。然后,您可以使用类似 a 的RandomForestRegressor方法来尝试从这些点单独预测指标。使用该fit(X, y)方法训练随机森林后,您可以通过获取feature_importances_. 例如,像这样:

rf1 = RandomForestRegressor(n_estimators=1000)
rf1.fit(points, metric1)
print(rf1.feature_importances_)

rf2 = RandomForestRegressor(n_estimators=1000)
rf2.fit(points, metric2)
print(rf2.feature_importances_)

rf3 = RandomForestRegressor(n_estimators=1000)
rf3.fit(points, metric3)
print(rf3.feature_importances_)

希望这会为您指明正确的方向!