ChatGPT prompts for data science
این پرامپت به هوش مصنوعی نقش «unsure of the librarys current API» را میدهد و برای فهمیدن دادهها و بیرون کشیدن نتیجه از آنها به کار میآید. جمله آغازین آن: «These data science prompts cover exploratory analysis and visualization, model building and evaluation, feature engineering, and applied work like data cleaning…»
متن پرامپت
These data science prompts cover exploratory analysis and visualization, model building and evaluation, feature engineering, and applied work like data cleaning and synthetic data generation. Model training: Write Python code to train and tune a [model] for predicting [target]. Use [libraries and versions], prevent data leakage, and evaluate it with [metric] on an untouched test set. Include preprocessing, cross-validation, reproducibility, and concise comments. Data schema and constraints: [insert details] Data visualization: Write Python code to explore this [subject] dataset using appropriate univariate, bivariate, and correlation visualizations. Handle missing values and outliers transparently rather than altering them automatically. Comment on each plot’s purpose, not its conclusions. Data schema: [insert details] Synthetic data: Generate a reproducible CSV with [rows] rows and this schema: [Insert columns, types, ranges, distributions, and relationships]. Use no real personal data, label the dataset synthetic, validate the constraints, and provide the Python generation code. Customer churn prediction: Build a churn model from the supplied dataset and churn definition. Prevent temporal leakage, compare suitable models, evaluate class-sensitive metrics and thresholds, and explain model associations without presenting them as causal drivers. Include reproducible Python code. Context: [insert details] AutoML for fraud detection: Using [AutoML library, e.g., FLAML or TPOT], write Python code to select a fraud-classification pipeline through training-set cross-validation. Keep the test set untouched until final evaluation and report ROC AUC, PR AUC, precision, recall, confusion matrix, and threshold trade-offs. If you are unsure of the library's current API, say so and provide the pipeline structure with placeholders rather than guessing method names. Data schema and costs: [insert details] Python regex: Write a practical Python regex for email addresses under these assumptions: [allowed formats]. Include accepted and rejected test cases, explain its limitations, and recommend parser or verification-based validation where appropriate. Predictive model: Build a model to predict [target] from time-ordered historical data. Train on earlier observations and evaluate with rolling validation ending in the most recent month. Prevent future-data leakage and report [metrics]. Data and business context: [insert details] NLP model: Write Python code for binary sentiment classification of these customer reviews using [libraries]. Include data splitting, preprocessing appropriate to the model, a baseline, training, class-aware evaluation, and error analysis. Data schema: [insert details] Dataset generation: Generate a synthetic sentiment-analysis CSV with [number] rows and two columns, text and label. Use this domain, label definition, class balance, and language style: [insert details]. Avoid duplicates, keep examples unambiguous unless the label definition includes a mixed or neutral class, validate the output, and label it synthetic. Data scraper: Write a Python scraper for [URL] that extracts [fields] into [CSV/JSON]. Respect permitted access and robots.txt, use rate limiting, and handle pagination, errors, retries, and missing fields. Use the site structure and constraints below: [insert details] Recommendation system: Write Python code for a [recommendation objective] ecommerce recommender using browsing and purchase data. Include preprocessing, a baseline, train–validation splitting, cold-start handling, offline metrics, and recommendation examples. Data schema and constraints: [insert details] Dimensionality reduction: Write scikit-learn code to apply PCA to this numeric dataset. Handle missing data, scale features where appropriate, report explained variance, and plot the first two or three components with matplotlib. State whether PCA is suitable. Data schema: [insert details] Metric calculations: Write code to calculate these CLV metrics: [metrics]. Define each formula and use the supplied revenue, margin, time horizon, churn, and discount-rate assumptions. Return customer-level results and summary checks. Data schema: [insert details] Analysis code cleanup: Restructure this exploratory analysis script or notebook into clear, reproducible code while preserving its outputs. Separate data loading, transformation, and analysis steps, remove dead code and duplicated logic, and explain material changes. Do not claim performance gains without evidence. Code and context: [insert details] Dashboard creation guidance: Explain how to build a Plotly Dash dashboard for [users] to monitor [KPIs] from this sales dataset. Cover data preparation, layout, filters, charts, refresh behavior, validation, accessibility, and deployment. Data schema and library versions: [insert details] Help cleaning raw data: Create a cleaning plan for this customer-feedback dataset. Profile missing values, duplicates, formats, and text quality; recommend justified treatments; preserve the raw data; and record every transformation. Schema and intended analysis: [insert details] Anomaly detection: Write Python code to flag anomaly candidates in this dataset using Isolation Forest. Explain preprocessing and contamination assumptions, return scores and flags, visualize the results where feasible, and describe how to validate them with domain evidence. Data schema: [insert details] A/B test analysis: Analyze this A/B test using the appropriate method for [metric]. Check sample sizes, allocation, assumptions, and data quality; report effect size, p-value, confidence interval, and practical significance; and give a recommendation with limitations. Test data and design: [insert details] Further reading: How to Use Data Science to Improve SEO
جایخالیهایی که باید پر کنی
[URL]«URL» را با مقدار واقعی خودت جایگزین کنچطور از این پرامپت استفاده کنم؟
این یک پرامپت در سطح «پیشرفته» از دسته داده و تحلیل است. برای اینکه بهترین نتیجه را بگیری، این مسیر را دنبال کن:
۱) کپی کن. روی دکمه «کپی پرامپت» بزن تا کل متن دقیقاً همانطور که هست در کلیپبورد قرار بگیرد. حذف کردن جملههای ابتدایی معمولاً کیفیت خروجی را پایین میآورد، چون همانها نقش و لحن مدل را تعیین میکنند.
۲) در یک گفتگوی تازه بچسبان. این پرامپت را به عنوان اولین پیام یک چت جدید بفرست. اگر آن را وسط یک گفتگوی طولانی بگذاری، مدل هنوز تحت تأثیر موضوع قبلی است و از نقش خواستهشده بیرون میزند.
۳) جایخالیها را پر کن. در این متن 1 جایخالی وجود دارد: [URL]. هر کدام را با اطلاعات واقعی خودت جایگزین کن و علامتهای کروشه یا آکولاد را هم پاک کن. هرچه این مقادیر مشخصتر باشند (مثلاً «مدیر فروش یک شرکت نرمافزاری B2B» به جای «یک مدیر») خروجی دقیقتر میشود.
۴) به مدل زمینه بده. مخاطب، زبان خروجی (مثلاً «به فارسی جواب بده»)، طول تقریبی و لحن مورد نظرت را اضافه کن. بیشتر جوابهای ضعیف نتیجه نبودِ همین سه خط اضافهاند، نه ضعف خودِ پرامپت.
۵) یک بار اصلاح کن. جواب اول را نهایی فرض نکن. بنویس «این بخش را کوتاهتر کن»، «مثال واقعی اضافه کن» یا «سه نسخه متفاوت بده». دور دوم تقریباً همیشه بهتر از دور اول است.
۶) اعداد و منابع را راستیآزمایی کن. مدل ممکن است ارجاع یا آمار بسازد. هر عددی که قرار است جایی استفاده شود را از منبع اصلی چک کن.
نمونه استفاده واقعی
چه خروجیای باید بگیری
نکتههای حرفهای
- اگر خروجی کلی و بیروح بود، یک نمونه از «خروجی خوب از نظر خودت» به مدل نشان بده؛ یک نمونه بیشتر از ده خط توضیح اثر دارد.
- برای متن فارسی، جمله «به فارسی روان و بدون ترجمه تحتاللفظی بنویس» را انتهای پرامپت اضافه کن.
- جایخالیها را خالی نگذار؛ اگر مقداری را نمیدانی، به جای حذفش بنویس «فرض کن ...» تا مدل سرخود چیزی از خودش نسازد.
- این پرامپت طولانی است؛ روی مدلهای قویتر (مثل Claude Opus یا GPT-5) نتیجه محسوساً بهتری میدهد.