1
0
mirror of https://github.com/gsi-upm/sitc synced 2026-04-16 22:58:16 +00:00

Update 4_3_Vector_Representation.ipynb

Changed get_feature_names() with get_feature_names_out()
This commit is contained in:
Carlos A. Iglesias
2026-04-16 16:24:45 +02:00
committed by GitHub
parent 59badc1df2
commit b3c799e564

View File

@@ -239,7 +239,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/home/cif/anaconda3/lib/python3.10/site-packages/sklearn/utils/deprecation.py:87: FutureWarning: Function get_feature_names is deprecated; get_feature_names is deprecated in 1.0 and will be removed in 1.2. Please use get_feature_names_out instead.\n",
"--",
" warnings.warn(msg, category=FutureWarning)\n"
]
},
@@ -331,7 +331,7 @@
"source": [
"vectorizer = CountVectorizer(analyzer=\"word\", stop_words='english', binary=True) \n",
"vectors = vectorizer.fit_transform(documents)\n",
"vectorizer.get_feature_names()"
"vectorizer.get_feature_names_out()"
]
},
{
@@ -365,7 +365,7 @@
"source": [
"vectorizer = CountVectorizer(analyzer=\"word\", stop_words='english', ngram_range=[2,2]) \n",
"vectors = vectorizer.fit_transform(documents)\n",
"vectorizer.get_feature_names()"
"vectorizer.get_feature_names_out()"
]
},
{
@@ -401,7 +401,7 @@
"\n",
"vectorizer = TfidfVectorizer(analyzer=\"word\", stop_words='english')\n",
"vectors = vectorizer.fit_transform(documents)\n",
"vectorizer.get_feature_names()"
"vectorizer.get_feature_names_out()"
]
},
{
@@ -429,9 +429,9 @@
"train = [doc1, doc2, doc3]\n",
"vectorizer = TfidfVectorizer(analyzer=\"word\", stop_words='english')\n",
"\n",
"# We learn the vocabulary (fit) and tranform the docs into vectors\n",
"# We learn the vocabulary (fit) and transform the docs into vectors\n",
"vectors = vectorizer.fit_transform(train)\n",
"vectorizer.get_feature_names()"
"vectorizer.get_feature_names_out()"
]
},
{