← Back To All Blogs

Your Ultimate Guide to write ChatGPT Prompts for easing Data Science Work:

- 15 minutes read | By Harshit Singh






Your Ultimate Guide to write ChatGPT Prompts for easing Data Science: [17 mins ] In today's data-driven world, data science has emerged as a crucial field for making informed decisions and extracting valuable insights from data. Whether you're a seasoned data scientist, a newbie looking to learn, or someone seeking specific data-related assistance, ChatGPT has got you covered. In this comprehensive guide, we will explore 60 ChatGPT prompts tailored to various data science needs. For each prompt, we'll explain its purpose and provide examples of how it can be used.
Reference Repo: https://github.com/travistangvh/ChatGPT-Data-Science-Prompts

1. Train Classification Model

Purpose: Request ChatGPT to act as a data scientist and provide Python code for training a classification model.

Example Prompt: "I have a dataset of customer reviews. Please build a machine learning model that predicts whether a review is positive or negative."

2. Automatic Machine Learning (AutoML)

Purpose: Ask ChatGPT to perform AutoML using TPOT, seeking Python code for finding the best classification model.

Example Prompt: "I need to predict customer churn. Please write Python code to find the best classification model with the highest accuracy on the test set."

3. Tune Hyperparameter

Purpose: Request ChatGPT to provide Python code for hyperparameter tuning of a given machine learning model.

Example Prompt: "I've trained a random forest model. Please write code to tune its hyperparameters for better performance."

4. Explore Data

Purpose: Ask ChatGPT to provide Python code for data visualization and exploration.

Example Prompt: "I have a dataset of housing prices. Please write code for visualizing the relationship between square footage and price."

5. Generate Data

Purpose: Task ChatGPT with generating a synthetic dataset with specified characteristics.

Example Prompt: "I need a dataset with 1000 rows and 5 columns: 'age', 'income', 'gender', 'location', and 'purchase_amount'."

6. Write Regex

Purpose: Request ChatGPT to create a Python regular expression (regex) for a specific pattern.

Example Prompt: "Please write me a regex in Python that matches email addresses."

7. Train Time Series Model

Purpose: Seek Python code to train a time series forecasting model using historical data.

Example Prompt: "I have a time series dataset of stock prices. Please build a model that predicts the stock price for the next month."

8. Address Imbalanced Data

Purpose: Inquire about techniques to handle imbalanced datasets in Python.

Example Prompt: "My dataset is imbalanced, and I'm using logistic regression. How can I oversample the minority class to improve model performance?"

9. Get Feature Importance

Purpose: Request Python code to determine feature importance in a trained machine learning model.

Example Prompt: "I've trained a decision tree model. Please provide code to find the most important features."

10. Visualize Data with Matplotlib

Purpose: Ask ChatGPT to provide Python code for creating specific data visualizations using the Matplotlib library.

Example Prompt: "I have a dataset of monthly sales. Please create a line chart showing the trend in sales over the last year."

11. Visualize Image Grid with Matplotlib

Purpose: Request Python code to display a grid of images using Matplotlib.

Example Prompt: "I have a folder of cat and dog images. Please create a 4x4 grid of these images for visual inspection."

12. Explain Model with Lime

Purpose: Ask ChatGPT to provide Python code for explaining machine learning model predictions using LIME.

Example Prompt: "I have a text classification model. Please provide code to explain why a certain text was classified as positive."

13. Explain Model with Shap

Purpose: Request Python code for explaining machine learning model predictions using SHAP (SHapley Additive exPlanations).

Example Prompt: "I've trained an XGBoost model. Please provide code to create SHAP summary plots to explain its predictions."

14. Write Multithreaded Functions

Purpose: Seek assistance in parallelizing Python code using multithreading.

Example Prompt: "Can you help me parallelize this Python function across threads to speed up data processing?"

15. Compare Function Speed

Purpose: Request Python code to compare the efficiency of two algorithms and measure their runtime.

Example Prompt: "I have two sorting algorithms. Please write code to compare their performance and provide runtime statistics."

16. Handle Missing Data

Purpose: Inquire about strategies and Python code for handling missing data in a dataset.

Example Prompt: "My dataset has missing values. How can I impute them using mean imputation in Python?"

17. Perform Principal Component Analysis (PCA)

Purpose: Request Python code for performing Principal Component Analysis (PCA) on a dataset for dimensionality reduction.

Example Prompt: "I have a high-dimensional dataset. Please provide code to perform PCA and reduce its dimensionality."

18. Compute Pearson Correlation

Purpose: Ask ChatGPT to provide Python code for calculating the Pearson correlation coefficient between two variables.

Example Prompt: "I have two numerical columns in my dataset. Please write code to calculate their Pearson correlation."

19. Create Word Cloud

Purpose: Request Python code to create a word cloud visualization from a text dataset.

Example Prompt: "I have a collection of customer reviews. Please provide code to generate a word cloud of the most frequent words."

20. Calculate Mean Absolute Error (MAE)

Purpose: Seek Python code to compute the Mean Absolute Error (MAE) for a regression model's predictions.

Example Prompt: "I have a regression model. Please provide code to calculate the Mean Absolute Error (MAE) for its predictions."

21. Calculate Root Mean Squared Error (RMSE)

Purpose: Request Python code to calculate the Root Mean Squared Error (RMSE) for a regression model's predictions.

Example Prompt: "I have a regression model. Please provide code to calculate the Root Mean Squared Error (RMSE) for its predictions."

22. Perform Anova Test

Purpose: Ask ChatGPT to provide Python code for conducting an Analysis of Variance (ANOVA) test.

Example Prompt: "I have multiple groups of data. Please write code to perform an ANOVA test to compare their means."

23. Handle Categorical Data

Purpose: Request Python code to preprocess and encode categorical data for machine learning.

Example Prompt: "I have categorical variables in my dataset. Please provide code to one-hot encode them for a machine learning model."

24. Create Heatmap with Seaborn

Purpose: Ask ChatGPT to provide Python code for creating a heatmap visualization using the Seaborn library.

Example Prompt: "I have a correlation matrix. Please provide code to create a heatmap to visualize the correlations."

25. Write SQL Query

Purpose: Request SQL code to perform specific database queries.

Example Prompt: "I have a database table 'employees'. Please write an SQL query to retrieve all employees with a salary above $50,000."

26. Perform K-Means Clustering

Purpose: Seek Python code to perform K-Means clustering on a dataset.

Example Prompt: "I have a dataset of customer demographics. Please provide code to perform K-Means clustering to segment customers."

27. Calculate TF-IDF

Purpose: Request Python code to calculate Term Frequency-Inverse Document Frequency (TF-IDF) for text data.

Example Prompt: "I have a collection of documents. Please provide code to calculate TF-IDF scores for the terms in these documents."

28. Handle Time Series Data

Purpose: Inquire about techniques and Python code for handling time series data, such as resampling and feature engineering.

Example Prompt: "I have hourly time series data. How can I resample it to daily frequency using Python?"

29. Create Line Chart with Plotly

Purpose: Request Python code to create an interactive line chart using the Plotly library.

Example Prompt: "I have time series data. Please provide code to create an interactive line chart with Plotly."

30. Implement Recurrent Neural Network (RNN)

Purpose: Ask ChatGPT to provide Python code for implementing a Recurrent Neural Network (RNN) for sequence data.

Example Prompt: "I have sequential data. Please write code to build and train a Recurrent Neural Network (RNN) model."

31. Visualize Geographic Data with Folium

Purpose: Request Python code to create interactive maps and visualize geographic data using the Folium library.

Example Prompt: "I have latitude and longitude data. Please provide code to create an interactive map with Folium."

32. Create Bar Chart Race

Purpose: Ask ChatGPT to provide Python code for creating a bar chart race animation to visualize changing data over time.

Example Prompt: "I have monthly sales data. Please provide code to create a bar chart race animation to show the sales trends."

33. Perform Natural Language Processing (NLP)

Purpose: Seek Python code and techniques for natural language processing tasks, such as text classification and sentiment analysis.

Example Prompt: "I have a dataset of product reviews. Please provide code to perform sentiment analysis on the reviews."

34. Implement Recommender System

Purpose: Request Python code to build a recommender system for personalized recommendations.

Example Prompt: "I have user and item data. Please provide code to build a collaborative filtering recommender system."

35. Conduct A/B Testing

Purpose: Inquire about the process and Python code for conducting A/B tests to compare the performance of two versions of a product or website.

Example Prompt: "I want to A/B test two different website designs. Please provide code for setting up and analyzing the A/B test."

36. Implement Deep Learning Model

Purpose: Ask ChatGPT to provide Python code for building and training deep learning models, such as convolutional neural networks (CNNs) or recurrent neural networks (RNNs).

Example Prompt: "I have an image classification task. Please provide code to build and train a convolutional neural network (CNN) for this task."

37. Perform Hyperparameter Tuning with Grid Search

Purpose: Request Python code to perform hyperparameter tuning using grid search for a machine learning model.

Example Prompt: "I have a support vector machine (SVM) model. Please provide code to perform hyperparameter tuning with grid search."

38. Create Interactive Dashboard with Dash

Purpose: Ask ChatGPT to provide Python code for building interactive web dashboards using the Dash library.

Example Prompt: "I have data I want to visualize in an interactive dashboard. Please provide code to create a dashboard using Dash."

39. Perform Image Classification with Transfer Learning

Purpose: Request Python code for performing image classification using transfer learning with pre-trained deep learning models.

Example Prompt: "I have a dataset of flowers. Please provide code to perform image classification using a pre-trained ResNet model."

40. Generate Synthetic Text with GPT-3

Purpose: Inquire about how to use the GPT-3 language model to generate synthetic text for specific tasks or content.

Example Prompt: "I need to generate natural language text for product descriptions. How can I use GPT-3 for this purpose?"

41. Implement Object Detection

Purpose: Seek Python code and techniques for implementing object detection using deep learning models like YOLO or Faster R-CNN.

Example Prompt: "I have an image dataset with objects. Please provide code to perform object detection using YOLO."

42. Create Animated Data Visualization

Purpose: Request Python code to create animated data visualizations, such as animated bar charts or line charts.

Example Prompt: "I have data that changes over time. Please provide code to create an animated bar chart to visualize this data."

43. Build Chatbot with Rasa

Purpose: Ask ChatGPT to provide guidance and Python code for building a chatbot using the Rasa framework.

Example Prompt: "I want to create a chatbot for customer support. Please provide code and steps to build it using Rasa."

44. Conduct Time Series Forecasting

Purpose: Seek Python code and methods for time series forecasting, including techniques like ARIMA or Prophet.

Example Prompt: "I have daily sales data. Please provide code to perform time series forecasting using the Prophet library."

45. Create 3D Visualization with Plotly

Purpose: Request Python code to create 3D visualizations and plots using the Plotly library.

Example Prompt: "I have 3D data points. Please provide code to create a 3D scatter plot using Plotly."

46. Analyze Customer Churn

Purpose: Inquire about Python code and techniques for analyzing customer churn or attrition in a business dataset.

Example Prompt: "I have customer data and want to analyze churn. Please provide code to identify factors contributing to customer churn."

47. Build Recommendation System with Matrix Factorization

Purpose: Request Python code for building a recommendation system using matrix factorization techniques like Singular Value Decomposition (SVD).

Example Prompt: "I have user-item interaction data. Please provide code to build a recommendation system using SVD."

48. Create Custom Visualization with D3.js

Purpose: Ask ChatGPT to provide guidance and code for creating custom data visualizations using the D3.js library.

Example Prompt: "I have a unique data visualization idea. Please provide code and steps to create it using D3.js."

49. Implement GAN (Generative Adversarial Network)

Purpose: Request Python code for implementing a Generative Adversarial Network (GAN) for image generation.

Example Prompt: "I want to generate realistic images of animals. Please provide code to implement a GAN for this purpose."

50. Analyze Sentiment on Social Media Data

Purpose: Inquire about Python code and techniques for analyzing sentiment in social media data, such as Twitter or Facebook posts.

Example Prompt: "I have a dataset of Twitter tweets. Please provide code to perform sentiment analysis and visualize sentiment trends."

51. Implement Natural Language Generation (NLG)

Purpose: Ask ChatGPT to provide guidance and Python code for implementing Natural Language Generation (NLG) systems.

Example Prompt: "I want to generate product descriptions. Please provide code and techniques for implementing an NLG system."

52. Build Fraud Detection System

Purpose: Request Python code and strategies for building a fraud detection system for financial transactions.

Example Prompt: "I want to detect fraudulent credit card transactions. Please provide code to build a fraud detection system."

53. Create Custom Data Preprocessing Pipeline

Purpose: Ask ChatGPT to help design and implement a custom data preprocessing pipeline in Python.

Example Prompt: "I have unique data preprocessing needs. Please provide guidance and code to create a custom data preprocessing pipeline."

54. Analyze User Behavior with Funnel Analysis

Purpose: Inquire about Python code and techniques for analyzing user behavior and conversion funnels on a website or app.

Example Prompt: "I want to analyze the user journey on my website. Please provide code for funnel analysis."

55. Create Custom Machine Learning Model

Purpose: Request guidance and Python code for creating custom machine learning models tailored to specific problem domains.

Example Prompt: "I have a unique problem. Please provide guidance and code to build a custom machine learning model for it."

56. Implement Time Series Anomaly Detection

Purpose: Seek Python code and techniques for implementing anomaly detection in time series data.

Example Prompt: "I have sensor data and want to detect anomalies. Please provide code for time series anomaly detection."

57. Create Interactive Data Visualization with Bokeh

Purpose: Request Python code to create interactive data visualizations using the Bokeh library.

Example Prompt: "I have data I wa nt to visualize interactively. Please provide code to create an interactive plot with Bokeh."

58. Perform Outlier Detection

Purpose: Inquire about Python code and techniques for detecting outliers in a dataset.

Example Prompt: "I have data with potential outliers. Please provide code to detect and visualize the outliers."

59. Build Customer Segmentation Model

Purpose: Request Python code and techniques for building customer segmentation models to group customers based on behavior or characteristics.

Example Prompt: "I want to segment my customers for targeted marketing. Please provide code to build a customer segmentation model."

60. Create Custom Data Visualization with Matplotlib

Purpose: Ask ChatGPT to help design and create custom data visualizations using the Matplotlib library.

Example Prompt: "I have a unique data visualization idea. Please provide code and guidance to create it using Matplotlib."





Comment about the blog👇

Knowledge is power. Knowledge shared is power multiplied.




 

Work done byHarshanz for iamdata