下面是我的管道,似乎我不能通过使用ModelTransformer类将参数传递给我的模型,我从链接中获取它(http://zacstewart.com/2014/08/05/pipelines-of- featureunions-of-pipelines.html)
错误信息对我有意义,但我不知道如何解决这个问题.知道如何解决这个问题吗?谢谢.
# define a pipeline
pipeline = Pipeline([
('vect', DictVectorizer(sparse=False)),
('scale', preprocessing.MinMaxScaler()),
('ess', FeatureUnion(n_jobs=-1,
transformer_list=[
('rfc', ModelTransformer(RandomForestClassifier(n_jobs=-1, random_state=1, n_estimators=100))),
('svc', ModelTransformer(SVC(random_state=1))),],
transformer_weights=None)),
('es', EnsembleClassifier1()),
])
# define the parameters for the pipeline
parameters = {
'ess__rfc__n_estimators': (100, 200),
}
# ModelTransformer class. It takes it from the link
(http://zacstewart.com/2014/08/05/pipelines-of-featureunions-of-pipelines.html)
class ModelTransformer(TransformerMixin):
def __init__(self, model):
self.model = model
def fit(self, *args, **kwargs):
self.model.fit(*args, **kwargs)
return self
def transform(self, X, **transform_params):
return DataFrame(self.model.predict(X))
grid_search = GridSearchCV(pipeline, parameters, n_jobs=-1, …
Run Code Online (Sandbox Code Playgroud) machine-learning parameter-passing python-2.7 scikit-learn cross-validation
Microsoft Cosmos DB包括DocumentDB API,Table API等.我有大约10 TB的数据,并希望有一个快速的键值查找(很少更新和写入,大多数是读取).添加Microsoft Cosmos DB的链接:https: //docs.microsoft.com/en-us/azure/cosmos-db/
Sklearn Pipeline:http://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html
DataFrameMapper:https://github.com/paulgb/sklearn-pandas
他们之间有什么区别?
在我看来,sklearn管道具有更多功能,但DataFrameMapper对我来说更加干净.
我有一张桌子如下.
id date value
1 2011-10-01 xx
1 2011-10-02 xx
...
1000000 2011-10-01 xx
Run Code Online (Sandbox Code Playgroud)
然后我有1000个ID,每个人都有一个约会.我想执行以下操作:
SELECT id, date, value
FROM the table
WHERE (id, date) IN ((id1, <= date1), (id2, <= date2), (id1000, <= date1000))
Run Code Online (Sandbox Code Playgroud)
实现上述查询的最佳方法是什么?
scikit-learn ×2
azure ×1
nosql ×1
pipeline ×1
python ×1
python-2.7 ×1
pytorch ×1
sql ×1
sql-in ×1
sql-server ×1
tensor ×1
torch ×1
where-clause ×1
where-in ×1