تهيئة DVC وتتبع مجموعة بيانات
شغّل dvc add وثبّت المؤشر، لا البيانات.
تهيئة DVC وتتبع مجموعة بيانات درس مجاني في MLOps Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في MLOps Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة MLOps Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Install DVC First
DVC is a Python package, so a single pip command gets you started. After this you have the dvc command available in your terminal.
pip install dvcStart Inside a Git Repo
DVC works alongside Git, not instead of it. So you run it inside an existing Git repository where your code already lives.
git init
dvc initWhat dvc init Creates
dvc init adds a hidden .dvc folder holding config and the local cache. Commit it once so the whole team shares the same setup.
git add .dvc .dvcignore
git commit -m "Initialize DVC"Track Your First Dataset
Point DVC at the file or folder you want versioned with dvc add. DVC moves the real data into its cache and leaves a small placeholder behind.
dvc add data/train.csvThe .dvc Pointer File
dvc add creates a tiny .dvc file next to your data. It stores the file's hash and size, acting as the address Git will track.
# data/train.csv.dvc
outs:
- md5: 3f2a9c...
size: 524288
path: train.csvGit Tracks the Pointer
You commit the small .dvc file to Git, never the raw dataset. Git now records which version of the data this commit expects.
git add data/train.csv.dvc
git commit -m "Track training data"Real Data Goes to .gitignore
So you never commit the big file by accident, dvc add auto-adds the dataset path to .gitignore. Git simply ignores the heavy bytes.
cat .gitignore
# /train.csvContent-Addressable Cache
DVC names cached files by their content hash. Identical data is stored once, so duplicate datasets never waste disk space. 💾
Check the Status
Run dvc status any time to see whether your working data matches what the .dvc files expect. It is your quick health check.
dvc statusUpdate a Tracked File
When the dataset changes, just run dvc add again. DVC recomputes the hash and updates the .dvc file, which you commit as a new version.
dvc add data/train.csv
git add data/train.csv.dvc
git commit -m "New data snapshot"Track Folders Too
dvc add works on whole directories, not just single files. Point it at a folder and DVC versions everything inside as one tracked unit.
dvc add data/images/Quick Check
After running dvc add on a dataset, what do you commit to Git?
Recap
You ran dvc init, then dvc add to track a dataset. DVC caches the real data and writes a tiny .dvc pointer that Git commits, keeping code and data linked.
الأسئلة الشائعة
هل درس «تهيئة DVC وتتبع مجموعة بيانات» مجاني؟
نعم — نص درس «تهيئة DVC وتتبع مجموعة بيانات» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة MLOps Academy، انتقل إلى CoddyKit PRO. تتضمن دورة MLOps Academy 4 دروس في المجموع.
ماذا ستتعلم في «تهيئة DVC وتتبع مجموعة بيانات»؟
شغّل dvc add وثبّت المؤشر، لا البيانات. تتمرن على MLOps Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ MLOps Academy؟
لا تُشترط خبرة سابقة. MLOps Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «تهيئة DVC وتتبع مجموعة بيانات»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس MLOps Academy هذا؟
نعم. كل درس في MLOps Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- لماذا لا يكفي Git لإصدار البيانات
- تهيئة DVC وتتبع مجموعة بيانات
- دفع البيانات إلى التخزين البعيد
- الرجوع إلى إصدار سابق من مجموعة البيانات