tune model and assign model function in clustering in pycaret

This recipe explains the tune model and assign model function in clustering in pycaret. The Tune model function tunes the hyperparameters of a given estimator and The Assign model function cluster labels to the dataset for a given model.

Recipe Objective - What are the tune_model and assign_model functions in the clustering model in pycaret?

PyCaret provides the tune_model and assign_model function in the clustering module.

Learn How to Build a Multi Class Text Classification Model using BERT

For more related projects:-

https://www.projectpro.io/projects/data-science-projects/data-science-projects-in-python
https://www.projectpro.io/projects/data-science-projects/machine-learning-projects-in-python

Tune Model function with Example:-

PyCaret provides "pycaret.clustering.tune_model()" function. The Tune model function tunes the hyperparameters of a given estimator.

from pycaret.datasets import get_data
juice = get_data('juice')
# importing clustering module
from pycaret.clustering import *
# initialize setup
setup_name = setup(data = juice, target = 'medv')
# tune model on kmeans clustering
tuned_km = tune_model(model = 'kmeans', supervised_target = 'Purchase')

assign_model function with Example:-

PyCaret provides "pycaret.clustering.assign_models()" function. The Assign model function cluster labels to the dataset for a given model.

from pycaret.datasets import get_data
jewll = get_data('jewellery')
# importing clustering module
from pycaret.clustering import *
# initialize the setup
setup_name = setup(data = jewll)
# k_means clustering
k_m = create_model('kmeans')
km_df = assign_model(k_m) km_df

What Users are saying..

profile image

Ray han

Tech Leader | Stanford / Yale University
linkedin profile url

I think that they are fantastic. I attended Yale and Stanford and have worked at Honeywell,Oracle, and Arthur Andersen(Accenture) in the US. I have taken Big Data and Hadoop,NoSQL, Spark, Hadoop... Read More

Relevant Projects

Build a Hybrid Recommender System in Python using LightFM
In this Recommender System project, you will build a hybrid recommender system in Python using LightFM .

Personalized Medicine: Redefining Cancer Treatment
In this Personalized Medicine Machine Learning Project you will learn to classify genetic mutations on the basis of medical literature into 9 classes.

NLP Project to Build a Resume Parser in Python using Spacy
Use the popular Spacy NLP python library for OCR and text classification to build a Resume Parser in Python.

AWS MLOps Project for ARCH and GARCH Time Series Models
Build and deploy ARCH and GARCH time series forecasting models in Python on AWS .

Loan Eligibility Prediction in Python using H2O.ai
In this loan prediction project you will build predictive models in Python using H2O.ai to predict if an applicant is able to repay the loan or not.

Build Multi Class Text Classification Models with RNN and LSTM
In this Deep Learning Project, you will use the customer complaints data about consumer financial products to build multi-class text classification models using RNN and LSTM.

Predict Churn for a Telecom company using Logistic Regression
Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

Linear Regression Model Project in Python for Beginners Part 1
Machine Learning Linear Regression Project in Python to build a simple linear regression model and master the fundamentals of regression for beginners.

Recommender System Machine Learning Project for Beginners-3
Content Based Recommender System Project - Building a Content-Based Product Recommender App with Streamlit

Deploying Machine Learning Models with Flask for Beginners
In this MLOps on GCP project you will learn to deploy a sales forecasting ML Model using Flask.