Chapter 2 full_pipeline.fit error
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 25.6k
- Forks
- 12.7k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I'm having trouble with the `full_pipeline` section of code below. I'm confused by the code in the book and the adjustments on the website. When i run the code below i get the error:
`fit_transform() takes 2 positional arguments but 3 were given` on the final line. Not sure what the problem is because it was working fine last night. Where have I gone astray?
```python
from sklearn.pipeline import FeatureUnion
num_attribs = list(housing_num)
cat_attribs = ["ocean_proximity"]
num_pipeline = Pipeline([
('selector', DataFrameSelector(num_attribs)),
('imputer', Imputer(strategy="median")),
('attribs_adder', CombinedAttributesAdder()),
('std_scaler', StandardScaler()),
])
cat_pipeline = Pipeline([
('selector', DataFrameSelector(cat_attribs)),
('label_binarizer', LabelBinarizer()),
])
full_pipeline = FeatureUnion(transformer_list=[
("num_pipeline", num_pipeline),
("cat_pipeline", cat_pipeline),
])
housing_prepared = full_pipeline.fit_transform(housing)
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.