kaggle Pipelines

Posted cbattle

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了kaggle Pipelines相关的知识,希望对你有一定的参考价值。

# Most scikit-learn objects are either transformers or models.

  # Transformers are for pre-processing before modeling. The Imputer class (for filling in missing values) is an example of a transformer. # Over time, you will learn many more transformers, and you will frequently use multiple transformers sequentially.

  # Models are used to make predictions. You will usually preprocess your data (with transformers) before putting it in a model.

  # You can tell if an object is a transformer or a model by how you apply it. After fitting a transformer, you apply it with the transform # command. After fitting a model, you apply it with the predict command. Your pipeline must start with transformer steps and end with a # model. This is what you‘d want anyway.

  # Eventually you will want to apply more transformers and combine them more flexibly. We will cover this later in an Advanced Pipelines # tutorial.

 

import pandas as pd
from sklearn.model_selection import train_test_split

# Read Data
data = pd.read_csv(../input/melb_data.csv)
cols_to_use = [Rooms, Distance, Landsize, BuildingArea, YearBuilt]
X = data[cols_to_use]
y = data.Price
train_X, test_X, train_y, test_y = train_test_split(X, y)

from sklearn.ensemble import RandomForestRegressor
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import Imputer

my_pipeline = make_pipeline(Imputer(), RandomForestRegressor())
my_pipeline.fit(train_X, train_y)
predictions = my_pipeline.predict(test_X)

 

以上是关于kaggle Pipelines的主要内容,如果未能解决你的问题,请参考以下文章

KaggleIntermediate Machine Learning(管道+交叉验证)

Pipelines

System.IO.Pipelines来对消息进行Buffer合并

使用带有 Python 和 PyCharm 的 Kubeflow Pipelines SDK 连接到 AI Platform Pipelines

如何使用 Azure Key Vault 中的证书/密钥对使用 Azure Pipelines 构建的代码进行签名?

使用 Xcode 和 Fastlane 在 Azure DevOps Pipelines 中对 iOS 应用程序进行代码签名时遇到问题