{"id":12792,"date":"2022-02-16T08:34:12","date_gmt":"2022-02-16T16:34:12","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=12792"},"modified":"2025-06-13T21:25:06","modified_gmt":"2025-06-14T04:25:06","slug":"leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/es\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/","title":{"rendered":"Aprovechamiento de sus modelos ML con Couchbase Analytics Funciones Definidas por el Usuario (UDF)"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Con Couchbase 7.0 ahora es capaz de permitir la integraci\u00f3n de Python UDFs con Couchbase Analytics. En <a href=\"https:\/\/www.couchbase.com\/blog\/es\/ml-meets-nosql-integrating-python-user-defined-functions-with-n1ql-for-analytics\/\">Parte 1 de esta serie de blogs<\/a>En este art\u00edculo, hemos tratado los aspectos esenciales para configurar Couchbase y Analytics for Machine Learning (ML).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">El ML ha transformado radicalmente la forma en que las organizaciones comprenden las necesidades de sus clientes. Los \u00e1mbitos del an\u00e1lisis avanzado, como el an\u00e1lisis predictivo (p\u00e9rdida de clientes, sentimiento de los clientes, etc.) y el modelado financiero, dependen cada vez m\u00e1s del procesamiento de datos a escala, casi en tiempo real, y de la extracci\u00f3n de informaci\u00f3n valiosa a partir de ellos.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para ayudar a nuestros clientes a obtener conocimientos anal\u00edticos en tiempo real, hemos creado una tuber\u00eda perfecta de modelos de aprendizaje autom\u00e1tico basados en Python a Couchbase Analytics. En este post, voy a recorrer los siguientes pasos para mostrar c\u00f3mo aplicar algoritmos externos a los datos que residen en Couchbase.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Seis pasos para aplicar modelos ML a sus datos NoSQL:<\/span><\/h4>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Entrenar el modelo<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Codificar el modelo<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Empaquetar e implantar el c\u00f3digo<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Importe los datos necesarios para este proyecto<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Escribir la UDF<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Uso de la UDF en su instancia para CB (Modo DP)<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Antes de entrar en materia, vamos a buscar un conjunto de datos que sirva de interesante demostraci\u00f3n de las capacidades que estamos construyendo. Hay rese\u00f1as de pel\u00edculas en varios sitios web, pero para tener una visi\u00f3n hol\u00edstica de las cr\u00edticas no hay mejor lugar que Rotten Tomatoes. Este sitio web permite comparar las puntuaciones dadas por los usuarios habituales (puntuaci\u00f3n del p\u00fablico) y las puntuaciones o rese\u00f1as dadas por los cr\u00edticos (<em>tomat\u00f3metro<\/em>) que son miembros certificados de diversos gremios de escritores o asociaciones de cr\u00edticos de cine.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Los dos conjuntos de datos utilizados para este blog se encuentran en <\/span><a href=\"https:\/\/www.kaggle.com\/stefanoleone992\/rotten-tomatoes-movies-and-critic-reviews-dataset\"><span style=\"font-weight: 400;\">kaggle.com<\/span><\/a><span style=\"font-weight: 400;\">. Se trata de archivos bastante grandes, por lo que se proporciona un enlace a los mismos para que pueda descargarlos cuando los siga.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">En el <\/span><em><span style=\"font-weight: 400;\">pel\u00edculas<\/span><\/em><span style=\"font-weight: 400;\"> cada registro representa una pel\u00edcula disponible en Rotten Tomatoes, con la URL utilizada para obtener el t\u00edtulo de la pel\u00edcula, la descripci\u00f3n, los g\u00e9neros, la duraci\u00f3n, el director, los actores, las valoraciones de los usuarios y las valoraciones de los cr\u00edticos. En el <\/span><em><span style=\"font-weight: 400;\">cr\u00edticas_de_pel\u00edculas<\/span><\/em><span style=\"font-weight: 400;\"> cada registro representa una cr\u00edtica publicada en Rotten Tomatoes, con la URL utilizada para obtener el nombre del cr\u00edtico, la publicaci\u00f3n de la cr\u00edtica, la fecha, la puntuaci\u00f3n y el contenido.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Entrenamiento del modelo ML<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Antes de empezar a explorar el poder de la integraci\u00f3n entre ML y NoSQL, necesitar\u00e1 desarrollar y entrenar un modelo de aprendizaje autom\u00e1tico en Python.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para los fines de este blog, utilizaremos un modelo de regresi\u00f3n log\u00edstica simple que utiliza la biblioteca scikit-learn. En esencia, el modelo toma los datos y analiza sus sentimientos con respecto a las cr\u00edticas de pel\u00edculas. Puede seguir los pasos que se describen a continuaci\u00f3n o puede descargar todos los archivos necesarios de nuestro <\/span><a href=\"https:\/\/github.com\/couchbaselabs\/AnalyticsML\"><span style=\"font-weight: 400;\">Repo de GitHub<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para este blog, estamos utilizando un algoritmo predictivo de c\u00f3digo abierto en el conjunto de datos de cr\u00edticas de pel\u00edculas para determinar el sentimiento, es decir, para determinar si las cr\u00edticas son positivas o negativas para una pel\u00edcula determinada. En los ejemplos de hoy, ya hemos entrenado el modelo utilizando un subconjunto del archivo descargado anteriormente. Para los fines de este blog utilizamos un archivo CSV (valores separados por comas) para importar nuestros datos.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A continuaci\u00f3n se muestra una muestra del c\u00f3digo para el modelo en s\u00ed:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12793\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/python.png\" alt=\"\" width=\"1600\" height=\"1152\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python.png 1600w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python-300x216.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python-1024x737.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python-768x553.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python-1536x1106.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python-20x14.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python-1320x950.png 1320w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">La totalidad del ejemplo de c\u00f3digo se encuentra en la p\u00e1gina <\/span><a href=\"https:\/\/github.com\/couchbaselabs\/AnalyticsML\"><span style=\"font-weight: 400;\">Repositorio GitHub.<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Cuando ejecutes el script Python modelo mostrado arriba, deber\u00edas obtener el siguiente resultado:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12794\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/python2.png\" alt=\"\" width=\"655\" height=\"365\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python2.png 655w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python2-300x167.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python2-20x11.png 20w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Puede obtener m\u00e1s informaci\u00f3n sobre las m\u00e9tricas de scikit-learn como precisi\u00f3n, recall, f1-score y support <\/span><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.metrics.precision_recall_fscore_support.html\"><span style=\"font-weight: 400;\">aqu\u00ed<\/span><\/a><span style=\"font-weight: 400;\">. Ahora tenemos un modelo de aprendizaje autom\u00e1tico funcional y de buen rendimiento completamente entrenado en Python.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Creaci\u00f3n de una biblioteca Python<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Con el fin de hacer referencia al modelo de aprendizaje autom\u00e1tico, tendr\u00e1 que crear una biblioteca de Python. A continuaci\u00f3n se muestra la biblioteca para este ejemplo en particular:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12795\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/python3.png\" alt=\"\" width=\"1600\" height=\"966\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python3.png 1600w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python3-300x181.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python3-1024x618.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python3-768x464.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python3-1536x927.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python3-20x12.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python3-1320x797.png 1320w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">La biblioteca tiene dos componentes principales:<\/span><\/p>\n<p><b>Constructor de modelos<\/b><span style=\"font-weight: 400;\">-Este constructor crea un fichero llamado <\/span><em><span style=\"font-weight: 400;\">modelo_de_sentimiento<\/span><\/em><span style=\"font-weight: 400;\"> en el <\/span><span style=\"font-weight: 400;\"><em>tuber\u00edas<\/em> <\/span><span style=\"font-weight: 400;\">de nuestro entorno Jupyter.<\/span><\/p>\n<p><b>m\u00e9todo getSentiment<\/b><span style=\"font-weight: 400;\">-Este m\u00e9todo predice el sentimiento del cliente asociado al par\u00e1metro (o argumento) que se le pasa.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Guarde el archivo como <\/span><i><span style=\"font-weight: 400;\">sentimiento.py<\/span><\/i><span style=\"font-weight: 400;\"> dentro del <\/span><i><span style=\"font-weight: 400;\">tuber\u00edas<\/span><\/i><span style=\"font-weight: 400;\"> con el archivo <\/span><i><span style=\"font-weight: 400;\">modelo_de_sentimiento<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Empaquetado y despliegue de la biblioteca<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Este es un paso cr\u00edtico en lo que vendr\u00e1 despu\u00e9s: \u00a1desbloquear el poder de las funciones definidas por el usuario de Python! Por favor, presta atenci\u00f3n a los detalles ya que depende m\u00e1s de la sintaxis que cualquiera de los otros. Aseg\u00farese de leer atentamente la documentaci\u00f3n correspondiente. Siga el enlace <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/analytics\/9_udf.html#external-functions\"><span style=\"font-weight: 400;\">para saber m\u00e1s sobre las funciones definidas por el usuario<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Para empaquetar el modelo y la biblioteca que hemos creado en los pasos anteriores, utilizaremos la utilidad shiv. Si shiv no est\u00e1 ya instalado, utilice el comando <\/span><i><span style=\"font-weight: 400;\">pip install shiv<\/span><\/i><i><span style=\"font-weight: 400;\"> (o <\/span><\/i><i><span style=\"font-weight: 400;\">pip3 install shiv<\/span><\/i><span style=\"font-weight: 400;\"> dependiendo de su entorno). Adem\u00e1s, si est\u00e1s interesado en leer la documentaci\u00f3n de esta utilidad de l\u00ednea de comandos, puedes encontrarla <\/span><a href=\"https:\/\/shiv.readthedocs.io\/en\/latest\/\"><span style=\"font-weight: 400;\">aqu\u00ed<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<p><b>Pasos para empaquetar el modelo:<\/b><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">En su ordenador port\u00e1til, empaquete el modelo de sentimiento y el c\u00f3digo del modelo. Esto hace que sea autoejecutable y elimina cualquier dependencia de la biblioteca:<\/span><\/li>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><i><span style=\"font-weight: 400;\">shiv -site-packages pipelines\/ -o pipeline.pyz -platform manylinux1_x86_64 -python-version 39 -only-binary=:all: scikit-learn<\/span><\/i><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">-plataforma manylinux1_x86_64<\/span><span style=\"font-weight: 400;\"> s\u00f3lo es necesario cuando se utiliza una m\u00e1quina virtual con Linux.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Copie el paquete Python aut\u00f3nomo con las dependencias necesarias en el servidor de an\u00e1lisis:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><i><span style=\"font-weight: 400;\">docker cp pipeline.pyz cb-analytics:\/tmp\/<\/span><\/i><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Acceder al int\u00e9rprete de comandos del <\/span><span style=\"font-weight: 400;\">cb-analytics<\/span><span style=\"font-weight: 400;\"> Contenedor Docker:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">docker exec -it cb-analytics bash<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Desde el shell de Docker, vaya a la carpeta <\/span><span style=\"font-weight: 400;\">tmp <\/span><span style=\"font-weight: 400;\">donde se encuentra el archivo zip e importar los datos necesarios para los dos buckets:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><i><span style=\"font-weight: 400;\">cd \/tmp<\/span><\/i><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><i><span style=\"font-weight: 400;\">curl -v -X POST -F \"data=@.\/pipeline.pyz\" -F \"type=python\" \"localhost:8095\/analytics\/library\/Default\/sentimentlibrary\" -u Administrador:contrase\u00f1a;<\/span><\/i><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">El sistema se actualizar\u00e1 cuando est\u00e9 completo y tendr\u00e1 \u00e9xito cuando vea esta respuesta HTTP 200:<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12796\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/python4.png\" alt=\"\" width=\"814\" height=\"248\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python4.png 814w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python4-300x91.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python4-768x234.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python4-20x6.png 20w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<h4><span style=\"font-weight: 400;\">Importar documento de cubo para que lo analice la UDF<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Hay que seguir dos pasos en la m\u00e1quina local y ejecutar tres comandos en la instancia de Docker.<\/span><\/p>\n<p><b>M\u00e1quina local<\/b><\/p>\n<p><span style=\"font-weight: 400;\">0. Crear cubos <\/span><em><span style=\"font-weight: 400;\">pel\u00edcula<\/span><\/em><span style=\"font-weight: 400;\"> o <\/span><em><span style=\"font-weight: 400;\">cr\u00edticas_de_pel\u00edculas <\/span><\/em><span style=\"font-weight: 400;\">ya sea en el <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/manage\/manage-buckets\/create-bucket.html#create-bucket-using-couchbase-web-console\"><span style=\"font-weight: 400;\">consola web<\/span><\/a><span style=\"font-weight: 400;\"> o a trav\u00e9s del <\/span><em><a href=\"https:\/\/docs.couchbase.com\/server\/current\/cli\/cbcli\/couchbase-cli-bucket-create.html#examples\"><span style=\"font-weight: 400;\">couchbase-cli<\/span><\/a><\/em><span style=\"font-weight: 400;\"> comando<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">Corre: <\/span><span style=\"font-weight: 400;\"><em>docker cp rotten_tomatoes_critic_reviews.csv<\/em> <em>cb:\/tmp\/ <\/em><\/span>Este archivo supera el l\u00edmite de 100 Mb de la utilidad de importaci\u00f3n GUI y debe importarse directamente.<\/li>\n<\/ol>\n<p><b>Instancia Docker<\/b><\/p>\n<p><em><span style=\"font-weight: 400;\">2. docker exec -it cb bash<\/span><\/em><\/p>\n<p><em><span style=\"font-weight: 400;\">3. cbimport csv -infer-tipos -c https:\/\/localhost:8091 -u Administrador -p contrase\u00f1a -d 'file:\/\/rotten_tomatoes_critic_reviews.csv' -b 'movie_reviews' -scope-collection-exp \"_default._default\" -g \"%rotten_tomatoes_link%\"<\/span><\/em><\/p>\n<p><em><span style=\"font-weight: 400;\">4. cbimport csv -infer-tipos -c https:\/\/localhost:8091 -u Administrador -p contrase\u00f1a -d 'file:\/\/rotten_tomatoes_movies.csv' -b 'movies' -scope-collection-exp \"_default._default\" -g \"%rotten_tomatoes_link%\"<\/span><\/em><\/p>\n<p><span style=\"font-weight: 400;\">Puede importar el \u00faltimo fichero (<\/span><em><span style=\"font-weight: 400;\">rotten_tomatoes_peliculas.csv<\/span><\/em><span style=\"font-weight: 400;\">) desde la l\u00ednea de comandos, como se muestra m\u00e1s arriba, o desde la opci\u00f3n <\/span><i><span style=\"font-weight: 400;\">Consola Web Couchbase &gt; Documento &gt; Importar<\/span><\/i><span style=\"font-weight: 400;\"> del portal de Couchbase como se muestra en esta captura de pantalla:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12797\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/python5.png\" alt=\"\" width=\"1600\" height=\"545\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python5.png 1600w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python5-300x102.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python5-1024x349.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python5-768x262.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python5-1536x523.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python5-20x7.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python5-1320x450.png 1320w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Ahora tienes documentos en los dos buckets y contienen la rese\u00f1a y los res\u00famenes de la pel\u00edcula en Couchbase para ejecutar tu an\u00e1lisis de sentimiento contra ellos.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12798\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/02\/python6.png\" alt=\"\" width=\"715\" height=\"377\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python6.png 715w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python6-300x158.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/02\/python6-20x11.png 20w\" sizes=\"auto, (max-width: 715px) 100vw, 715px\" \/><\/p>\n<h4><span style=\"font-weight: 400;\">Escribir UDFs<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Es hora de escribir nuestra propia funci\u00f3n definida por el usuario en Couchbase Analytics. Si necesitas un repaso, aqu\u00ed tienes un enlace a nuestra documentaci\u00f3n sobre <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/analytics\/9_udf.html\"><span style=\"font-weight: 400;\">Funciones definidas por el usuario<\/span><\/a><span style=\"font-weight: 400;\">. Consulte la biblioteca (el <\/span><em><span style=\"font-weight: 400;\">Modelo<\/span><\/em><span style=\"font-weight: 400;\"> y <\/span><em><span style=\"font-weight: 400;\">getSentiment <\/span><\/em><span style=\"font-weight: 400;\">) que creamos en el paso 2 y que cargamos en el servidor Analytics en el paso 3. Ahora se hace referencia a ellos en la siguiente funci\u00f3n definida por el usuario:<\/span><\/p>\n<pre class=\"\">CREATE ANALYTICS FUNCTION getReviewSentiment(text) AS \"sentiment\", \"Model.getSentiment\" \r\nAT sentimentlibrary;<\/pre>\n<p><span style=\"font-weight: 400;\">Cree la UDF de an\u00e1lisis en la misma ubicaci\u00f3n (<\/span><em><span style=\"font-weight: 400;\">sentimentlibrary<\/span><\/em><span style=\"font-weight: 400;\">) como se especifica en el <\/span><span style=\"font-weight: 400;\">rizo <\/span><span style=\"font-weight: 400;\">funci\u00f3n.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Invocaci\u00f3n de las UDF<\/span><\/h4>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Aprovechando las capacidades de N1QL, ahora podemos escribir consultas predictivas dentro de Couchbase Analytics para derivar poderosos insights de nuestros UDFs. De forma encubierta, cuando se invoca esta UDF se llama a la subyacente <\/span><b>Modelo <\/b><span style=\"font-weight: 400;\">que itera sobre cada fila para realizar el an\u00e1lisis de sentimiento. El siguiente es un ejemplo b\u00e1sico de este tipo de consulta, pero las posibilidades son realmente infinitas.<\/span><\/p>\n<pre class=\"\">USE Default;\r\nSELECT getReviewSentiment(r.review_content) AS sentiment, COUNT(*) AS sentimentCount\r\nFROM movie_reviews r, movies m\r\nWHERE m.rotten_tomatoes_link = r.rotten_tomatoes_link\r\nGROUP BY getReviewSentiment(r.review_content)\r\nORDER BY sentimentCount DESC;<\/pre>\n<p><span style=\"font-weight: 400;\">Con una consulta de este tipo obtendr\u00e1 resultados como los siguientes:<\/span><\/p>\n<pre class=\"\">[\r\n{\r\n\"sentimentCount\": 10105,\r\n\"sentiment\": \"Fresh\"\r\n},\r\n{\r\n\"sentimentCount\": 7601,\r\n\"sentiment\": \"Rotten\"\r\n}\r\n]<\/pre>\n<p><span style=\"font-weight: 400;\">Ahora tenemos un recuento ordenado de sentimientos positivos, neutrales y negativos, tal y como los define nuestro modelo entrenado.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Conclusi\u00f3n<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Felicidades, acabas de configurar el entorno necesario de Couchbase Server en Docker y has ejecutado con \u00e9xito tu primera User Defined Function en Couchbase Analytics. Como puedes ver, la integraci\u00f3n de tus modelos Python ML con UDFs y Couchbase Analytics promete ser una forma efectiva de extraer informaci\u00f3n valiosa de tus datos sin comprometer el rendimiento o la eficiencia.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">No dude en hacernos llegar sus preguntas u opiniones en los comentarios o a trav\u00e9s de un mensaje en <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/es\/forums\/\"><span style=\"font-weight: 400;\">Foros de Couchbase<\/span><\/a><span style=\"font-weight: 400;\">. Estamos impacientes por ver c\u00f3mo combinar\u00e1 la potencia de ML y NoSQL para su empresa.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Si desea obtener m\u00e1s informaci\u00f3n sobre Couchbase Analytics, vea nuestra Connect Session: <\/span><a href=\"https:\/\/www.youtube.com\/watch?v=nyHUKfTMKDQ\"><span style=\"font-weight: 400;\">El aprendizaje autom\u00e1tico se une a NoSQL: Python UDFs<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><iframe loading=\"lazy\" title=\"El aprendizaje autom\u00e1tico se une a NoSQL: Python UDFs - CBConnect21\" width=\"900\" height=\"506\" src=\"https:\/\/www.youtube.com\/embed\/nyHUKfTMKDQ?feature=oembed&#038;enablejsapi=1&#038;origin=https:\/\/www.couchbase.com\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/p>\n<p><span style=\"font-weight: 400;\">He aqu\u00ed un resumen de los enlaces y temas mencionados en este post:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/www.couchbase.com\/blog\/es\/ml-meets-nosql-integrating-python-user-defined-functions-with-n1ql-for-analytics\/\"><span style=\"font-weight: 400;\">Parte 1 - ML se une a NoSQL: Integraci\u00f3n de funciones definidas por el usuario de Python con N1QL para an\u00e1lisis<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/github.com\/couchbaselabs\/AnalyticsML\"><span style=\"font-weight: 400;\">Repositorio GitHub de Couchbase AnalyticsML<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/www.kaggle.com\/stefanoleone992\/rotten-tomatoes-movies-and-critic-reviews-dataset\"><span style=\"font-weight: 400;\">Conjunto de datos Kaggle de cr\u00edticas de Rotten Tomatoes<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/analytics\/9_udf.html\"><span style=\"font-weight: 400;\">Documentaci\u00f3n sobre las funciones definidas por el usuario de Couchbase<\/span><\/a><\/li>\n<\/ul>\n<p><b data-stringify-type=\"bold\">Agradecimientos<\/b><br \/>\nGracias a\u00a0<b data-stringify-type=\"bold\">Anuj Kothari,\u00a0<\/b>un becario de verano de gesti\u00f3n de productos para el servicio Couchbase Analytics, cuyos esfuerzos iniciales hicieron que esto empezara y despegara el verano pasado. Gracias a\u00a0<b data-stringify-type=\"bold\">Idris Motiwala<\/b>Director de producto principal del servicio de an\u00e1lisis de Couchbase, y\u00a0<b data-stringify-type=\"bold\">Ian Maxon<\/b>ingeniero de software de Couchbase Analytics Service, por su trabajo editorial para hacer de \u00e9ste un blog m\u00e1s funcional.<\/p>","protected":false},"excerpt":{"rendered":"<p>With Couchbase 7.0 you&#8217;re now capable of allowing integration of Python UDFs with Couchbase Analytics. In Part 1 of this blog series, we covered the essentials for getting Couchbase and the Analytics for Machine Learning (ML) set up. ML has [&hellip;]<\/p>","protected":false},"author":79257,"featured_media":12627,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[2294,9139,2201],"tags":[2140,1725],"ppma_author":[9482],"class_list":["post-12792","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","category-python","category-tools-sdks","tag-machine-learning","tag-nosql-database"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF) - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"In this blog post we walk you though to show you how to apply external algorithms to data that is resident in Couchbase.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/es\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/\" \/>\n<meta property=\"og:locale\" content=\"es_MX\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF)\" \/>\n<meta property=\"og:description\" content=\"In this blog post we walk you though to show you how to apply external algorithms to data that is resident in Couchbase.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/es\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-16T16:34:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T04:25:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1706\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Muk Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Muk Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/\"},\"author\":{\"name\":\"Muk Sreenivasan\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b37fc76b5459210102cef15674423031\"},\"headline\":\"Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF)\",\"datePublished\":\"2022-02-16T16:34:12+00:00\",\"dateModified\":\"2025-06-14T04:25:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/\"},\"wordCount\":1514,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg\",\"keywords\":[\"Machine Learning (ML)\",\"NoSQL Database\"],\"articleSection\":[\"Couchbase Analytics\",\"Python\",\"Tools &amp; SDKs\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/\",\"name\":\"Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF) - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg\",\"datePublished\":\"2022-02-16T16:34:12+00:00\",\"dateModified\":\"2025-06-14T04:25:06+00:00\",\"description\":\"In this blog post we walk you though to show you how to apply external algorithms to data that is resident in Couchbase.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg\",\"width\":2560,\"height\":1706,\"caption\":\"Couchbase Capella 2 years!\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b37fc76b5459210102cef15674423031\",\"name\":\"Muk Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/194f54236bbc53ba3b1b5550c654d008\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/03\/muk_sreenivasan.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/03\/muk_sreenivasan.png\",\"caption\":\"Muk Sreenivasan\"},\"url\":\"https:\/\/www.couchbase.com\/blog\/es\/author\/muk-sreenivasan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF) - The Couchbase Blog","description":"En esta entrada de blog te mostramos c\u00f3mo aplicar algoritmos externos a datos que residen en Couchbase.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/es\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/","og_locale":"es_MX","og_type":"article","og_title":"Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF)","og_description":"In this blog post we walk you though to show you how to apply external algorithms to data that is resident in Couchbase.","og_url":"https:\/\/www.couchbase.com\/blog\/es\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/","og_site_name":"The Couchbase Blog","article_published_time":"2022-02-16T16:34:12+00:00","article_modified_time":"2025-06-14T04:25:06+00:00","og_image":[{"width":2560,"height":1706,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg","type":"image\/jpeg"}],"author":"Muk Sreenivasan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Muk Sreenivasan","Est. reading time":"8 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/"},"author":{"name":"Muk Sreenivasan","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b37fc76b5459210102cef15674423031"},"headline":"Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF)","datePublished":"2022-02-16T16:34:12+00:00","dateModified":"2025-06-14T04:25:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/"},"wordCount":1514,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg","keywords":["Machine Learning (ML)","NoSQL Database"],"articleSection":["Couchbase Analytics","Python","Tools &amp; SDKs"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/","url":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/","name":"Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF) - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg","datePublished":"2022-02-16T16:34:12+00:00","dateModified":"2025-06-14T04:25:06+00:00","description":"En esta entrada de blog te mostramos c\u00f3mo aplicar algoritmos externos a datos que residen en Couchbase.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/12\/simon-abrams-k_T9Zj3SE8k-unsplash-scaled.jpg","width":2560,"height":1706,"caption":"Couchbase Capella 2 years!"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/leveraging-your-ml-models-with-couchbase-analytics-user-defined-functions-udf\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Leveraging your ML models with Couchbase Analytics User Defined Functions (UDF)"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"El blog de Couchbase","description":"Couchbase, la base de datos NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"El blog de Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b37fc76b5459210102cef15674423031","name":"Muk Sreenivasan","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/194f54236bbc53ba3b1b5550c654d008","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/03\/muk_sreenivasan.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/03\/muk_sreenivasan.png","caption":"Muk Sreenivasan"},"url":"https:\/\/www.couchbase.com\/blog\/es\/author\/muk-sreenivasan\/"}]}},"authors":[{"term_id":9482,"user_id":79257,"is_guest":0,"slug":"muk-sreenivasan","display_name":"Muk Sreenivasan","avatar_url":{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/03\/muk_sreenivasan.png","url2x":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/03\/muk_sreenivasan.png"},"author_category":"","last_name":"Sreenivasan","first_name":"Muk","job_title":"","user_url":"","description":"Muk is a Senior Sales Engineer at Couchbase covering the west coast of the United States. He has over 20 years experience in product support, product development, product management and Sales. He lives and works in Silicon Valley."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts\/12792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/users\/79257"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/comments?post=12792"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/posts\/12792\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/media\/12627"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/media?parent=12792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/categories?post=12792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/tags?post=12792"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/es\/wp-json\/wp\/v2\/ppma_author?post=12792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}