Question: [ 9 ] :NameErrorCell In [ 9 ] , line 1 Traceback ( most recent call last ) rarr 1 X _ train = vectorizer.fit

[9]:NameErrorCell In [9], line 1Traceback (most recent call last)rarr1 X_train = vectorizer.fit_transform(posts)2 num_samples, num_features = X_train. shape3 print("#samples: %d, #features: %d"%(num_samples, num_features))
NameError: name 'posts' is not defined
[26]: print(vectorizer.get_feature_names_out())
['disk' 'format' 'hard' 'how' 'my' 'problems' 'to']
[27]:[9]:NameErrorCell In [9], line 1Traceback (most recent call last)rarr1 X_train = vectorizer.fit_transform(posts)2 num_samples, num_features = X_train. shape3 print("#samples: %d, #features: %d"%(num_samples, num_features))
NameError: name 'posts' is not defined
[26]: print(vectorizer.get_feature_names_out())
['disk' 'format' 'hard' 'how' 'my' 'problems' 'to']
[27]:
[ 9 ] :NameErrorCell In [ 9 ] , line 1 Traceback

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!