Системи машинного навчання, які працюють у реальних умовах: запитання
Тримайте все під контролем за допомогою колекцій Зберігайте контент і організовуйте його за категоріями відповідно до своїх потреб.
Цей урок зосереджується на запитаннях, які варто ставити щодо даних і моделі із систем, які працюють у реальних умовах.
Чи корисна кожна з ознак?
Ви маєте постійно спостерігати за своєю моделлю, щоб видаляти ознаки, які майже або взагалі не впливають на те, як вона робить прогнози. Якщо вхідні дані для такої ознаки сильно зміняться, поведінка вашої моделі також може різко змінитися на небажану.
Також поставте собі пов’язане запитання, наведене нижче.
Чи справді користь від цієї ознаки компенсує витрати на її застосування?
Завжди є спокуса додати в модель більше ознак. Скажімо, ви знайшли й додали нову ознаку, завдяки якій прогнози моделі дещо покращилися. Звісно, здається, що трохи якісніші прогнози – це краще, ніж дещо гірші, але ця додаткова ознака збільшує навантаження на модель.
Чи надійне ваше джерело даних?
Нижче вказано, що потрібно врахувати стосовно надійності вхідних даних.
Сигнал буде доступний завжди чи надходить із ненадійного джерела? Наприклад:
Чи надходить сигнал від сервера, який виходить із ладу за великого навантаження?
Чи надходить сигнал від людей, які щосерпня їдуть у відпустку?
Чи змінюється система, яка обчислює вхідні дані моделі? Якщо так, потрібно знати:
як часто це відбувається;
як дізнатися, що система змінюється.
Розгляньте можливість створення власної копії даних, які ви отримуєте від попереднього процесу, що є вхідним джерелом даних. Переходьте до нової версії вхідних даних лише тоді, коли впевнені, що це безпечно.
Чи є ваша модель частиною циклу зі зворотним зв’язком?
Іноді модель може впливати на свої навчальні дані. Наприклад, результати деяких моделей стають (прямо чи опосередковано) її вхідними даними.
Іноді одна модель може впливати на іншу. Наприклад, розгляньмо дві моделі для прогнозування цін на акції:
Модель А, яка погано прогнозує їх;
Модель Б.
Оскільки модель A працює з помилками, вона приймає хибне рішення про купівлю акцій із пакета X. Ці покупки підвищують ціни на пакет X. Модель Б використовує ціну пакета Х як вхідну ознаку, тому може зробити хибні висновки про його вартість. Отже, модель Б може купувати або продавати акції з пакета Х, спираючись на помилкову поведінку моделі А. Поведінка моделі Б й собі може вплинути на модель А й, імовірно, спровокувати тюльпаноманію, або різке падіння курсу акцій із пакета компанії Х.
Вправа. Перевірте свої знання
Які три моделі з перелічених нижче схильні до виникнення циклу зі зворотним зв’язком?
Модель прогнозування дорожнього руху, яка передбачає затори на з’їздах з автомагістралей біля пляжу, спираючись на розмір натовпу на ньому як на одну з ознак.
Деякі туристи, імовірно, будуватимуть свої плани на основі прогнозу дорожнього руху. Якщо на пляжі великий натовп і прогнозується інтенсивний дорожній рух, чимало людей можуть змінити свої плани, унаслідок чого відвідуваність пляжу може знизитися. Після цього модель прогнозуватиме, що дорожній рух буде менш інтенсивним. Тоді відвідуваність пляжу збільшиться, і цикл повториться знову.
Модель рекомендацій книг, яка на основі популярності романів (тобто на кількості покупок) пропонує ті, що можуть сподобатися користувачам.
Рекомендації книг, імовірно, сприятимуть покупкам. Відомості про ці додаткові продажі повертатимуться в модель як вхідні дані, підвищуючи ймовірність того, що в майбутньому вона рекомендуватиме ті самі книги.
Модель рейтингу університетів, яка оцінює навчальні заклади частково за вибірковістю – відсотком студентів, яких прийняли, з тих, що подавали заяву на вступ.
Рейтинг моделі може привернути додаткову увагу до навчальних закладів із найвищими оцінками, і тоді кількість заяв, які вони отримують, збільшиться. Якщо ці університети й надалі прийматимуть таку саму кількість студентів, то вибірковість зростатиме (відсоток прийнятих студентів зменшуватиметься). Через це рейтинги таких навчальних закладів підвищаться, а отже, інтерес до них із боку потенційних студентів зросте, і так далі.
Модель для передбачення результатів голосування, яка прогнозує переможця виборів мера на основі опитування 2% виборців після закриття дільниць.
Якщо модель не публікує свій прогноз до закриття виборчих дільниць, її прогнози не можуть вплинути на поведінку виборців.
Модель вартості житла, яка прогнозує ціни, використовуючи розмір (площу у квадратних метрах), кількість спальних кімнат і географічне розташування як ознаки.
Неможливо швидко змінити місце розташування, розмір або кількість спальних кімнат житла у відповідь на прогнози цін, тому виникнення циклу зі зворотним зв’язком малоймовірне. Однак можлива кореляція між розміром житла й кількістю спальних кімнат (у великих будинках їх може бути більше), яку, імовірно, доведеться враховувати.
Модель визначення атрибутів обличчя, яка розпізнає, чи посміхається людина на фотографії. Ця модель регулярно навчається на базі даних фотографій із фотобанку, яка автоматично оновлюється щомісяця.
У цьому прикладі немає циклу зі зворотним зв’язком, оскільки прогнози моделі ніяк не впливають на базу даних фотографій. Однак є інша проблема – зміна версій вхідних даних: щомісячні оновлення потенційно можуть мати непередбачувані наслідки для моделі.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Translation issue","translationIssue","thumb-down"],["Проблема з кодом або зразками","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Останнє оновлення: 2025-04-22 (UTC)."],[[["\u003cp\u003eContinuously monitor models in production to evaluate feature importance and potentially remove unnecessary ones, ensuring prediction quality and resource efficiency.\u003c/p\u003e\n"],["\u003cp\u003eData reliability is crucial; consider data source stability, potential changes in upstream data processes, and create local data copies to control versioning and mitigate risks.\u003c/p\u003e\n"],["\u003cp\u003eBe aware of feedback loops where a model's predictions influence future input data, potentially leading to unexpected behavior or biased outcomes, especially in interconnected systems.\u003c/p\u003e\n"],["\u003cp\u003eRegularly assess your model by asking if features are truly helpful and if their value outweighs the costs of inclusion, aiming for a balance between prediction accuracy and maintainability.\u003c/p\u003e\n"],["\u003cp\u003eEvaluate if your model is susceptible to a feedback loop and take steps to isolate it if you find it is.\u003c/p\u003e\n"]]],[],null,["# Production ML systems: Questions to ask\n\nThis lesson focuses on the questions you should ask about your data\nand model in production systems.\n\nIs each feature helpful?\n------------------------\n\nYou should continuously monitor your model to remove features that contribute\nlittle or nothing to the model's predictive ability. If the input data for\nthat feature abruptly changes, your model's behavior might also abruptly\nchange in undesirable ways.\n\nAlso consider the following related question:\n\n- Does the usefulness of the feature justify the cost of including it?\n\nIt is always tempting to add more features to the model. For example,\nsuppose you find a new feature whose addition makes your model's predictions\nslightly better. Slightly better predictions certainly seem better than\nslightly worse predictions; however, the extra feature adds to your\nmaintenance burden.\n\nIs your data source reliable?\n-----------------------------\n\nSome questions to ask about the reliability of your input data:\n\n- Is the signal always going to be available or is it coming from an unreliable source? For example:\n - Is the signal coming from a server that crashes under heavy load?\n - Is the signal coming from humans that go on vacation every August?\n- Does the system that computes your model's input data ever change? If so:\n - How often?\n - How will you know when that system changes?\n\nConsider creating your own copy of the data you receive from the\nupstream process. Then, only advance to the next version of the upstream\ndata when you are certain that it is safe to do so.\n\nIs your model part of a feedback loop?\n--------------------------------------\n\nSometimes a model can affect its own training data. For example, the\nresults from some models, in turn, become (directly or indirectly) input\nfeatures to that same model.\n\nSometimes a model can affect another model. For example, consider two\nmodels for predicting stock prices:\n\n- Model A, which is a bad predictive model.\n- Model B.\n\nSince Model A is buggy, it mistakenly decides to buy stock in Stock X.\nThose purchases drive up the price of Stock X. Model B uses the price\nof Stock X as an input feature, so Model B can come to some false\nconclusions about the value of Stock X. Model B could, therefore,\nbuy or sell shares of Stock X based on the buggy behavior of Model A.\nModel B's behavior, in turn, can affect Model A, possibly triggering a\n[tulip mania](https://wikipedia.org/wiki/Tulip_mania) or a slide in\nCompany X's stock.\n\n### Exercise: Check your understanding\n\nWhich **three** of the following models are susceptible to a feedback loop? \nA traffic-forecasting model that predicts congestion at highway exits near the beach, using beach crowd size as one of its features. \nSome beachgoers are likely to base their plans on the traffic forecast. If there is a large beach crowd and traffic is forecast to be heavy, many people may make alternative plans. This may depress beach turnout, resulting in a lighter traffic forecast, which then may increase attendance, and the cycle repeats. \nA book-recommendation model that suggests novels its users may like based on their popularity (i.e., the number of times the books have been purchased). \nBook recommendations are likely to drive purchases, and these additional sales will be fed back into the model as input, making it more likely to recommend these same books in the future. \nA university-ranking model that rates schools in part by their selectivity---the percentage of students who applied that were admitted. \nThe model's rankings may drive additional interest to top-rated schools, increasing the number of applications they receive. If these schools continue to admit the same number of students, selectivity will increase (the percentage of students admitted will go down). This will boost these schools' rankings, which will further increase prospective student interest, and so on... \nAn election-results model that forecasts the winner of a mayoral race by surveying 2% of voters after the polls have closed. \nIf the model does not publish its forecast until after the polls have closed, it is not possible for its predictions to affect voter behavior. \nA housing-value model that predicts house prices, using size (area in square meters), number of bedrooms, and geographic location as features. \nIt is not possible to quickly change a house's location, size, or number of bedrooms in response to price forecasts, making a feedback loop unlikely. However, there is potentially a correlation between size and number of bedrooms (larger homes are likely to have more rooms) that may need to be teased apart. \nA face-attributes model that detects whether a person is smiling in a photo, which is regularly trained on a database of stock photography that is automatically updated monthly. \nThere is no feedback loop here, as model predictions don't have any impact on the photo database. However, versioning of the input data is a concern here, as these monthly updates could potentially have unforeseen effects on the model. \n[Help Center](https://support.google.com/machinelearningeducation)"]]