运行 FeatureTools 以在 Spark 上分布式地自动化特征工程。
项目描述
## FeatureTools for Spark (featuretools4s)
### 1. 什么是 FeatureTools?
FeatureTools 是一个由麻省理工学院 FeatureLab 开源的 Python 库,
旨在自动化机器学习应用程序
中的特征工程过程。有关 FeatureTools 的更多详细信息,请访问 [官方网站](https://docs.featuretools.com/index.html) 。*FeatureTools4S* 是我编写的 Python 库,旨在使用 **Spark** 扩展 FeatureTools,使其能够为数十亿行数据生成特征,这通常被认为无法在单机上使用原始 FeatureTools 库和 Pandas进行处理.
*FeatureTools4S* 提供**几乎与原始 FeatureTools 相同的** API
,使其用户完全无需
在 FeatureTools 和 FeatureTools4S 之间进行转换。**因此我们建议读者
先学习FeatureTools,然后您可以轻松地使用FeatureTools4S。**
### 2.如何使用FeatureTools4S?
首先通过pip安装*featuretools4s*:
```bash
pip3 install featuretools4s
```
然后一个简单的使用*featuretools4s*的例子如下:
```python
import featuretools4s as fts
from pyspark.sql import SparkSession
import os
import pandas as pd
os.environ["SPARK_HOME"] = "C:\Python36\Lib\site-packages\pyspark"
os.environ["PATH"] = "C:\Python36;" + os.environ["PATH"]
pd.set_option('display.expand_frame_repr', False)
spark = SparkSession.builder.master("local[*]").getOrCreate()
order_df = spark.read.csv("resources /order.csv", header=True, inferSchema=True).sort("sales_tax")
customer_df = spark.read.csv("resources/customer.csv", header=True, inferSchema=True)
es = fts.EntitySetSpark (id="test")
es.entity_from_dataframe("order", order_df, index="order_num", time_index="wo_timestamp")
es.entity_from_dataframe("customer", customer_df, index="cust_num")
es.add_relationship(fts .Relationship(es["customer"]["cust_num"],
features = fts.dfs(spark, entityset=es, target_entity="customer", primary_col="cust_num", num_partition=5)
features.show()
```
### 1. 什么是 FeatureTools?
FeatureTools 是一个由麻省理工学院 FeatureLab 开源的 Python 库,
旨在自动化机器学习应用程序
中的特征工程过程。有关 FeatureTools 的更多详细信息,请访问 [官方网站](https://docs.featuretools.com/index.html) 。*FeatureTools4S* 是我编写的 Python 库,旨在使用 **Spark** 扩展 FeatureTools,使其能够为数十亿行数据生成特征,这通常被认为无法在单机上使用原始 FeatureTools 库和 Pandas进行处理.
*FeatureTools4S* 提供**几乎与原始 FeatureTools 相同的** API
,使其用户完全无需
在 FeatureTools 和 FeatureTools4S 之间进行转换。**因此我们建议读者
先学习FeatureTools,然后您可以轻松地使用FeatureTools4S。**
### 2.如何使用FeatureTools4S?
首先通过pip安装*featuretools4s*:
```bash
pip3 install featuretools4s
```
然后一个简单的使用*featuretools4s*的例子如下:
```python
import featuretools4s as fts
from pyspark.sql import SparkSession
import os
import pandas as pd
os.environ["SPARK_HOME"] = "C:\Python36\Lib\site-packages\pyspark"
os.environ["PATH"] = "C:\Python36;" + os.environ["PATH"]
pd.set_option('display.expand_frame_repr', False)
spark = SparkSession.builder.master("local[*]").getOrCreate()
order_df = spark.read.csv("resources /order.csv", header=True, inferSchema=True).sort("sales_tax")
customer_df = spark.read.csv("resources/customer.csv", header=True, inferSchema=True)
es = fts.EntitySetSpark (id="test")
es.entity_from_dataframe("order", order_df, index="order_num", time_index="wo_timestamp")
es.entity_from_dataframe("customer", customer_df, index="cust_num")
es.add_relationship(fts .Relationship(es["customer"]["cust_num"],
features = fts.dfs(spark, entityset=es, target_entity="customer", primary_col="cust_num", num_partition=5)
features.show()
```
项目详情
关
featuretools4s -0.1.5.tar.gz 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 676bffb6a7fa8d49dde81e2c3ce00fbf766a00f2fc7ace9218cc4c116a8194a5 |
|
| MD5 | f1db433307473ff8a9e4131c61796903 |
|
| 布莱克2-256 | f8627bc8a472ff1472924ba379092542c609871382280082011dda4c50d81d12 |