Comments (2)
Hi @allosharma ,
Thanks for your feedback. Could you please copy/paste the definition of the ClusterSimilarity
class from your notebook here? It should contain a get_feature_names_out()
method. The error message says that it doesn't, but it's supposed to. If you read page 82 in the book, or look at cell [100] in the notebook, you should see it.
Perhaps there's a typo in your notebook?
Hope this helps.
from handson-ml3.
Hi @allosharma ,
Thanks for your feedback. Could you please copy/paste the definition of the
ClusterSimilarity
class from your notebook here? It should contain aget_feature_names_out()
method. The error message says that it doesn't, but it's supposed to. If you read page 82 in the book, or look at cell [100] in the notebook, you should see it. Perhaps there's a typo in your notebook? Hope this helps.
Hi @ageron ,
Thank you so much for the response, yes I got the typo. while defining the method I had a typo.
class ClusterSimilarity(BaseEstimator, TransformerMixin):
def __init__(self, n_clusters=10, gamma=1.0, random_state=None):
self.n_clusters = n_clusters
self.gamma = gamma
self.random_state = random_state
def fit(self, X, y=None, sample_weight=None):
self.kmeans_ = KMeans(self.n_clusters, random_state=self.random_state)
self.kmeans_.fit(X, sample_weight=sample_weight)
return self #always return self
def transform(self, X):
return rbf_kernel(X, self.kmeans_.cluster_centers_, gamma=self.gamma)
def get_features_names_out(self, names=None):
return [f"Cluster {i} similarity" for i in range(self.n_clusters)]
It should have been a feature instead of features.
from handson-ml3.
Related Issues (20)
- [IDEA] Chapter 2, Reduce multiple FutureWarning(s) when using KMeans with sklearn 1.3.1
- [BUG] Chapter 2, CV splits are not random as opposed to what is written
- [IDEA] Chapter 2, Add code demonstrating HalvingRandomSearchCV
- [BUG] Ch07 - Bagging and Pasting in Scikit-Learn, import numpy
- [BUG] Ch08 - cmap wrong when plotting LLE figures HOT 1
- [BUG] Docker image issue. HOT 2
- [QUESTION] Error in chapter 15 (Forecasting Multivariate Time Series) HOT 5
- https://homl.info/colab3 HOT 1
- I can not find the solutions to the exercises at the end of each chapter going to https:///homl.info/colab3. Are they to be found elswhere? HOT 1
- [BUG] Chapter 2 OneHotEncoder Shape Mismatch Issue + Solution
- [BUG] Chapter 7 (07_ensemble_learning_and_random_forests) in Jupyter Notebook HOT 1
- [QUESTION] Chapter 4 Exercise Question 12 - cost function with l2 regularization seems incorrect HOT 2
- Pulling for GPU does not work HOT 3
- [IDEA] Consider changing variable name in chapter 5 notebook HOT 1
- [QUESTION] CHAP18 Can't find the TF-Agent part HOT 1
- [QUESTION] Clarification about likelihood and PDF HOT 1
- Chapter 16: Downloading Shakespeare model: I get exception downloading the shakespeare_model HOT 1
- [QUESTION] Chapter 14: Asking about GoogLeNet's archietcture
- [QUESTION] Chapter 2: Definition of `similarities` is subject to information leakage? HOT 2
- [QUESTION] Use of Normalization layer with keras_tuner
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from handson-ml3.