我对sklearn中的管道很新,我遇到了这个问题:我有一个混合了文本和数字的数据集,即某些列只有文本而rest有整数(或浮点数).
我想知道是否有可能构建一个管道,我可以调用LabelEncoder()文本功能和MinMaxScaler()数字列.我在网上看到的例子主要指向使用LabelEncoder()整个数据集而不是选择列.这可能吗?如果是这样,任何指针都将非常感激.
我没有Linux或Mac机器,所以为了在Windows上检查TensorFlow,安装了docker并下载了tensorflow-full的图像.当我运行以下命令时:
$ python tensorflow/models/image/mnist/convolutional.py
Run Code Online (Sandbox Code Playgroud)
我收到此错误消息:
C:\Users\Javiar\Anaconda\python.exe: can't open file 'tensorflow/models/image/mnist/convolutional.py': [Errno 2] No such file or directory
Run Code Online (Sandbox Code Playgroud)
目前在Win 8.1上安装了anaconda.
Scala 菜鸟在这里:
val pv = (1 to 100).toArray.par
现在我想对这个并行集合应用一个映射函数 pv
pv.map(_ * 2)
但是,上述操作挂起。有什么理由吗?
2.12.4在 Mac OS X (High Sierra) 上使用 Scala 版本
连续重新运行任务 (A) 3 次的最佳方法是什么?:
即任务A->任务A->任务A->任务B
我之所以这么问,是因为我将运行另一个单独的数据验证任务 (B),该任务将比较这 3 次单独运行的数据。
这就是我到目前为止所做的:
dag = DAG("hello_world_0", description="Starting tutorial", schedule_interval='* * * * *',
start_date=datetime(2019, 1, 1),
catchup=False)
data_pull_1 = BashOperator(task_id='attempt_1', bash_command='echo "Hello World - 1!"',dag=dag)
data_pull_2 = BashOperator(task_id='attempt_2', bash_command='echo "Hello World - 2!"',dag=dag)
data_pull_3 = BashOperator(task_id='attempt_3', bash_command='echo "Hello World - 3!"',dag=dag)
data_validation = BashOperator(task_id='data_validation', bash_command='echo "Data Validation!"',dag=dag)
data_pull_1 >> data_pull_2 >> data_pull_3 >> data_validation
Run Code Online (Sandbox Code Playgroud)
这可能可行,但是有更优雅的方法吗?
当我在Azure Databricks中实现这部分python代码时:
class clustomTransformations(Transformer):
<code>
custom_transformer = customTransformations()
....
pipeline = Pipeline(stages=[custom_transformer, assembler, scaler, rf])
pipeline_model = pipeline.fit(sample_data)
pipeline_model.save(<your path>)
Run Code Online (Sandbox Code Playgroud)
当我尝试保存管道时,我得到了这个:
AttributeError: 'customTransformations' object has no attribute '_to_java'
有什么工作吗?
python ×2
airflow ×1
anaconda ×1
databricks ×1
docker ×1
macos ×1
persistence ×1
pipeline ×1
pyspark ×1
scala ×1
scikit-learn ×1
tensorflow ×1