На этой странице содержатся термины глоссария Метрики. Чтобы просмотреть все термины глоссария, нажмите здесь .
А
точность
Количество правильных прогнозов классификации, разделенное на общее количество прогнозов. То есть:
Например, модель, которая сделала 40 правильных прогнозов и 10 неправильных прогнозов, будет иметь точность:
Бинарная классификация дает конкретные названия различным категориям правильных и неправильных прогнозов . Итак, формула точности бинарной классификации выглядит следующим образом:
где:
- TP — количество истинных положительных результатов (правильных прогнозов).
- TN — количество истинных негативов (правильных прогнозов).
- FP — количество ложных срабатываний (неверных прогнозов).
- FN — количество ложноотрицательных результатов (неверных прогнозов).
Сравните и сопоставьте точность с точностью и отзывом .
Дополнительную информацию см. в разделе «Классификация: точность, полнота, прецизионность и связанные с ними показатели» в ускоренном курсе машинного обучения.
площадь под кривой PR
См. PR AUC (площадь под кривой PR) .
площадь под кривой ROC
См. AUC (площадь под кривой ROC) .
AUC (Площадь под кривой ROC)
Число от 0,0 до 1,0, обозначающее способность модели бинарной классификации отделять положительные классы от отрицательных классов . Чем ближе AUC к 1,0, тем лучше способность модели отделять классы друг от друга.
Например, на следующем рисунке показана модель классификации , которая идеально отделяет положительные классы (зеленые овалы) от отрицательных классов (фиолетовые прямоугольники). Эта нереально идеальная модель имеет AUC 1,0:
И наоборот, на следующем рисунке показаны результаты для модели классификации , которая генерировала случайные результаты. Эта модель имеет AUC 0,5:
Да, предыдущая модель имеет AUC 0,5, а не 0,0.
Большинство моделей находятся где-то между двумя крайностями. Например, следующая модель несколько отделяет положительные значения от отрицательных и поэтому имеет AUC где-то между 0,5 и 1,0:
AUC игнорирует любые значения, установленные вами для порога классификации . Вместо этого AUC учитывает все возможные пороги классификации.
Дополнительную информацию см. в разделе «Классификация: ROC и AUC в ускоренном курсе машинного обучения».
средняя точность при k
Метрика для подведения итогов эффективности модели в одном запросе, который генерирует ранжированные результаты, например нумерованный список рекомендаций по книгам. Средняя точность при k — это среднее значение точности при значениях k для каждого соответствующего результата. Таким образом, формула средней точности при k выглядит следующим образом:
\[{\text{average precision at k}} = \frac{1}{n} \sum_{i=1}^n {\text{precision at k for each relevant item} } \]
где:
- \(n\) — количество соответствующих элементов в списке.
Сравните с отзывом в k .
Б
базовый уровень
Модель , используемая в качестве ориентира для сравнения эффективности другой модели (обычно более сложной). Например, модель логистической регрессии может служить хорошей основой для глубокой модели .
Для конкретной проблемы базовый уровень помогает разработчикам моделей количественно определить минимальную ожидаемую производительность, которой должна достичь новая модель, чтобы новая модель была полезной.
С
расходы
Синоним потери .
контрфактическая справедливость
Метрика справедливости , которая проверяет, дает ли модель классификации тот же результат для одного человека, что и для другого человека, идентичного первому, за исключением одного или нескольких чувствительных атрибутов . Оценка модели классификации на предмет контрфактической справедливости является одним из методов выявления потенциальных источников систематической ошибки в модели.
Дополнительную информацию см. в одном из следующих разделов:
- Справедливость: контрфактическая справедливость в ускоренном курсе машинного обучения.
- Когда миры сталкиваются: справедливое объединение различных контрфактических предположений
перекрестная энтропия
Обобщение Log Loss для задач многоклассовой классификации . Перекрестная энтропия количественно определяет разницу между двумя распределениями вероятностей. См. также недоумение .
кумулятивная функция распределения (CDF)
Функция, определяющая частоту выборок, меньшую или равную целевому значению. Например, рассмотрим нормальное распределение непрерывных значений. CDF сообщает вам, что примерно 50% выборок должны быть меньше или равны среднему значению и что примерно 84% выборок должны быть меньше или равны одному стандартному отклонению выше среднего.
Д
демографический паритет
Метрика справедливости , которая удовлетворяется, если результаты классификации модели не зависят от заданного конфиденциального атрибута .
Например, если и лилипуты, и бробдингнаги подают документы в университет Глуббдубдриб, демографический паритет достигается, если процент принятых лилипутов такой же, как процент принятых бробдингнагов, независимо от того, является ли одна группа в среднем более квалифицированной, чем другая.
Сравните с уравниванием шансов и равенством возможностей , которые позволяют результатам классификации в совокупности зависеть от конфиденциальных атрибутов, но не позволяют результатам классификации для определенных указанных основных меток истинности зависеть от конфиденциальных атрибутов. См. «Борьба с дискриминацией с помощью более разумного машинного обучения», где представлена визуализация компромиссов при оптимизации для достижения демографического паритета.
Дополнительную информацию см. в разделе «Справедливость: демографический паритет» в ускоренном курсе машинного обучения.
Э
расстояние землеройной машины (EMD)
Мера относительного сходства двух распределений . Чем меньше расстояние, на которое проехал землеройный комбайн, тем более схожими являются распределения.
изменить расстояние
Измерение того, насколько похожи две текстовые строки друг на друга. В машинном обучении расстояние редактирования полезно по следующим причинам:
- Расстояние редактирования легко вычислить.
- Расстояние редактирования позволяет сравнивать две строки, которые, как известно, похожи друг на друга.
- Расстояние редактирования может определять степень сходства различных строк с данной строкой.
Существует несколько определений расстояния редактирования, каждое из которых использует разные строковые операции. См. пример расстояния Левенштейна .
эмпирическая кумулятивная функция распределения (eCDF или EDF)
Кумулятивная функция распределения , основанная на эмпирических измерениях на основе реального набора данных. Значение функции в любой точке вдоль оси X — это доля наблюдений в наборе данных, которые меньше или равны указанному значению.
энтропия
В теории информации — описание того, насколько непредсказуемо распределение вероятностей. Альтернативно, энтропия также определяется как количество информации, содержащейся в каждом примере . Распределение имеет максимально возможную энтропию, когда все значения случайной величины равновероятны.
Энтропия набора с двумя возможными значениями «0» и «1» (например, метки в задаче бинарной классификации ) имеет следующую формулу:
H = -p log p - q log q = -p log p - (1-p) * log (1-p)
где:
- H — энтропия.
- p — доля примеров «1».
- q — доля примеров «0». Обратите внимание, что q = (1 - p)
- log обычно равен log 2 . В данном случае единицей энтропии является бит.
Например, предположим следующее:
- 100 примеров содержат значение «1»
- 300 примеров содержат значение «0»
Следовательно, значение энтропии равно:
- р = 0,25
- q = 0,75
- H = (-0,25)log 2 (0,25) - (0,75)log 2 (0,75) = 0,81 бит на пример
Идеально сбалансированный набор (например, 200 «0» и 200 «1») будет иметь энтропию 1,0 бита на каждый пример. Когда набор становится более несбалансированным , его энтропия приближается к 0,0.
В деревьях решений энтропия помогает сформулировать прирост информации , чтобы помочь разделителю выбрать условия во время роста дерева решений классификации.
Сравните энтропию с:
- Джини примесь
- функция перекрестных энтропийных потерь
Энтропию часто называют энтропией Шеннона .
Дополнительную информацию см. в разделе Точный разделитель для двоичной классификации с числовыми признаками в курсе «Леса решений».
равенство возможностей
Метрика справедливости, позволяющая оценить, одинаково ли хорошо модель предсказывает желаемый результат для всех значений чувствительного атрибута . Другими словами, если желаемым результатом модели является положительный класс , цель состоит в том, чтобы истинный положительный уровень был одинаковым для всех групп.
Равенство возможностей связано с уравниванием шансов , которое требует, чтобы как истинно положительные, так и ложноположительные показатели были одинаковыми для всех групп.
Предположим, университет Глаббдубдриб принимает как лилипутов, так и бробдингнегов на строгую математическую программу. Средние школы лилипутов предлагают обширную программу занятий по математике, и подавляющее большинство учащихся имеют право на университетскую программу. В средних школах Бробдингнеджана вообще не проводятся занятия по математике, и в результате гораздо меньше учеников имеют соответствующую квалификацию. Равенство возможностей соблюдается для предпочтительного ярлыка «допущенный» в отношении национальности (лилипут или бробдингнаг), если квалифицированные студенты имеют одинаковую вероятность быть принятыми независимо от того, являются ли они лилипутами или бробдингнегами.
Например, предположим, что 100 лилипутов и 100 бробдингнагцев подают заявки в университет Глаббдубдриб, и решения о приеме принимаются следующим образом:
Таблица 1. Кандидаты-лилипуты (90% соответствуют требованиям)
Квалифицированный | Неквалифицированный | |
---|---|---|
Допущенный | 45 | 3 |
Отклоненный | 45 | 7 |
Общий | 90 | 10 |
Процент зачисленных квалифицированных студентов: 45/90 = 50%. Процент отклоненных неквалифицированных студентов: 7/10 = 70%. Общий процент зачисленных студентов-лилипутов: (45+3)/100 = 48%. |
Таблица 2. Кандидаты из Бробдингнага (10% соответствуют требованиям):
Квалифицированный | Неквалифицированный | |
---|---|---|
Допущенный | 5 | 9 |
Отклоненный | 5 | 81 |
Общий | 10 | 90 |
Процент принятых квалифицированных студентов: 5/10 = 50% Процент отклоненных неквалифицированных студентов: 81/90 = 90%. Общий процент зачисленных студентов Бробдингнага: (5+9)/100 = 14%. |
Предыдущие примеры удовлетворяют равенству возможностей для приема квалифицированных студентов, поскольку квалифицированные лилипуты и бробдингнаги имеют 50% шансов на поступление.
Хотя равенство возможностей соблюдается, следующие два показателя справедливости не выполняются:
- демографический паритет : лилипуты и бробдингнаги принимаются в университет с разной скоростью; Принимаются 48% студентов-лилипутов, но только 14% студентов-бробдингнегов.
- уравненные шансы : хотя квалифицированные студенты-лилипуты и бробдингнаги имеют одинаковые шансы на поступление, дополнительное ограничение, заключающееся в том, что неквалифицированные лилипуты и бробдингнаги имеют одинаковые шансы быть отвергнутыми, не удовлетворяется. У неквалифицированных лилипутов процент отказов составляет 70%, тогда как у неквалифицированных бробдингнегов — 90%.
Дополнительную информацию см. в разделе «Справедливость: равенство возможностей в ускоренном курсе машинного обучения».
уравненные шансы
Метрика справедливости, позволяющая оценить, одинаково ли хорошо прогнозирует модель результаты для всех значений чувствительного атрибута как в отношении положительного , так и в отношении отрицательного класса, а не только одного или другого класса. Другими словами, как процент истинно положительных результатов , так и уровень ложноотрицательных результатов должны быть одинаковыми для всех групп.
Уравненные шансы связаны с равенством возможностей , которое фокусируется только на частоте ошибок для одного класса (положительных или отрицательных).
Например, предположим, что университет Глаббдубдриб принимает как лилипутов, так и бробдингнегов на строгую математическую программу. Средние школы лилипутов предлагают обширную программу занятий по математике, и подавляющее большинство учащихся имеют право на университетскую программу. В средних школах Бробдингнеджана вообще не проводятся занятия по математике, и в результате гораздо меньше учеников имеют соответствующую квалификацию. Уравненные шансы удовлетворяются при условии, что независимо от того, является ли заявитель лилипутом или бробдингнежцем, если он соответствует требованиям, он имеет одинаковую вероятность быть допущенным к программе, а если он не соответствует требованиям, он с одинаковой вероятностью будет отклонен.
Предположим, 100 лилипутов и 100 бробдингнагцев подают заявки в университет Глаббдубдриб, и решения о приеме принимаются следующим образом:
Таблица 3. Кандидаты-лилипуты (90% соответствуют требованиям)
Квалифицированный | Неквалифицированный | |
---|---|---|
Допущенный | 45 | 2 |
Отклоненный | 45 | 8 |
Общий | 90 | 10 |
Процент зачисленных квалифицированных студентов: 45/90 = 50%. Процент отклоненных неквалифицированных студентов: 8/10 = 80%. Общий процент зачисленных студентов-лилипутов: (45+2)/100 = 47%. |
Таблица 4. Кандидаты из Бробдингнага (10% соответствуют требованиям):
Квалифицированный | Неквалифицированный | |
---|---|---|
Допущенный | 5 | 18 |
Отклоненный | 5 | 72 |
Общий | 10 | 90 |
Процент принятых квалифицированных студентов: 5/10 = 50% Процент отклоненных неквалифицированных студентов: 72/90 = 80%. Общий процент зачисленных студентов Бробдингнега: (5+18)/100 = 23%. |
Уравненные шансы удовлетворяются, потому что квалифицированные студенты-лилипуты и бробдингнаги имеют 50% шанс быть зачисленными, а неквалифицированные лилипуты и бробдингнеги имеют 80% шанс быть отклоненными.
Уравненные шансы формально определены в «Равенстве возможностей в контролируемом обучении» следующим образом: «предиктор Ŷ удовлетворяет уравненным шансам в отношении защищенного атрибута A и результата Y, если Ŷ и A независимы, при условии, что Y».
оценивает
В основном используется как аббревиатура для оценок LLM . В более широком смысле, evals — это аббревиатура любой формы оценки .
оценка
Процесс измерения качества модели или сравнения различных моделей друг с другом.
Чтобы оценить модель контролируемого машинного обучения , вы обычно сравниваете ее с набором проверки и набором тестов . Оценка LLM обычно включает в себя более широкую оценку качества и безопасности.
Ф
Ф 1
«Сводная» метрика двоичной классификации , которая зависит как от точности , так и от полноты . Вот формула:
показатель справедливости
Математическое определение «справедливости», поддающееся измерению. Некоторые часто используемые показатели справедливости включают в себя:
Многие показатели справедливости являются взаимоисключающими; см. несовместимость показателей справедливости .
ложноотрицательный (ЛН)
Пример, в котором модель ошибочно предсказывает отрицательный класс . Например, модель предсказывает, что конкретное сообщение электронной почты не является спамом (негативный класс), но на самом деле это сообщение электронной почты является спамом .
ложноотрицательный показатель
Доля реальных положительных примеров, для которых модель ошибочно предсказала отрицательный класс. Следующая формула рассчитывает уровень ложноотрицательных результатов:
Дополнительные сведения см. в разделе «Пороговые значения и матрица путаницы» в ускоренном курсе машинного обучения.
ложноположительный результат (FP)
Пример, в котором модель ошибочно предсказывает положительный класс . Например, модель предсказывает, что конкретное сообщение электронной почты является спамом (положительный класс), но на самом деле это сообщение электронной почты не является спамом .
Дополнительные сведения см. в разделе «Пороговые значения и матрица путаницы» в ускоренном курсе машинного обучения.
уровень ложноположительных результатов (FPR)
Доля реальных отрицательных примеров, для которых модель ошибочно предсказала положительный класс. Следующая формула рассчитывает уровень ложноположительных результатов:
Частота ложноположительных результатов — это ось X на кривой ROC .
Дополнительную информацию см. в разделе «Классификация: ROC и AUC в ускоренном курсе машинного обучения».
важность функций
Синоним переменных важностей .
доля успехов
Метрика для оценки текста, сгенерированного моделью машинного обучения. Доля успехов — это количество «успешных» сгенерированных текстовых выходных данных, деленное на общее количество сгенерированных текстовых выходных данных. Например, если большая языковая модель сгенерировала 10 блоков кода, пять из которых оказались успешными, то доля успешных результатов составит 50%.
Хотя доля успехов широко полезна в статистике, в рамках машинного обучения этот показатель в первую очередь полезен для измерения проверяемых задач, таких как генерация кода или математические задачи.
Г
Джини примесь
Метрика, похожая на энтропию . Разделители используют значения, полученные либо из примеси Джини, либо из энтропии, для составления условий для деревьев решений классификации. Прирост информации происходит от энтропии. Не существует общепринятого эквивалентного термина для показателя, полученного из примеси Джини; однако этот безымянный показатель так же важен, как и получение информации.
Примесь Джини еще называют индексом Джини , или просто Джини .
ЧАС
потеря шарнира
Семейство функций потерь для классификации , предназначенное для поиска границы решения как можно дальше от каждого обучающего примера, тем самым максимизируя разницу между примерами и границей. KSVM используют шарнирные потери (или связанную с ними функцию, например, квадратичные шарнирные потери). Для бинарной классификации функция шарнирных потерь определяется следующим образом:
где y — истинная метка, либо -1, либо +1, а y’ — необработанный результат модели классификации :
Следовательно, график потери шарнира в зависимости от (y * y') выглядит следующим образом:
я
несовместимость показателей справедливости
Идея о том, что некоторые понятия справедливости несовместимы друг с другом и не могут быть удовлетворены одновременно. В результате не существует единого универсального показателя для количественной оценки справедливости, который можно было бы применить ко всем проблемам ОД.
Хотя это может показаться обескураживающим, несовместимость показателей справедливости не означает, что усилия по обеспечению справедливости бесплодны. Вместо этого предполагается, что справедливость должна определяться контекстуально для конкретной проблемы ОД с целью предотвращения вреда, специфичного для случаев ее использования.
См. «О (не)возможности справедливости» для более подробного обсуждения несовместимости показателей справедливости.
индивидуальная справедливость
Метрика справедливости, которая проверяет, классифицируются ли похожие люди одинаково. Например, Академия Бробдингнагяна может захотеть обеспечить индивидуальную справедливость, гарантируя, что два студента с одинаковыми оценками и результатами стандартизированных тестов имеют одинаковую вероятность поступления.
Обратите внимание, что индивидуальная справедливость полностью зависит от того, как вы определяете «сходство» (в данном случае оценки и результаты тестов), и вы можете рискнуть создать новые проблемы со справедливостью, если ваш показатель сходства упускает важную информацию (например, строгость учебной программы учащегося).
См. «Справедливость через осведомленность» для более подробного обсуждения индивидуальной справедливости.
получение информации
В лесах решений — разница между энтропией узла и взвешенной (по количеству примеров) суммой энтропии его дочерних узлов. Энтропия узла — это энтропия примеров в этом узле.
Например, рассмотрим следующие значения энтропии:
- энтропия родительского узла = 0,6
- энтропия одного дочернего узла с 16 соответствующими примерами = 0,2
- энтропия другого дочернего узла с 24 соответствующими примерами = 0,1
Таким образом, 40% примеров находятся в одном дочернем узле, а 60% — в другом дочернем узле. Поэтому:
- взвешенная сумма энтропии дочерних узлов = (0,4 * 0,2) + (0,6 * 0,1) = 0,14
Итак, информационный выигрыш составляет:
- Прирост информации = энтропия родительского узла - взвешенная сумма энтропии дочерних узлов
- прирост информации = 0,6 - 0,14 = 0,46
Большинство раскольников стремятся создать условия , которые максимизируют получение информации.
межэкспертное соглашение
Измерение того, как часто оценщики соглашаются при выполнении задачи. Если оценщики не согласны с этим, инструкции по выполнению заданий, возможно, придется улучшить. Также иногда называется соглашением между аннотаторами или надежностью между экспертами . См. также каппу Коэна , которая является одним из самых популярных показателей согласия между экспертами.
Дополнительные сведения см. в разделе Категориальные данные: распространенные проблемы ускоренного курса машинного обучения.
л
L 1 потеря
Функция потерь , которая вычисляет абсолютное значение разницы между фактическими значениями метки и значениями, прогнозируемыми моделью . Например, вот расчет потерь L 1 для партии из пяти примеров :
Фактическая стоимость примера | Прогнозируемая ценность модели | Абсолютное значение дельты |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 3 |
4 | 6 | 2 |
9 | 8 | 1 |
8 = потеря L 1 |
Потери L1 менее чувствительны к выбросам , чем потери L2 .
Средняя абсолютная ошибка — это средняя потеря L 1 на пример.
Дополнительную информацию см. в разделе «Линейная регрессия: потери в ускоренном курсе машинного обучения».
L 2 потеря
Функция потерь , которая вычисляет квадрат разницы между фактическими значениями метки и значениями, прогнозируемыми моделью . Например, вот расчет потерь L 2 для партии из пяти примеров :
Фактическая стоимость примера | Прогнозируемая ценность модели | Площадь дельты |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 9 |
4 | 6 | 4 |
9 | 8 | 1 |
16 = потеря L 2 |
Из-за возведения в квадрат потеря L2 усиливает влияние выбросов . То есть потеря L2 сильнее реагирует на плохие прогнозы, чем потеря L1 . Например, потеря L 1 для предыдущей партии будет равна 8, а не 16. Обратите внимание, что на один выброс приходится 9 из 16.
В регрессионных моделях в качестве функции потерь обычно используются потери L2 .
Среднеквадратическая ошибка — это средняя потеря L 2 на пример. Квадратные потери — это другое название потерь L2 .
Дополнительную информацию см. в разделе «Логистическая регрессия: потери и регуляризация в ускоренном курсе машинного обучения».
LLM оценки (оценки)
Набор метрик и тестов для оценки производительности больших языковых моделей (LLM). На высоком уровне оценки LLM:
- Помогите исследователям определить области, где LLM нуждается в улучшении.
- Полезны для сравнения различных LLM и определения лучшего LLM для конкретной задачи.
- Помогите гарантировать, что использование LLM безопасно и этически.
Дополнительные сведения см. в разделе «Большие языковые модели (LLM)» в ускоренном курсе машинного обучения.
потеря
Во время обучения модели с учителем — это показатель того, насколько далеко предсказание модели находится от ее метки .
Функция потерь вычисляет потери.
Дополнительную информацию см. в разделе «Линейная регрессия: потери в ускоренном курсе машинного обучения».
функция потерь
Во время обучения или тестирования — математическая функция, вычисляющая потери на серии примеров. Функция потерь возвращает меньшие потери для моделей, дающих хорошие прогнозы, чем для моделей, дающих плохие прогнозы.
Целью обучения обычно является минимизация потерь, которые возвращает функция потерь.
Существует множество различных видов функций потерь. Выберите соответствующую функцию потерь для модели, которую вы строите. Например:
- Потери L 2 (или среднеквадратическая ошибка ) — это функция потерь для линейной регрессии .
- Log Loss — это функция потерь для логистической регрессии .
М
Средняя абсолютная ошибка (MAE)
Средняя потеря на пример при использовании потерь L 1 . Рассчитайте среднюю абсолютную ошибку следующим образом:
- Рассчитайте потерю L 1 для партии.
- Разделите потерю L 1 на количество образцов в партии.
Например, рассмотрим расчет потерь L 1 для следующей партии из пяти примеров:
Фактическая стоимость примера | Прогнозируемая ценность модели | Убыток (разница между фактическим и прогнозируемым) |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 3 |
4 | 6 | 2 |
9 | 8 | 1 |
8 = потеря L 1 |
Итак, потеря L 1 равна 8, а количество примеров равно 5. Следовательно, средняя абсолютная ошибка равна:
Mean Absolute Error = L1 loss / Number of Examples Mean Absolute Error = 8/5 = 1.6
Сравните среднюю абсолютную ошибку со среднеквадратической ошибкой и среднеквадратической ошибкой .
средняя средняя точность при k (mAP@k)
Статистическое среднее всей средней точности при k баллах в наборе проверочных данных. Одним из вариантов использования средней точности при k является оценка качества рекомендаций, генерируемых системой рекомендаций .
Хотя фраза «среднее среднее» звучит избыточно, название показателя вполне подходящее. В конце концов, эта метрика находит среднее значение множественной средней точности при значениях k .
Среднеквадратическая ошибка (MSE)
Средняя потеря на пример при использовании потерь L 2 . Рассчитайте среднеквадратическую ошибку следующим образом:
- Рассчитайте потерю L 2 для партии.
- Разделите потерю L 2 на количество образцов в партии.
Например, рассмотрим потери в следующей партии из пяти примеров:
Фактическая стоимость | Прогноз модели | Потеря | Квадратная потеря |
---|---|---|---|
7 | 6 | 1 | 1 |
5 | 4 | 1 | 1 |
8 | 11 | 3 | 9 |
4 | 6 | 2 | 4 |
9 | 8 | 1 | 1 |
16 = потеря L 2 |
Следовательно, среднеквадратическая ошибка равна:
Mean Squared Error = L2 loss / Number of Examples Mean Squared Error = 16/5 = 3.2
Среднеквадратическая ошибка — популярный оптимизатор обучения, особенно для линейной регрессии .
Сравните среднеквадратическую ошибку со средней абсолютной ошибкой и среднеквадратичной ошибкой .
TensorFlow Playground использует среднеквадратическую ошибку для расчета значений потерь.
метрика
Статистика, которая вас волнует.
Цель — это показатель, который система машинного обучения пытается оптимизировать.
API метрик (tf.metrics)
API TensorFlow для оценки моделей. Например, tf.metrics.accuracy
определяет, как часто прогнозы модели соответствуют меткам.
минимаксные потери
Функция потерь для генеративно-состязательных сетей , основанная на перекрестной энтропии между распределением сгенерированных и реальных данных.
Минимаксные потери используются в первой статье для описания генеративно-состязательных сетей.
Дополнительную информацию см. в разделе «Функции потерь» в курсе «Генераторно-состязательные сети».
мощность модели
Сложность проблем, которые может изучить модель. Чем сложнее проблемы, которые может изучить модель, тем выше ее емкость. Емкость модели обычно увеличивается с увеличением количества параметров модели. Формальное определение емкости модели классификации см. в разделе «Измерение VC» .
Н
отрицательный класс
В бинарной классификации один класс называется положительным , а другой — отрицательным . Положительный класс — это вещь или событие, на которое тестируется модель, а отрицательный класс — это другая возможность. Например:
- Отрицательный класс медицинского теста может быть «не опухоль».
- Отрицательным классом в модели классификации электронной почты может быть «не спам».
Контраст с позитивным классом .
О
цель
Метрика , которую ваш алгоритм пытается оптимизировать.
целевая функция
Математическая формула или показатель , который призвана оптимизировать модель. Например, целевой функцией для линейной регрессии обычно является среднеквадратичная потеря . Следовательно, при обучении модели линейной регрессии цель обучения — минимизировать среднеквадратическую потерю.
В некоторых случаях целью является максимизация целевой функции. Например, если целевой функцией является точность, цель состоит в том, чтобы максимизировать точность.
См. также потерю .
П
пройти через k (pass@k)
Метрика для определения качества кода (например, Python), который генерирует большая языковая модель . Точнее говоря, проход по k говорит вам о вероятности того, что хотя бы один сгенерированный блок кода из k сгенерированных блоков кода пройдет все свои модульные тесты.
Большие языковые модели часто с трудом генерируют хороший код для решения сложных задач программирования. Инженеры-программисты адаптируются к этой проблеме, побуждая большую языковую модель генерировать несколько ( k ) решений для одной и той же проблемы. Затем инженеры-программисты тестируют каждое решение с помощью модульных тестов. Расчет прохода при k зависит от результатов модульных тестов:
- Если одно или несколько из этих решений проходят модульный тест, то LLM успешно справляется с задачей генерации кода.
- Если ни одно из решений не проходит модульный тест, то LLM не справляется с задачей генерации кода.
Формула прохода по k выглядит следующим образом:
\[\text{pass at k} = \frac{\text{total number of passes}} {\text{total number of challenges}}\]
В целом, более высокие значения k обеспечивают более высокую проходимость при k баллах; однако более высокие значения k требуют более крупных языковых моделей и ресурсов модульного тестирования.
производительность
Перегруженный термин со следующими значениями:
- Стандартное значение в разработке программного обеспечения. А именно: насколько быстро (или эффективно) работает эта программа?
- Значение машинного обучения. Здесь производительность отвечает на следующий вопрос: насколько правильна эта модель ? То есть, насколько хороши предсказания модели?
Значения переменных перестановки
Тип важности переменной , которая оценивает увеличение ошибки прогнозирования модели после перестановки значений признака. Важность переменной перестановки — это метрика, независимая от модели.
недоумение
Один из показателей того, насколько хорошо модель выполняет свою задачу. Например, предположим, что ваша задача — прочитать первые несколько букв слова, которое пользователь набирает на клавиатуре телефона, и предложить список возможных слов-дополнений. Недоумение P для этой задачи — это примерно количество предположений, которые вам нужно предложить, чтобы ваш список содержал фактическое слово, которое пытается ввести пользователь.
Растерянность связана с перекрестной энтропией следующим образом:
позитивный класс
Класс, для которого вы тестируете.
Например, положительным классом в модели рака может быть «опухоль». Положительным классом в модели классификации электронной почты может быть «спам».
Сравните с отрицательным классом .
PR AUC (площадь под кривой PR)
Площадь под интерполированной кривой точности-напоминаемости , полученной путем построения точек (напоминаемости, точности) для различных значений порога классификации .
точность
Метрика для моделей классификации , отвечающая на следующий вопрос:
Когда модель предсказала положительный класс , какой процент предсказаний оказался верным?
Вот формула:
где:
- истинно положительный результат означает, что модель правильно предсказала положительный класс.
- ложное срабатывание означает, что модель ошибочно предсказала положительный класс.
Например, предположим, что модель сделала 200 положительных прогнозов. Из этих 200 положительных предсказаний:
- 150 из них были настоящими положительными.
- 50 оказались ложноположительными.
В этом случае:
Сравните с точностью и отзывом .
Дополнительную информацию см. в разделе «Классификация: точность, полнота, прецизионность и связанные с ними показатели» в ускоренном курсе машинного обучения.
точность при k (precision@k)
Метрика для оценки ранжированного (упорядоченного) списка элементов. Точность в k определяет долю первых k элементов в этом списке, которые являются «релевантными». То есть:
\[\text{precision at k} = \frac{\text{relevant items in first k items of the list}} {\text{k}}\]
Значение k должно быть меньше или равно длине возвращаемого списка. Обратите внимание, что длина возвращаемого списка не является частью расчета.
Актуальность часто субъективна; Даже опытные оценщики человека часто не согласны с тем, какие предметы актуальны.
Сравните с:
Кривая точности
Кривая точности в зависимости от воспоминания на разных порогах классификации .
предвзятость прогнозирования
Значение, указывающее, насколько далеко друг от друга среднее показатели , от среднего значения метки в наборе данных.
Не путать с термином смещения в моделях машинного обучения или с предвзятостью в этике и справедливости .
прогнозирующая паритет
Метрика справедливости , которая проверяет, являются ли для данного классификатора точные показатели эквивалентны для рассматриваемых подгрупп.
Например, модель, которая прогнозирует принятие колледжа, удовлетворит прогнозирующую паритет для национальности, если его точность одинакова для лиллипутов и бробдингнагианцев.
Предсказательный паритет иногда также называется паритетом прогнозной скорости .
См. «Определения справедливости, объясненные» (раздел 3.2.1) для более подробного обсуждения прогнозной паритета.
Прогнозирующая скорость паритета
Другое название для прогнозирующего паритета .
Функция плотности вероятности
Функция, которая идентифицирует частоту образцов данных, имеющих именно определенное значение. Когда значения набора данных являются непрерывными числами с плавающей точкой, точные совпадения редко встречаются. Однако интеграция функции плотности вероятности от значения x
до значения y
дает ожидаемую частоту образцов данных между x
и y
.
Например, рассмотрим нормальное распределение, составляющее среднее значение 200 и стандартное отклонение 30. Чтобы определить ожидаемую частоту образцов данных, падающих в диапазоне 211,4 до 218,7, вы можете интегрировать функцию плотности вероятности для нормального распределения от 211,4 до 218,7.
Р
отзывать
Метрика для классификационных моделей , которая отвечает на следующий вопрос:
Когда наземная правда была положительным классом , какой процент прогнозов модель правильно идентифицировала как положительный класс?
Вот формула:
\[\text{Recall} = \frac{\text{true positives}} {\text{true positives} + \text{false negatives}} \]
где:
- Истинный положительный означает, что модель правильно предсказала положительный класс.
- Ложный отрицательный означает, что модель ошибочно предсказала отрицательный класс .
Например, предположим, что ваша модель сделала 200 прогнозов по примерам, для которых основная истина была положительным классом. Из этих 200 прогнозов:
- 180 были настоящими положительными.
- 20 были ложными негативами.
В этом случае:
\[\text{Recall} = \frac{\text{180}} {\text{180} + \text{20}} = 0.9 \]
См. Классификацию: Точность, отзыв, точность и связанные с ними метрики для получения дополнительной информации.
Напомним в K (Remeply@K)
Метрика для оценки систем, которые выводят рантин (упорядоченный) список элементов. Напомним, что в K определяет долю соответствующих элементов в первых k пунктах в этом списке из общего числа возвращаемых соответствующих элементов.
\[\text{recall at k} = \frac{\text{relevant items in first k items of the list}} {\text{total number of relevant items in the list}}\]
Контраст с точностью в k .
Кривая ROC (операционная характеристика приемника)
График истинной положительной скорости и ложной положительной скорости для различных порогов классификации в бинарной классификации.
Форма кривой ROC предполагает способность бинарной классификационной модели отделять положительные классы от негативных классов. Предположим, например, что модель бинарной классификации идеально отделяет все отрицательные классы от всех положительных классов:
Кривая ROC для предыдущей модели выглядит следующим образом:
Напротив, в следующих графиках иллюстрации значения необработанной логистической регрессии для ужасной модели, которая вообще не может отделить отрицательные классы от положительных классов:
Кривая ROC для этой модели выглядит следующим образом:
Между тем, в реальном мире большинство моделей бинарной классификации в некоторой степени разделяют положительные и отрицательные классы, но обычно не совсем идеально. Итак, типичная кривая ROC падает где -то между двумя крайностями:
Точка на кривой ROC, ближайшей к (0,0,1,0), теоретически идентифицирует идеальный порог классификации. Тем не менее, несколько других реальных проблем влияют на выбор идеального порога классификации. Например, возможно, ложные негативы вызывают гораздо большую боль, чем ложные позитивы.
Численная метрика, называемая AUC , суммирует кривую ROC в единое значение с плавающей точкой.
Средняя ошибка в квадрате корня (RMSE)
Квадратный корень средней квадратной ошибки .
Rouge (отзыв, ориентированная на отзыв, для расстояния оценки)
Семейство показателей, которые оценивают автоматическую суммирование и модели машинного перевода . Метрики Rouge определяют степень, в которой эталонный текст перекрывает текст сгенерированного модели ML. Каждый член семейных мер Rouge перекрывается по -разному. Более высокие оценки Rouge указывают на большее сходство между эталонным текстом и сгенерированным текстом, чем более низкие оценки Rouge.
Каждый член семьи Rouge обычно генерирует следующие показатели:
- Точность
- Отзывать
- F 1
Для получения подробной информации и примеров см.
Rouge-L
Член семьи Руж сосредоточился на продолжительности самой длинной общей последующей последовательности в эталонном тексте и сгенерированном тексту . Следующие формулы рассчитывают отзыв и точность для Rouge-L:
Затем вы можете использовать F 1 , чтобы свернуть отзыв Rouge-L и точность Rouge-L в одну метрику:
Rouge-L игнорирует любые новеньши в эталонном тексте и сгенерированный текст, поэтому самая длинная общая последовательность может пересекать несколько предложений. Когда ссылочный текст и сгенерированный текст включают несколько предложений, изменение Rouge-L, называемое Rouge-LSUM, как правило, является лучшей метрикой. Rouge-LSUM определяет самую длинную общую последующую последовательность для каждого предложения в отрывке, а затем вычисляет среднее значение для самых длинных общих подпоследований.
Rouge-n
Набор метрик в семействе Rouge , который сравнивает общие N-граммы определенного размера в эталонном тексте и сгенерированном тексту . Например:
- Rouge-1 измеряет количество общих токенов в эталонном тексте и сгенерированном тексту.
- Rouge-2 измеряет количество общих биграм (2 грамма) в эталонном тексте и сгенерированном тексту.
- Rouge-3 измеряет количество общих триграмм (3 грамма) в эталонном тексте и сгенерированном тексту.
Вы можете использовать следующие формулы для расчета Rouge-N Recall и Rouge-N. Точность для любого члена семьи Rouge-N:
Затем вы можете использовать F 1 , чтобы свернуть Rouge-n Remoad и Rouge-N. Точность в одну метрику:
Rouge-S.
Прощающая форма Rouge-n , которая позволяет сопоставлять скип-грамм . То есть Rouge-N считает только N-граммы , которые точно соответствуют, но Rouge-S также считает N-граммы, разделенные одним или несколькими словами. Например, рассмотрим следующее:
- Справочный текст : белые облака
- сгенерированный текст : белые вздымающиеся облака
При расчете Rouge-N 2-граммовые белые облака не соответствуют белым вздымающимся облакам . Однако при расчете Rouge-S белые облака соответствуют белым вздымающимся облакам .
R-Squared
Метрика регрессии , указывающая, сколько изменений в метке обусловлен индивидуальной функцией или набором функций. R-Squared-это значение от 0 до 1, которое вы можете интерпретировать следующим образом:
- R-квадрат 0 означает, что ни один из вариаций метки не связан с набором функций.
- R-квадрат 1 означает, что все изменения этикетки обусловлены набором функций.
- R-квадрат между 0 и 1 указывает на степень, в которой вариация метки может быть предсказан из определенной функции или набора функций. Например, R-квадрат 0,10 означает, что 10 процентов дисперсии на этикетке обусловлено набором функций, R-квадрат 0,20 означает, что 20 процентов связано с набором функций и т. Д.
R-Squared-это квадрат коэффициента корреляции Пирсона между значениями, которые предсказывали модель, и наземной истиной .
С
подсчет очков
Часть системы рекомендаций , которая обеспечивает значение или ранжирование для каждого элемента, созданного этапом генерации кандидатов .
мера сходства
В алгоритмах кластеризации метрика использовалась для определения одинаковых (насколько похожи) какие -либо два примера.
редкость
Количество элементов, установленных на ноль (или нулевое) в векторе или матрице, деленное на общее количество записей в этом векторе или матрице. Например, рассмотрим матрицу из 100 элементов, в которой 98 ячеек содержат ноль. Расчет разреженности заключается в следующем:
Чувство редактирования относится к разрешению вектора функций; Модель разреженности относится к разрешению весов модели.
квадратная потеря шарнира
Квадрат потери шарнира . Потеря в квадрате шарнира наказывает выбросы более резко, чем обычная потеря шарнира.
квадратная потеря
Синоним L 2 потери .
Т
Тестовая потеря
Метрика , представляющая потерю модели против испытательного набора . При создании модели вы обычно пытаетесь минимизировать потерю тестов. Это связано с тем, что низкая потеря тестов является более сильным сигналом качества, чем низкая потери тренировок или низкая потери проверки .
Большой разрыв между потерей теста и потерей обучения или потерей проверки иногда предполагает, что вам необходимо увеличить частоту регуляризации .
точность Top-K
Процент раз, когда «целевая метка» появляется в первых позициях k сгенерированных списков. Списки могут быть персонализированными рекомендациями или списком предметов, заказанных Softmax .
Точность Top-K также известна как точность в K.
токсичность
Степень, в которой контент является оскорбительным, угрожающим или оскорбительным. Многие модели машинного обучения могут идентифицировать и измерять токсичность. Большинство из этих моделей идентифицируют токсичность по нескольким параметрам, таким как уровень оскорбительного языка и уровень угрожающего языка.
Потеря обучения
Метрика , представляющая потерю модели во время конкретной учебной итерации. Например, предположим, что функция потери является средней квадратной ошибкой . Возможно, потери обучения (средняя квадратная ошибка) для 10 -й итерации составляет 2,2, а утрата обучения для 100 -й итерации составляет 1,9.
Кривая потерь определяет потерю обучения по сравнению с количеством итераций. Кривая потерь дает следующие намеки на обучение:
- Нисходящий наклон подразумевает, что модель улучшается.
- Вверх уклон подразумевает, что модель ухудшается.
- Плоский наклон подразумевает, что модель достигла сходимости .
Например, на следующей несколько идеализированной кривой потерь показывает:
- Крутой наклон вниз во время начальных итераций, что подразумевает быстрое улучшение модели.
- Постепенно сглаживающий (но все еще вниз) наклон до конца тренировок, что подразумевает продолжающееся улучшение модели в несколько более медленном темпе, чем во время начальных итераций.
- Плоский склон к концу тренировок, который предполагает сходимость.
Хотя убытка обучения важна, см. Также обобщение .
истинный отрицательный (TN)
Пример, в котором модель правильно предсказывает отрицательный класс . Например, модель делает, что конкретное сообщение электронной почты не является спамом , и это сообщение электронной почты на самом деле не спам .
истинный положительный (TP)
Пример, в котором модель правильно предсказывает положительный класс . Например, модель делает, что конкретным сообщением электронной почты является спам, и это сообщение электронной почты действительно является спамом.
Истинная положительная скорость (TPR)
Синоним для отзывов . То есть:
Истинная положительная скорость-ось Y в кривой ROC .
В
убытка валидации
Метрика , представляющая потерю модели при наборе проверки во время конкретной итерации обучения.
См. Также кривая обобщения .
переменные импорты
Набор результатов, которые указывают на относительную важность каждой функции для модели.
Например, рассмотрим дерево решений , которое оценивает цены на жилье. Предположим, что это дерево решений использует три функции: размер, возраст и стиль. Если набор переменных импортов для трех функций рассчитывается как {size = 5,8, возраст = 2,5, стиль = 4,7}, то размер более важен для дерева решений, чем возраст или стиль.
Существуют различные показатели важности переменной, которые могут информировать экспертов ML о различных аспектах моделей.
Вт
Вассерштейн потеря
Одна из функций потерь, обычно используемых в генеративных состязательных сетях , на основе расстояния грунта Земли между распределением сгенерированных данных и реальными данными.
,Эта страница содержит метрики Глоссарий термины. Чтобы просмотреть все термины глоссария, нажмите здесь .
А
точность
Количество правильных прогнозов классификации, разделенное на общее количество прогнозов. То есть:
Например, модель, которая сделала 40 правильных прогнозов и 10 неправильных прогнозов, будет иметь точность:
Бинарная классификация дает конкретные названия различным категориям правильных и неправильных прогнозов . Итак, формула точности бинарной классификации выглядит следующим образом:
где:
- TP — количество истинных положительных результатов (правильных прогнозов).
- TN — количество истинных негативов (правильных прогнозов).
- FP — количество ложных срабатываний (неверных прогнозов).
- FN — количество ложноотрицательных результатов (неверных прогнозов).
Сравните и сопоставьте точность с точностью и отзывом .
Дополнительную информацию см. в разделе «Классификация: точность, полнота, прецизионность и связанные с ними показатели» в ускоренном курсе машинного обучения.
область под кривой PR
См. PR AUC (область под кривой PR) .
область под кривой ROC
См. AUC (область под кривой ROC) .
AUC (Площадь под кривой ROC)
Число от 0,0 до 1,0, обозначающее способность модели бинарной классификации отделять положительные классы от отрицательных классов . Чем ближе AUC к 1,0, тем лучше способность модели отделять классы друг от друга.
Например, на следующем рисунке показана модель классификации , которая идеально отделяет положительные классы (зеленые овалы) от отрицательных классов (фиолетовые прямоугольники). Эта нереально идеальная модель имеет AUC 1,0:
И наоборот, на следующем рисунке показаны результаты для модели классификации , которая генерировала случайные результаты. Эта модель имеет AUC 0,5:
Да, предыдущая модель имеет AUC 0,5, а не 0,0.
Большинство моделей находятся где-то между двумя крайностями. Например, следующая модель несколько отделяет положительные значения от отрицательных и поэтому имеет AUC где-то между 0,5 и 1,0:
AUC игнорирует любые значения, установленные вами для порога классификации . Вместо этого AUC учитывает все возможные пороги классификации.
Дополнительную информацию см. в разделе «Классификация: ROC и AUC в ускоренном курсе машинного обучения».
средняя точность при k
Метрика для суммирования производительности модели по одной подсказке, которая генерирует ранжированные результаты, такую как пронумерованный список рекомендаций книг. Средняя точность в K - это, в общем, среднее значение точности при значениях k для каждого соответствующего результата. Следовательно, формула для средней точности в K составляет:
\[{\text{average precision at k}} = \frac{1}{n} \sum_{i=1}^n {\text{precision at k for each relevant item} } \]
где:
- \(n\) это количество соответствующих элементов в списке.
Сравните с отзывом в k .
Б
базовый уровень
Модель, используемая в качестве эталонной точки для сравнения того, насколько хорошо работает другая модель (как правило, более сложная). Например, модель логистической регрессии может служить хорошей базовой линией для глубокой модели .
Для конкретной проблемы базовая линия помогает разработчикам модели определить минимальную ожидаемую производительность, которую новая модель должна достичь для новой модели, чтобы быть полезной.
С
расходы
Синоним потери .
Контрфактивная справедливость
Метрика справедливости , которая проверяет, дает ли классификационная модель тот же результат для одного человека, что и для другого человека, который идентичен первым, за исключением одного или нескольких чувствительных атрибутов . Оценка классификационной модели для контрфактуальной справедливости является одним из методов всплывания потенциальных источников смещения в модели.
Смотрите любое из следующего для получения дополнительной информации:
- Справедливость: контрфактуальная справедливость в крушении машинного обучения.
- Когда миры сталкиваются: интеграция различных контрфактивных предположений в справедливость
перекрестная энтропия
Обобщение потери журнала для многоклассных задач классификации . Поперечная энтропия количественно определяет разницу между двумя распределениями вероятностей. См. Также недоумение .
совокупная функция распределения (CDF)
Функция, которая определяет частоту образцов менее или равной целевому значению. Например, рассмотрим нормальное распределение непрерывных значений. CDF говорит вам, что приблизительно 50% образцов должны быть меньше или равны среднему и что приблизительно 84% образцов должны быть меньше или равны одному стандартному отклонению выше среднего.
Д
демографический паритет
Метрика справедливости , которая удовлетворена, если результаты классификации модели не зависят от данного чувствительного атрибута .
Например, если как лиллипуты, так и бробдингнагианцы применяются в Университете Глюббдубдриба, демографический паритет достигается, если процент признанных лиллипутов такими же, как и процент брубдингнагианцев, независимо от того, является ли одна группа в среднем более квалифицированной, чем другая.
В отличие от выравниваемых шансов и равенства возможностей , что позволяет классификации приводит к агрегату, чтобы зависеть от чувствительных атрибутов, но не разрешают результаты классификации для определенных указанных меток истины , которые зависят от чувствительных атрибутов. См. «Атакующий дискриминацию с помощью умного машинного обучения» для визуализации, изучающей компромиссы при оптимизации для демографического паритета.
См. Справедливость: демографический паритет в крушении машинного обучения для получения дополнительной информации.
Э
Расстояние Земли (EMD)
Мера относительного сходства двух распределений . Чем нижний расстояние заземления, тем более похожими распределения.
Редактировать расстояние
Измерение того, насколько похожи две текстовые строки друг к другу. В машинном обучении редактирование расстояние полезно по следующим причинам:
- Редактировать расстояние легко вычислить.
- Редактировать расстояние может сравнить две строки, которые, как известно, похожи друг на друга.
- Редактировать расстояние может определить степень, в которой разные строки похожи на данную строку.
Есть несколько определений расстояния редактирования, каждое из которых использует различные строковые операции. См . Levenshtein Distance для примера.
Эмпирическая совокупная функция распределения (ECDF или EDF)
Совокупная функция распределения , основанная на эмпирических измерениях из реального набора данных. Значение функции в любой точке вдоль оси X представляет собой долю наблюдений в наборе данных, которые меньше или равны указанному значению.
энтропия
В теории информации описание того, насколько непредсказуемое распределение вероятностей. В качестве альтернативы, энтропия также определяется как много информации содержит каждый пример . Распределение имеет максимально возможную энтропию, когда все значения случайной величины одинаково вероятно.
Энтропия набора с двумя возможными значениями «0» и «1» (например, метки в задаче бинарной классификации ) имеет следующую формулу:
H = -p log p -q log q = -p log p -(1 -p) * log (1 -p)
где:
- H - энтропия.
- P - доля «1» примеров.
- Q - это часть примеров «0». Обратите внимание, что q = (1 - p)
- Журнал , как правило, журнал 2 . В этом случае блок энтропии немного.
Например, предположим, следующее:
- 100 примеров содержат значение "1"
- 300 примеров содержат значение "0"
Поэтому значение энтропии:
- P = 0,25
- Q = 0,75
- H = (-0,25) Log 2 (0,25) - (0,75) log 2 (0,75) = 0,81 бита на пример
Набор, который идеально сбалансирован (например, 200 "0" S и 200 "1" S), будет иметь энтропию 1,0 бит за пример. По мере того, как набор становится более несбалансированным , его энтропия движется к 0,0.
В деревьях решений энтропия помогает сформулировать прирост информации , чтобы помочь разветвителю выбрать условия во время роста дерева решений классификации.
Сравните энтропию с:
- Джини нечистота
- Функция потери поперечной энтропии
Энтропия часто называют энтропией Шеннона .
См. Точный сплиттер для бинарной классификации с численными особенностями в курсе «Форест принятия решений» для получения дополнительной информации.
Равенство возможностей
Справедливая метрика , чтобы оценить, является ли модель прогнозировать желаемый результат одинаково хорошо для всех значений чувствительного атрибута . Другими словами, если желательным результатом для модели является положительный класс , целью было бы, чтобы истинная положительная скорость была одинаковой для всех групп.
Равенство возможностей связано с выровненными шансами , что требует, чтобы как истинные положительные показатели, так и ложные положительные показатели одинаковы для всех групп.
Предположим, что Университет Глюббдубдриба принимает как лиллипутов, так и бробдингнагианцев в строгой математической программе. Средние школы Lilliputians предлагают надежную учебную программу по математике, а подавляющее большинство учащихся имеют право на университетскую программу. Средние школы Brobdingnagians вообще не предлагают занятия по математике, и в результате гораздо меньше их учеников квалифицированы. Равенство возможностей удовлетворено предпочтительным ярлыком «принятого» в отношении национальности (лиллипутиан или бробдингнагиана), если квалифицированные студенты в равной степени могут быть приняты, независимо от того, являются ли они лиллипутами или бробдингнагианом.
Например, предположим, что 100 лиллипутов и 100 бробнагианцев применяются в Университете Глюббдубдриба, а решения о приеме принимаются следующим образом:
Таблица 1. Заявители лиллипутов (90% квалифицированы)
Квалифицированный | Неквалифицированный | |
---|---|---|
Допущенный | 45 | 3 |
Отклоненный | 45 | 7 |
Общий | 90 | 10 |
Процент квалифицированных студентов признался: 45/90 = 50% Процент неквалифицированных студентов отклонил: 7/10 = 70% Общий процент лиллипутских студентов признался: (45+3)/100 = 48% |
Таблица 2. Бробдингнагианские кандидаты (10% квалифицированы):
Квалифицированный | Неквалифицированный | |
---|---|---|
Допущенный | 5 | 9 |
Отклоненный | 5 | 81 |
Общий | 10 | 90 |
Процент квалифицированных студентов признался: 5/10 = 50% Процент неквалифицированных студентов отклонил: 81/90 = 90% Общий процент студентов бробдингнагиана признался: (5+9)/100 = 14% |
Предыдущие примеры удовлетворяют равенству возможностей для принятия квалифицированных студентов, потому что квалифицированные лилипуты и бробдингнагианцы имеют 50% шанс быть принятым.
Хотя равенство возможностей удовлетворено, следующие два показателя справедливости не удовлетворены:
- Демографический паритет : лиллипуты и бробдингнагианцы поступят в университет по -разному; 48% студентов лиллипутов допускаются, но допускаются только 14% студентов -бробдингнагианских студентов.
- Уравненные шансы : в то время как квалифицированные лиллипутские и бробдингнагианские студенты имеют одинаковую вероятность того, что они придятся, дополнительное ограничение, что у неквалифицированных лиллипутов и бробдингнагианцев есть одинаковые шансы быть отклоненными, не выполняется. Несквалифицированные лилипуты имеют 70% отклонений, в то время как у неквалифицированных бробдингнагианцев 90% отклонений.
См. Справедливость: равенство возможностей в курсе по сбою машинного обучения для получения дополнительной информации.
Уравненные шансы
Справедливая метрика, чтобы оценить, является ли модель прогнозировать результаты одинаково хорошо для всех значений чувствительного атрибута как к положительному классу , так и отрицательному классу - не только один класс или другой исключительно. Другими словами, как истинная положительная скорость , так и ложная отрицательная скорость должны быть одинаковыми для всех групп.
Выравниваемые шансы связаны с равенством возможностей , что фокусируется только на частоте ошибок для одного класса (положительный или отрицательный).
Например, предположим, что Университет Глюббдубдриба признает как лиллипутов, так и бробдингнагианцев в строгую математическую программу. Средние школы Lilliputians предлагают надежную учебную программу по математике, а подавляющее большинство учащихся имеют право на университетскую программу. Средние школы Brobdingnagians вообще не предлагают занятия по математике, и в результате гораздо меньше их учеников квалифицированы. Уравненные шансы удовлетворяются при условии, что независимо от того, является ли заявитель лилипутом или бробдингнагианом, если они квалифицированы, они в равной степени могут быть приняты в программу, и если они не имеют квалификации, они одинаково могут быть отклонены.
Предположим, что 100 лилипутов и 100 бробнагианцев применяются в Университете Глюббдубдриба, а решения о приеме принимаются следующим образом:
Таблица 3. Заявители лиллипутов (90% квалифицированы)
Квалифицированный | Неквалифицированный | |
---|---|---|
Допущенный | 45 | 2 |
Отклоненный | 45 | 8 |
Общий | 90 | 10 |
Процент квалифицированных студентов признался: 45/90 = 50% Процент неквалифицированных студентов отклонил: 8/10 = 80% Общий процент студентов лиллипутов признал: (45+2)/100 = 47% |
Таблица 4. Бробдингнагианские кандидаты (10% квалифицированы):
Квалифицированный | Неквалифицированный | |
---|---|---|
Допущенный | 5 | 18 |
Отклоненный | 5 | 72 |
Общий | 10 | 90 |
Процент квалифицированных студентов признался: 5/10 = 50% Процент неквалифицированных студентов отклонил: 72/90 = 80% Общий процент студентов бробдингнагиана признался: (5+18)/100 = 23% |
Уравновешенные шансы удовлетворяются, потому что квалифицированные лилипутские и бробдингианские студенты имеют 50% вероятность того, что у лиллипутов и бробдингнагиана есть неквалифицированные лилипутианские и бробдингнагианские шансы на то, чтобы быть отклоненным.
Выравниваемые шансы формально определяются в «равенстве возможностей в контролируемом обучении» следующим образом: «Предсказатель ŷ удовлетворяет выравниваемым шансам в отношении защищенного атрибута А и результата y, если ŷ и a являются независимыми, условными на Y.»
эвал
В основном используется в качестве аббревиатуры для оценки LLM . В более широком смысле, Evals является аббревиатурой для любой формы оценки .
оценка
Процесс измерения качества модели или сравнения различных моделей друг с другом.
Чтобы оценить модель контролируемого машинного обучения , вы обычно судите ее по набору валидации и набора тестирования . Оценка LLM обычно включает в себя более широкие оценки качества и безопасности.
Ф
F 1
Бинарная классификационная метрика «раската», которая опирается как на точность , так и на отзыв . Вот формула:
Справедливость метрика
Математическое определение «справедливости», которое измеримо. Некоторые часто используемые показатели справедливости включают:
Многие показатели справедливости являются взаимоисключающими; См. Несовместимость показателей справедливости .
ложноотрицательный (ЛН)
Пример, в котором модель ошибочно предсказывает отрицательный класс . Например, модель предсказывает, что конкретное сообщение электронной почты не является спамом (негативный класс), но на самом деле это сообщение электронной почты является спамом .
ложноотрицательный показатель
Доля фактических положительных примеров, для которых модель ошибочно предсказывала отрицательный класс. Следующая формула вычисляет ложную отрицательную скорость:
Дополнительные сведения см. в разделе «Пороговые значения и матрица путаницы» в ускоренном курсе машинного обучения.
ложноположительный результат (FP)
Пример, в котором модель ошибочно предсказывает положительный класс . Например, модель предсказывает, что конкретное сообщение электронной почты является спамом (положительный класс), но на самом деле это сообщение электронной почты не является спамом .
Дополнительные сведения см. в разделе «Пороговые значения и матрица путаницы» в ускоренном курсе машинного обучения.
уровень ложноположительных результатов (FPR)
Доля реальных отрицательных примеров, для которых модель ошибочно предсказала положительный класс. Следующая формула рассчитывает уровень ложноположительных результатов:
Частота ложноположительных результатов — это ось X на кривой ROC .
Дополнительную информацию см. в разделе «Классификация: ROC и AUC в ускоренном курсе машинного обучения».
Функция импорта
Синоним для переменных импортов .
доля успехов
Метрика для оценки текста сгенерированного модели ML. Доля успехов - это количество «успешных» сгенерированных текстовых выходов, деленных на общее количество сгенерированных текстовых выходов. For example, if a large language model generated 10 blocks of code, five of which were successful, then the fraction of successes would be 50%.
Although fraction of successes is broadly useful throughout statistics, within ML, this metric is primarily useful for measuring verifiable tasks like code generation or math problems.
Г
gini impurity
A metric similar to entropy . Splitters use values derived from either gini impurity or entropy to compose conditions for classification decision trees . Information gain is derived from entropy. There is no universally accepted equivalent term for the metric derived from gini impurity; however, this unnamed metric is just as important as information gain.
Gini impurity is also called gini index , or simply gini .
ЧАС
hinge loss
A family of loss functions for classification designed to find the decision boundary as distant as possible from each training example, thus maximizing the margin between examples and the boundary. KSVMs use hinge loss (or a related function, such as squared hinge loss). For binary classification, the hinge loss function is defined as follows:
where y is the true label, either -1 or +1, and y' is the raw output of the classification model :
Consequently, a plot of hinge loss versus (y * y') looks as follows:
я
incompatibility of fairness metrics
The idea that some notions of fairness are mutually incompatible and cannot be satisfied simultaneously. As a result, there is no single universal metric for quantifying fairness that can be applied to all ML problems.
While this may seem discouraging, incompatibility of fairness metrics doesn't imply that fairness efforts are fruitless. Instead, it suggests that fairness must be defined contextually for a given ML problem, with the goal of preventing harms specific to its use cases.
See "On the (im)possibility of fairness" for a more detailed discussion of the incompatibility of fairness metrics.
individual fairness
A fairness metric that checks whether similar individuals are classified similarly. For example, Brobdingnagian Academy might want to satisfy individual fairness by ensuring that two students with identical grades and standardized test scores are equally likely to gain admission.
Note that individual fairness relies entirely on how you define "similarity" (in this case, grades and test scores), and you can run the risk of introducing new fairness problems if your similarity metric misses important information (such as the rigor of a student's curriculum).
See "Fairness Through Awareness" for a more detailed discussion of individual fairness.
information gain
In decision forests , the difference between a node's entropy and the weighted (by number of examples) sum of the entropy of its children nodes. A node's entropy is the entropy of the examples in that node.
For example, consider the following entropy values:
- entropy of parent node = 0.6
- entropy of one child node with 16 relevant examples = 0.2
- entropy of another child node with 24 relevant examples = 0.1
So 40% of the examples are in one child node and 60% are in the other child node. Поэтому:
- weighted entropy sum of child nodes = (0.4 * 0.2) + (0.6 * 0.1) = 0.14
So, the information gain is:
- information gain = entropy of parent node - weighted entropy sum of child nodes
- information gain = 0.6 - 0.14 = 0.46
Most splitters seek to create conditions that maximize information gain.
inter-rater agreement
A measurement of how often human raters agree when doing a task. If raters disagree, the task instructions may need to be improved. Also sometimes called inter-annotator agreement or inter-rater reliability . See also Cohen's kappa , which is one of the most popular inter-rater agreement measurements.
See Categorical data: Common issues in Machine Learning Crash Course for more information.
л
L 1 потеря
Функция потери , которая вычисляет абсолютное значение разницы между фактическими значениями метки и значениями, которые предсказывает модель . Например, вот расчет потери L 1 для партии из пяти примеров :
Фактическое значение примера | Прогнозируемое значение модели | Абсолютное значение дельты |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 3 |
4 | 6 | 2 |
9 | 8 | 1 |
8 = L 1 потеря |
L 1 Потеря менее чувствительна к выбросам , чем потеря L 2 .
The Mean Absolute Error is the average L 1 loss per example.
См. Линейную регрессию: курс потерь в машинном обучении для получения дополнительной информации.
L 2 потеря
Функция потери , которая вычисляет квадрат разницы между фактическими значениями метки и значениями, которые предсказывает модель . Например, вот расчет потери L 2 для партии из пяти примеров :
Фактическое значение примера | Прогнозируемое значение модели | Квадрат Дельта |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 9 |
4 | 6 | 4 |
9 | 8 | 1 |
16 = L 2 потеря |
Из -за квадрата потери L 2 усиливают влияние выбросов . То есть потеря L 2 реагирует более сильно на плохие прогнозы, чем потеря L 1 . Например, потеря L 1 для предыдущей партии составит 8, а не 16. Обратите внимание, что один выброс учитывает 9 из 16.
Регрессионные модели обычно используют потерю L 2 в качестве функции потери.
Средняя квадратная ошибка - это средняя потеря L 2 за пример. Потери квадрата - это еще одно название для потери L 2 .
См. Логистическая регрессия: потеря и регуляризация в курсе сбоя машинного обучения для получения дополнительной информации.
LLM evaluations (evals)
A set of metrics and benchmarks for assessing the performance of large language models (LLMs). At a high level, LLM evaluations:
- Help researchers identify areas where LLMs need improvement.
- Are useful in comparing different LLMs and identifying the best LLM for a particular task.
- Help ensure that LLMs are safe and ethical to use.
See Large language models (LLMs) in Machine Learning Crash Course for more information.
потеря
Во время обучения контролируемой модели мера того, насколько далеко прогнозирование модели от его ярлыка .
Функция потери вычисляет потерю.
См. Линейную регрессию: курс потерь в машинном обучении для получения дополнительной информации.
функция потерь
Во время обучения или тестирования математическая функция, которая вычисляет потерю на партии примеров. Функция потери возвращает более низкую потерю для моделей, которые делают хорошие прогнозы, чем для моделей, которые делают плохие прогнозы.
Цель обучения, как правило, состоит в том, чтобы минимизировать потери, которую возвращает функция потери.
Существует много различных видов потерь. Выберите соответствующую функцию потерь для той модели, которую вы строите. Например:
- L 2 Потеря (или средняя квадратная ошибка ) является функцией потери для линейной регрессии .
- Потеря журнала - это функция потери для логистической регрессии .
М
Mean Absolute Error (MAE)
The average loss per example when L 1 loss is used. Calculate Mean Absolute Error as follows:
- Calculate the L 1 loss for a batch.
- Divide the L 1 loss by the number of examples in the batch.
For example, consider the calculation of L 1 loss on the following batch of five examples:
Фактическое значение примера | Прогнозируемое значение модели | Loss (difference between actual and predicted) |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 3 |
4 | 6 | 2 |
9 | 8 | 1 |
8 = L 1 потеря |
So, L 1 loss is 8 and the number of examples is 5. Therefore, the Mean Absolute Error is:
Mean Absolute Error = L1 loss / Number of Examples Mean Absolute Error = 8/5 = 1.6
Contrast Mean Absolute Error with Mean Squared Error and Root Mean Squared Error .
mean average precision at k (mAP@k)
The statistical mean of all average precision at k scores across a validation dataset. One use of mean average precision at k is to judge the quality of recommendations generated by a recommendation system .
Although the phrase "mean average" sounds redundant, the name of the metric is appropriate. After all, this metric finds the mean of multiple average precision at k values.
Mean Squared Error (MSE)
The average loss per example when L 2 loss is used. Calculate Mean Squared Error as follows:
- Calculate the L 2 loss for a batch.
- Divide the L 2 loss by the number of examples in the batch.
For example, consider the loss on the following batch of five examples:
Actual value | Model's prediction | Потеря | Squared loss |
---|---|---|---|
7 | 6 | 1 | 1 |
5 | 4 | 1 | 1 |
8 | 11 | 3 | 9 |
4 | 6 | 2 | 4 |
9 | 8 | 1 | 1 |
16 = L 2 потеря |
Therefore, the Mean Squared Error is:
Mean Squared Error = L2 loss / Number of Examples Mean Squared Error = 16/5 = 3.2
Mean Squared Error is a popular training optimizer , particularly for linear regression .
Contrast Mean Squared Error with Mean Absolute Error and Root Mean Squared Error .
TensorFlow Playground uses Mean Squared Error to calculate loss values.
metric
A statistic that you care about.
An objective is a metric that a machine learning system tries to optimize.
Metrics API (tf.metrics)
A TensorFlow API for evaluating models. For example, tf.metrics.accuracy
determines how often a model's predictions match labels.
minimax loss
A loss function for generative adversarial networks , based on the cross-entropy between the distribution of generated data and real data.
Minimax loss is used in the first paper to describe generative adversarial networks.
See Loss Functions in the Generative Adversarial Networks course for more information.
model capacity
The complexity of problems that a model can learn. The more complex the problems that a model can learn, the higher the model's capacity. A model's capacity typically increases with the number of model parameters. For a formal definition of classification model capacity, see VC dimension .
Не
отрицательный класс
В бинарной классификации один класс называется положительным , а другой называется отрицательным . Положительный класс - это то, что модель тестирует, а отрицательный класс - другая возможность. Например:
- The negative class in a medical test might be "not tumor."
- Отрицательный класс в модели классификации электронной почты может быть «не спам».
Контраст с положительным классом .
О
цель
A metric that your algorithm is trying to optimize.
целевая функция
The mathematical formula or metric that a model aims to optimize. For example, the objective function for linear regression is usually Mean Squared Loss . Therefore, when training a linear regression model, training aims to minimize Mean Squared Loss.
In some cases, the goal is to maximize the objective function. For example, if the objective function is accuracy, the goal is to maximize accuracy.
See also loss .
П
pass at k (pass@k)
A metric to determine the quality of code (for example, Python) that a large language model generates. More specifically, pass at k tells you the likelihood that at least one generated block of code out of k generated blocks of code will pass all of its unit tests.
Large language models often struggle to generate good code for complex programming problems. Software engineers adapt to this problem by prompting the large language model to generate multiple ( k ) solutions for the same problem. Then, software engineers test each of the solutions against unit tests. The calculation of pass at k depends on the outcome of the unit tests:
- If one or more of those solutions pass the unit test, then the LLM Passes that code generation challenge.
- If none of the solutions pass the unit test, then the LLM Fails that code generation challenge.
The formula for pass at k is as follows:
\[\text{pass at k} = \frac{\text{total number of passes}} {\text{total number of challenges}}\]
In general, higher values of k produce higher pass at k scores; however, higher values of k require more large language model and unit testing resources.
производительность
Overloaded term with the following meanings:
- The standard meaning within software engineering. Namely: How fast (or efficiently) does this piece of software run?
- The meaning within machine learning. Here, performance answers the following question: How correct is this model ? That is, how good are the model's predictions?
permutation variable importances
A type of variable importance that evaluates the increase in the prediction error of a model after permuting the feature's values. Permutation variable importance is a model-independent metric.
недоумение
One measure of how well a model is accomplishing its task. For example, suppose your task is to read the first few letters of a word a user is typing on a phone keyboard, and to offer a list of possible completion words. Perplexity, P, for this task is approximately the number of guesses you need to offer in order for your list to contain the actual word the user is trying to type.
Perplexity is related to cross-entropy as follows:
positive class
The class you are testing for.
For example, the positive class in a cancer model might be "tumor." The positive class in an email classification model might be "spam."
Contrast with negative class .
PR AUC (area under the PR curve)
Area under the interpolated precision-recall curve , obtained by plotting (recall, precision) points for different values of the classification threshold .
точность
A metric for classification models that answers the following question:
When the model predicted the positive class , what percentage of the predictions were correct?
Here is the formula:
где:
- true positive means the model correctly predicted the positive class.
- false positive means the model mistakenly predicted the positive class.
For example, suppose a model made 200 positive predictions. Of these 200 positive predictions:
- 150 were true positives.
- 50 were false positives.
В этом случае:
Contrast with accuracy and recall .
Дополнительную информацию см. в разделе «Классификация: точность, полнота, прецизионность и связанные с ними показатели» в ускоренном курсе машинного обучения.
precision at k (precision@k)
A metric for evaluating a ranked (ordered) list of items. Precision at k identifies the fraction of the first k items in that list that are "relevant." То есть:
\[\text{precision at k} = \frac{\text{relevant items in first k items of the list}} {\text{k}}\]
The value of k must be less than or equal to the length of the returned list. Note that the length of the returned list is not part of the calculation.
Relevance is often subjective; even expert human evaluators often disagree on which items are relevant.
Compare with:
precision-recall curve
A curve of precision versus recall at different classification thresholds .
prediction bias
A value indicating how far apart the average of predictions is from the average of labels in the dataset.
Not to be confused with the bias term in machine learning models or with bias in ethics and fairness .
predictive parity
A fairness metric that checks whether, for a given classifier, the precision rates are equivalent for subgroups under consideration.
For example, a model that predicts college acceptance would satisfy predictive parity for nationality if its precision rate is the same for Lilliputians and Brobdingnagians.
Predictive parity is sometime also called predictive rate parity .
See "Fairness Definitions Explained" (section 3.2.1) for a more detailed discussion of predictive parity.
predictive rate parity
Another name for predictive parity .
probability density function
A function that identifies the frequency of data samples having exactly a particular value. When a dataset's values are continuous floating-point numbers, exact matches rarely occur. However, integrating a probability density function from value x
to value y
yields the expected frequency of data samples between x
and y
.
For example, consider a normal distribution having a mean of 200 and a standard deviation of 30. To determine the expected frequency of data samples falling within the range 211.4 to 218.7, you can integrate the probability density function for a normal distribution from 211.4 to 218.7.
Р
отзывать
A metric for classification models that answers the following question:
When ground truth was the positive class , what percentage of predictions did the model correctly identify as the positive class?
Here is the formula:
\[\text{Recall} = \frac{\text{true positives}} {\text{true positives} + \text{false negatives}} \]
где:
- true positive means the model correctly predicted the positive class.
- false negative means that the model mistakenly predicted the negative class .
For instance, suppose your model made 200 predictions on examples for which ground truth was the positive class. Of these 200 predictions:
- 180 were true positives.
- 20 were false negatives.
В этом случае:
\[\text{Recall} = \frac{\text{180}} {\text{180} + \text{20}} = 0.9 \]
See Classification: Accuracy, recall, precision and related metrics for more information.
recall at k (recall@k)
A metric for evaluating systems that output a ranked (ordered) list of items. Recall at k identifies the fraction of relevant items in the first k items in that list out of the total number of relevant items returned.
\[\text{recall at k} = \frac{\text{relevant items in first k items of the list}} {\text{total number of relevant items in the list}}\]
Contrast with precision at k .
ROC (receiver operating characteristic) Curve
A graph of true positive rate versus false positive rate for different classification thresholds in binary classification.
The shape of an ROC curve suggests a binary classification model's ability to separate positive classes from negative classes. Suppose, for example, that a binary classification model perfectly separates all the negative classes from all the positive classes:
The ROC curve for the preceding model looks as follows:
In contrast, the following illustration graphs the raw logistic regression values for a terrible model that can't separate negative classes from positive classes at all:
The ROC curve for this model looks as follows:
Meanwhile, back in the real world, most binary classification models separate positive and negative classes to some degree, but usually not perfectly. So, a typical ROC curve falls somewhere between the two extremes:
The point on an ROC curve closest to (0.0,1.0) theoretically identifies the ideal classification threshold. However, several other real-world issues influence the selection of the ideal classification threshold. For example, perhaps false negatives cause far more pain than false positives.
A numerical metric called AUC summarizes the ROC curve into a single floating-point value.
Root Mean Squared Error (RMSE)
The square root of the Mean Squared Error .
ROUGE (Recall-Oriented Understudy for Gisting Evaluation)
A family of metrics that evaluate automatic summarization and machine translation models. ROUGE metrics determine the degree to which a reference text overlaps an ML model's generated text . Each member of the ROUGE family measures overlap in a different way. Higher ROUGE scores indicate more similarity between the reference text and generated text than lower ROUGE scores.
Each ROUGE family member typically generates the following metrics:
- Точность
- Отзывать
- F 1
For details and examples, see:
ROUGE-L
A member of the ROUGE family focused on the length of the longest common subsequence in the reference text and generated text . The following formulas calculate recall and precision for ROUGE-L:
You can then use F 1 to roll up ROUGE-L recall and ROUGE-L precision into a single metric:
ROUGE-L ignores any newlines in the reference text and generated text, so the longest common subsequence could cross multiple sentences. When the reference text and generated text involve multiple sentences, a variation of ROUGE-L called ROUGE-Lsum is generally a better metric. ROUGE-Lsum determines the longest common subsequence for each sentence in a passage and then calculates the mean of those longest common subsequences.
ROUGE-N
A set of metrics within the ROUGE family that compares the shared N-grams of a certain size in the reference text and generated text . Например:
- ROUGE-1 measures the number of shared tokens in the reference text and generated text.
- ROUGE-2 measures the number of shared bigrams (2-grams) in the reference text and generated text.
- ROUGE-3 measures the number of shared trigrams (3-grams) in the reference text and generated text.
You can use the following formulas to calculate ROUGE-N recall and ROUGE-N precision for any member of the ROUGE-N family:
You can then use F 1 to roll up ROUGE-N recall and ROUGE-N precision into a single metric:
ROUGE-S
A forgiving form of ROUGE-N that enables skip-gram matching. That is, ROUGE-N only counts N-grams that match exactly , but ROUGE-S also counts N-grams separated by one or more words. For example, consider the following:
- reference text : White clouds
- generated text : White billowing clouds
When calculating ROUGE-N, the 2-gram, White clouds doesn't match White billowing clouds . However, when calculating ROUGE-S, White clouds does match White billowing clouds .
R-squared
A regression metric indicating how much variation in a label is due to an individual feature or to a feature set. R-squared is a value between 0 and 1, which you can interpret as follows:
- An R-squared of 0 means that none of a label's variation is due to the feature set.
- An R-squared of 1 means that all of a label's variation is due to the feature set.
- An R-squared between 0 and 1 indicates the extent to which the label's variation can be predicted from a particular feature or the feature set. For example, an R-squared of 0.10 means that 10 percent of the variance in the label is due to the feature set, an R-squared of 0.20 means that 20 percent is due to the feature set, and so on.
R-squared is the square of the Pearson correlation coefficient between the values that a model predicted and ground truth .
С
подсчет очков
The part of a recommendation system that provides a value or ranking for each item produced by the candidate generation phase.
similarity measure
In clustering algorithms, the metric used to determine how alike (how similar) any two examples are.
sparsity
The number of elements set to zero (or null) in a vector or matrix divided by the total number of entries in that vector or matrix. For example, consider a 100-element matrix in which 98 cells contain zero. The calculation of sparsity is as follows:
Feature sparsity refers to the sparsity of a feature vector; model sparsity refers to the sparsity of the model weights.
squared hinge loss
The square of the hinge loss . Squared hinge loss penalizes outliers more harshly than regular hinge loss.
squared loss
Synonym for L 2 loss .
Т
Тестовая потеря
A metric representing a model's loss against the test set . When building a model , you typically try to minimize test loss. That's because a low test loss is a stronger quality signal than a low training loss or low validation loss .
A large gap between test loss and training loss or validation loss sometimes suggests that you need to increase the regularization rate .
top-k accuracy
The percentage of times that a "target label" appears within the first k positions of generated lists. The lists could be personalized recommendations or a list of items ordered by softmax .
Top-k accuracy is also known as accuracy at k .
токсичность
The degree to which content is abusive, threatening, or offensive. Many machine learning models can identify and measure toxicity. Most of these models identify toxicity along multiple parameters, such as the level of abusive language and the level of threatening language.
Потеря обучения
A metric representing a model's loss during a particular training iteration. For example, suppose the loss function is Mean Squared Error . Perhaps the training loss (the Mean Squared Error) for the 10th iteration is 2.2, and the training loss for the 100th iteration is 1.9.
A loss curve plots training loss versus the number of iterations. A loss curve provides the following hints about training:
- A downward slope implies that the model is improving.
- An upward slope implies that the model is getting worse.
- A flat slope implies that the model has reached convergence .
For example, the following somewhat idealized loss curve shows:
- A steep downward slope during the initial iterations, which implies rapid model improvement.
- A gradually flattening (but still downward) slope until close to the end of training, which implies continued model improvement at a somewhat slower pace then during the initial iterations.
- A flat slope towards the end of training, which suggests convergence.
Although training loss is important, see also generalization .
true negative (TN)
An example in which the model correctly predicts the negative class . For example, the model infers that a particular email message is not spam , and that email message really is not spam .
true positive (TP)
An example in which the model correctly predicts the positive class . For example, the model infers that a particular email message is spam, and that email message really is spam.
true positive rate (TPR)
Synonym for recall . То есть:
True positive rate is the y-axis in an ROC curve .
В
убытка валидации
A metric representing a model's loss on the validation set during a particular iteration of training.
См. Также кривая обобщения .
variable importances
A set of scores that indicates the relative importance of each feature to the model.
For example, consider a decision tree that estimates house prices. Suppose this decision tree uses three features: size, age, and style. If a set of variable importances for the three features are calculated to be {size=5.8, age=2.5, style=4.7}, then size is more important to the decision tree than age or style.
Different variable importance metrics exist, which can inform ML experts about different aspects of models.
Вт
Wasserstein loss
One of the loss functions commonly used in generative adversarial networks , based on the earth mover's distance between the distribution of generated data and real data.
,This page contains Metrics glossary terms. Чтобы просмотреть все термины глоссария, нажмите здесь .
А
точность
Количество правильных прогнозов классификации, разделенное на общее количество прогнозов. То есть:
Например, модель, которая сделала 40 правильных прогнозов и 10 неправильных прогнозов, будет иметь точность:
Бинарная классификация дает конкретные названия различным категориям правильных и неправильных прогнозов . Итак, формула точности бинарной классификации выглядит следующим образом:
где:
- TP — количество истинных положительных результатов (правильных прогнозов).
- TN — количество истинных негативов (правильных прогнозов).
- FP — количество ложных срабатываний (неверных прогнозов).
- FN — количество ложноотрицательных результатов (неверных прогнозов).
Сравните и сопоставьте точность с точностью и отзывом .
Дополнительную информацию см. в разделе «Классификация: точность, полнота, прецизионность и связанные с ними показатели» в ускоренном курсе машинного обучения.
area under the PR curve
See PR AUC (Area under the PR Curve) .
area under the ROC curve
See AUC (Area under the ROC curve) .
AUC (Площадь под кривой ROC)
Число от 0,0 до 1,0, обозначающее способность модели бинарной классификации отделять положительные классы от отрицательных классов . Чем ближе AUC к 1,0, тем лучше способность модели отделять классы друг от друга.
Например, на следующем рисунке показана модель классификации , которая идеально отделяет положительные классы (зеленые овалы) от отрицательных классов (фиолетовые прямоугольники). Эта нереально идеальная модель имеет AUC 1,0:
И наоборот, на следующем рисунке показаны результаты для модели классификации , которая генерировала случайные результаты. Эта модель имеет AUC 0,5:
Да, предыдущая модель имеет AUC 0,5, а не 0,0.
Большинство моделей находятся где-то между двумя крайностями. Например, следующая модель несколько отделяет положительные значения от отрицательных и поэтому имеет AUC где-то между 0,5 и 1,0:
AUC игнорирует любые значения, установленные вами для порога классификации . Вместо этого AUC учитывает все возможные пороги классификации.
Дополнительную информацию см. в разделе «Классификация: ROC и AUC в ускоренном курсе машинного обучения».
average precision at k
A metric for summarizing a model's performance on a single prompt that generates ranked results, such as a numbered list of book recommendations. Average precision at k is, well, the average of the precision at k values for each relevant result. The formula for average precision at k is therefore:
\[{\text{average precision at k}} = \frac{1}{n} \sum_{i=1}^n {\text{precision at k for each relevant item} } \]
где:
- \(n\) is the number of relevant items in the list.
Contrast with recall at k .
Б
baseline
A model used as a reference point for comparing how well another model (typically, a more complex one) is performing. For example, a logistic regression model might serve as a good baseline for a deep model .
For a particular problem, the baseline helps model developers quantify the minimal expected performance that a new model must achieve for the new model to be useful.
С
расходы
Synonym for loss .
counterfactual fairness
A fairness metric that checks whether a classification model produces the same result for one individual as it does for another individual who is identical to the first, except with respect to one or more sensitive attributes . Evaluating a classification model for counterfactual fairness is one method for surfacing potential sources of bias in a model.
See either of the following for more information:
- Fairness: Counterfactual fairness in Machine Learning Crash Course.
- When Worlds Collide: Integrating Different Counterfactual Assumptions in Fairness
cross-entropy
A generalization of Log Loss to multi-class classification problems . Cross-entropy quantifies the difference between two probability distributions. See also perplexity .
cumulative distribution function (CDF)
A function that defines the frequency of samples less than or equal to a target value. For example, consider a normal distribution of continuous values. A CDF tells you that approximately 50% of samples should be less than or equal to the mean and that approximately 84% of samples should be less than or equal to one standard deviation above the mean.
Д
demographic parity
A fairness metric that is satisfied if the results of a model's classification are not dependent on a given sensitive attribute .
For example, if both Lilliputians and Brobdingnagians apply to Glubbdubdrib University, demographic parity is achieved if the percentage of Lilliputians admitted is the same as the percentage of Brobdingnagians admitted, irrespective of whether one group is on average more qualified than the other.
Contrast with equalized odds and equality of opportunity , which permit classification results in aggregate to depend on sensitive attributes, but don't permit classification results for certain specified ground truth labels to depend on sensitive attributes. See "Attacking discrimination with smarter machine learning" for a visualization exploring the tradeoffs when optimizing for demographic parity.
See Fairness: demographic parity in Machine Learning Crash Course for more information.
Э
earth mover's distance (EMD)
A measure of the relative similarity of two distributions . The lower the earth mover's distance, the more similar the distributions.
edit distance
A measurement of how similar two text strings are to each other. In machine learning, edit distance is useful for the following reasons:
- Edit distance is easy to compute.
- Edit distance can compare two strings known to be similar to each other.
- Edit distance can determine the degree to which different strings are similar to a given string.
There are several definitions of edit distance, each using different string operations. See Levenshtein distance for an example.
empirical cumulative distribution function (eCDF or EDF)
A cumulative distribution function based on empirical measurements from a real dataset. The value of the function at any point along the x-axis is the fraction of observations in the dataset that are less than or equal to the specified value.
энтропия
In information theory , a description of how unpredictable a probability distribution is. Alternatively, entropy is also defined as how much information each example contains. A distribution has the highest possible entropy when all values of a random variable are equally likely.
The entropy of a set with two possible values "0" and "1" (for example, the labels in a binary classification problem) has the following formula:
H = -p log p - q log q = -p log p - (1-p) * log (1-p)
где:
- H is the entropy.
- p is the fraction of "1" examples.
- q is the fraction of "0" examples. Note that q = (1 - p)
- log is generally log 2 . In this case, the entropy unit is a bit.
For example, suppose the following:
- 100 examples contain the value "1"
- 300 examples contain the value "0"
Therefore, the entropy value is:
- p = 0.25
- q = 0.75
- H = (-0.25)log 2 (0.25) - (0.75)log 2 (0.75) = 0.81 bits per example
A set that is perfectly balanced (for example, 200 "0"s and 200 "1"s) would have an entropy of 1.0 bit per example. As a set becomes more imbalanced , its entropy moves towards 0.0.
In decision trees , entropy helps formulate information gain to help the splitter select the conditions during the growth of a classification decision tree.
Compare entropy with:
- gini impurity
- cross-entropy loss function
Entropy is often called Shannon's entropy .
See Exact splitter for binary classification with numerical features in the Decision Forests course for more information.
equality of opportunity
A fairness metric to assess whether a model is predicting the desirable outcome equally well for all values of a sensitive attribute . In other words, if the desirable outcome for a model is the positive class , the goal would be to have the true positive rate be the same for all groups.
Equality of opportunity is related to equalized odds , which requires that both the true positive rates and false positive rates are the same for all groups.
Suppose Glubbdubdrib University admits both Lilliputians and Brobdingnagians to a rigorous mathematics program. Lilliputians' secondary schools offer a robust curriculum of math classes, and the vast majority of students are qualified for the university program. Brobdingnagians' secondary schools don't offer math classes at all, and as a result, far fewer of their students are qualified. Equality of opportunity is satisfied for the preferred label of "admitted" with respect to nationality (Lilliputian or Brobdingnagian) if qualified students are equally likely to be admitted irrespective of whether they're a Lilliputian or a Brobdingnagian.
For example, suppose 100 Lilliputians and 100 Brobdingnagians apply to Glubbdubdrib University, and admissions decisions are made as follows:
Table 1. Lilliputian applicants (90% are qualified)
Qualified | Unqualified | |
---|---|---|
Допущенный | 45 | 3 |
Отклоненный | 45 | 7 |
Общий | 90 | 10 |
Percentage of qualified students admitted: 45/90 = 50% Percentage of unqualified students rejected: 7/10 = 70% Total percentage of Lilliputian students admitted: (45+3)/100 = 48% |
Table 2. Brobdingnagian applicants (10% are qualified):
Qualified | Unqualified | |
---|---|---|
Допущенный | 5 | 9 |
Отклоненный | 5 | 81 |
Общий | 10 | 90 |
Percentage of qualified students admitted: 5/10 = 50% Percentage of unqualified students rejected: 81/90 = 90% Total percentage of Brobdingnagian students admitted: (5+9)/100 = 14% |
The preceding examples satisfy equality of opportunity for acceptance of qualified students because qualified Lilliputians and Brobdingnagians both have a 50% chance of being admitted.
While equality of opportunity is satisfied, the following two fairness metrics are not satisfied:
- demographic parity : Lilliputians and Brobdingnagians are admitted to the university at different rates; 48% of Lilliputians students are admitted, but only 14% of Brobdingnagian students are admitted.
- equalized odds : While qualified Lilliputian and Brobdingnagian students both have the same chance of being admitted, the additional constraint that unqualified Lilliputians and Brobdingnagians both have the same chance of being rejected is not satisfied. Unqualified Lilliputians have a 70% rejection rate, whereas unqualified Brobdingnagians have a 90% rejection rate.
See Fairness: Equality of opportunity in Machine Learning Crash Course for more information.
equalized odds
A fairness metric to assess whether a model is predicting outcomes equally well for all values of a sensitive attribute with respect to both the positive class and negative class —not just one class or the other exclusively. In other words, both the true positive rate and false negative rate should be the same for all groups.
Equalized odds is related to equality of opportunity , which only focuses on error rates for a single class (positive or negative).
For example, suppose Glubbdubdrib University admits both Lilliputians and Brobdingnagians to a rigorous mathematics program. Lilliputians' secondary schools offer a robust curriculum of math classes, and the vast majority of students are qualified for the university program. Brobdingnagians' secondary schools don't offer math classes at all, and as a result, far fewer of their students are qualified. Equalized odds is satisfied provided that no matter whether an applicant is a Lilliputian or a Brobdingnagian, if they are qualified, they are equally as likely to get admitted to the program, and if they are not qualified, they are equally as likely to get rejected.
Suppose 100 Lilliputians and 100 Brobdingnagians apply to Glubbdubdrib University, and admissions decisions are made as follows:
Table 3. Lilliputian applicants (90% are qualified)
Qualified | Unqualified | |
---|---|---|
Допущенный | 45 | 2 |
Отклоненный | 45 | 8 |
Общий | 90 | 10 |
Percentage of qualified students admitted: 45/90 = 50% Percentage of unqualified students rejected: 8/10 = 80% Total percentage of Lilliputian students admitted: (45+2)/100 = 47% |
Table 4. Brobdingnagian applicants (10% are qualified):
Qualified | Unqualified | |
---|---|---|
Допущенный | 5 | 18 |
Отклоненный | 5 | 72 |
Общий | 10 | 90 |
Percentage of qualified students admitted: 5/10 = 50% Percentage of unqualified students rejected: 72/90 = 80% Total percentage of Brobdingnagian students admitted: (5+18)/100 = 23% |
Equalized odds is satisfied because qualified Lilliputian and Brobdingnagian students both have a 50% chance of being admitted, and unqualified Lilliputian and Brobdingnagian have an 80% chance of being rejected.
Equalized odds is formally defined in "Equality of Opportunity in Supervised Learning" as follows: "predictor Ŷ satisfies equalized odds with respect to protected attribute A and outcome Y if Ŷ and A are independent, conditional on Y."
evals
Primarily used as an abbreviation for LLM evaluations . More broadly, evals is an abbreviation for any form of evaluation .
оценка
The process of measuring a model's quality or comparing different models against each other.
To evaluate a supervised machine learning model, you typically judge it against a validation set and a test set . Evaluating a LLM typically involves broader quality and safety assessments.
Ф
F 1
A "roll-up" binary classification metric that relies on both precision and recall . Here is the formula:
fairness metric
A mathematical definition of "fairness" that is measurable. Some commonly used fairness metrics include:
Many fairness metrics are mutually exclusive; see incompatibility of fairness metrics .
ложноотрицательный (ЛН)
Пример, в котором модель ошибочно предсказывает отрицательный класс . Например, модель предсказывает, что конкретное сообщение электронной почты не является спамом (негативный класс), но на самом деле это сообщение электронной почты является спамом .
ложноотрицательный показатель
The proportion of actual positive examples for which the model mistakenly predicted the negative class. The following formula calculates the false negative rate:
Дополнительные сведения см. в разделе «Пороговые значения и матрица путаницы» в ускоренном курсе машинного обучения.
ложноположительный результат (FP)
An example in which the model mistakenly predicts the positive class . Например, модель предсказывает, что конкретное сообщение электронной почты является спамом (положительный класс), но на самом деле это сообщение электронной почты не является спамом .
Дополнительные сведения см. в разделе «Пороговые значения и матрица путаницы» в ускоренном курсе машинного обучения.
уровень ложноположительных результатов (FPR)
Доля реальных отрицательных примеров, для которых модель ошибочно предсказала положительный класс. Следующая формула рассчитывает уровень ложноположительных результатов:
Частота ложноположительных результатов — это ось X на кривой ROC .
Дополнительную информацию см. в разделе «Классификация: ROC и AUC в ускоренном курсе машинного обучения».
feature importances
Synonym for variable importances .
fraction of successes
A metric for evaluating an ML model's generated text . The fraction of successes is the number of "successful" generated text outputs divided by the total number of generated text outputs. For example, if a large language model generated 10 blocks of code, five of which were successful, then the fraction of successes would be 50%.
Although fraction of successes is broadly useful throughout statistics, within ML, this metric is primarily useful for measuring verifiable tasks like code generation or math problems.
Г
gini impurity
A metric similar to entropy . Splitters use values derived from either gini impurity or entropy to compose conditions for classification decision trees . Information gain is derived from entropy. There is no universally accepted equivalent term for the metric derived from gini impurity; however, this unnamed metric is just as important as information gain.
Gini impurity is also called gini index , or simply gini .
ЧАС
hinge loss
A family of loss functions for classification designed to find the decision boundary as distant as possible from each training example, thus maximizing the margin between examples and the boundary. KSVMs use hinge loss (or a related function, such as squared hinge loss). For binary classification, the hinge loss function is defined as follows:
where y is the true label, either -1 or +1, and y' is the raw output of the classification model :
Consequently, a plot of hinge loss versus (y * y') looks as follows:
я
incompatibility of fairness metrics
The idea that some notions of fairness are mutually incompatible and cannot be satisfied simultaneously. As a result, there is no single universal metric for quantifying fairness that can be applied to all ML problems.
While this may seem discouraging, incompatibility of fairness metrics doesn't imply that fairness efforts are fruitless. Instead, it suggests that fairness must be defined contextually for a given ML problem, with the goal of preventing harms specific to its use cases.
See "On the (im)possibility of fairness" for a more detailed discussion of the incompatibility of fairness metrics.
individual fairness
A fairness metric that checks whether similar individuals are classified similarly. For example, Brobdingnagian Academy might want to satisfy individual fairness by ensuring that two students with identical grades and standardized test scores are equally likely to gain admission.
Note that individual fairness relies entirely on how you define "similarity" (in this case, grades and test scores), and you can run the risk of introducing new fairness problems if your similarity metric misses important information (such as the rigor of a student's curriculum).
See "Fairness Through Awareness" for a more detailed discussion of individual fairness.
information gain
In decision forests , the difference between a node's entropy and the weighted (by number of examples) sum of the entropy of its children nodes. A node's entropy is the entropy of the examples in that node.
For example, consider the following entropy values:
- entropy of parent node = 0.6
- entropy of one child node with 16 relevant examples = 0.2
- entropy of another child node with 24 relevant examples = 0.1
So 40% of the examples are in one child node and 60% are in the other child node. Поэтому:
- weighted entropy sum of child nodes = (0.4 * 0.2) + (0.6 * 0.1) = 0.14
So, the information gain is:
- information gain = entropy of parent node - weighted entropy sum of child nodes
- information gain = 0.6 - 0.14 = 0.46
Most splitters seek to create conditions that maximize information gain.
inter-rater agreement
A measurement of how often human raters agree when doing a task. If raters disagree, the task instructions may need to be improved. Also sometimes called inter-annotator agreement or inter-rater reliability . See also Cohen's kappa , which is one of the most popular inter-rater agreement measurements.
See Categorical data: Common issues in Machine Learning Crash Course for more information.
л
L 1 потеря
Функция потери , которая вычисляет абсолютное значение разницы между фактическими значениями метки и значениями, которые предсказывает модель . Например, вот расчет потери L 1 для партии из пяти примеров :
Фактическое значение примера | Прогнозируемое значение модели | Абсолютное значение дельты |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 3 |
4 | 6 | 2 |
9 | 8 | 1 |
8 = L 1 потеря |
L 1 Потеря менее чувствительна к выбросам , чем потеря L 2 .
The Mean Absolute Error is the average L 1 loss per example.
См. Линейную регрессию: курс потерь в машинном обучении для получения дополнительной информации.
L 2 потеря
Функция потери , которая вычисляет квадрат разницы между фактическими значениями метки и значениями, которые предсказывает модель . Например, вот расчет потери L 2 для партии из пяти примеров :
Фактическое значение примера | Прогнозируемое значение модели | Квадрат Дельта |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 9 |
4 | 6 | 4 |
9 | 8 | 1 |
16 = L 2 потеря |
Из -за квадрата потери L 2 усиливают влияние выбросов . То есть потеря L 2 реагирует более сильно на плохие прогнозы, чем потеря L 1 . Например, потеря L 1 для предыдущей партии составит 8, а не 16. Обратите внимание, что один выброс учитывает 9 из 16.
Регрессионные модели обычно используют потерю L 2 в качестве функции потери.
Средняя квадратная ошибка - это средняя потеря L 2 за пример. Потери квадрата - это еще одно название для потери L 2 .
См. Логистическая регрессия: потеря и регуляризация в курсе сбоя машинного обучения для получения дополнительной информации.
LLM evaluations (evals)
A set of metrics and benchmarks for assessing the performance of large language models (LLMs). At a high level, LLM evaluations:
- Help researchers identify areas where LLMs need improvement.
- Are useful in comparing different LLMs and identifying the best LLM for a particular task.
- Help ensure that LLMs are safe and ethical to use.
See Large language models (LLMs) in Machine Learning Crash Course for more information.
потеря
Во время обучения контролируемой модели мера того, насколько далеко прогнозирование модели от его ярлыка .
Функция потери вычисляет потерю.
См. Линейную регрессию: курс потерь в машинном обучении для получения дополнительной информации.
функция потерь
Во время обучения или тестирования математическая функция, которая вычисляет потерю на партии примеров. Функция потери возвращает более низкую потерю для моделей, которые делают хорошие прогнозы, чем для моделей, которые делают плохие прогнозы.
Цель обучения, как правило, состоит в том, чтобы минимизировать потери, которую возвращает функция потери.
Существует много различных видов потерь. Выберите соответствующую функцию потерь для той модели, которую вы строите. Например:
- L 2 Потеря (или средняя квадратная ошибка ) является функцией потери для линейной регрессии .
- Потеря журнала - это функция потери для логистической регрессии .
М
Mean Absolute Error (MAE)
The average loss per example when L 1 loss is used. Calculate Mean Absolute Error as follows:
- Calculate the L 1 loss for a batch.
- Divide the L 1 loss by the number of examples in the batch.
For example, consider the calculation of L 1 loss on the following batch of five examples:
Фактическое значение примера | Прогнозируемое значение модели | Loss (difference between actual and predicted) |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 3 |
4 | 6 | 2 |
9 | 8 | 1 |
8 = L 1 потеря |
So, L 1 loss is 8 and the number of examples is 5. Therefore, the Mean Absolute Error is:
Mean Absolute Error = L1 loss / Number of Examples Mean Absolute Error = 8/5 = 1.6
Contrast Mean Absolute Error with Mean Squared Error and Root Mean Squared Error .
mean average precision at k (mAP@k)
The statistical mean of all average precision at k scores across a validation dataset. One use of mean average precision at k is to judge the quality of recommendations generated by a recommendation system .
Although the phrase "mean average" sounds redundant, the name of the metric is appropriate. After all, this metric finds the mean of multiple average precision at k values.
Mean Squared Error (MSE)
The average loss per example when L 2 loss is used. Calculate Mean Squared Error as follows:
- Calculate the L 2 loss for a batch.
- Divide the L 2 loss by the number of examples in the batch.
For example, consider the loss on the following batch of five examples:
Actual value | Model's prediction | Потеря | Squared loss |
---|---|---|---|
7 | 6 | 1 | 1 |
5 | 4 | 1 | 1 |
8 | 11 | 3 | 9 |
4 | 6 | 2 | 4 |
9 | 8 | 1 | 1 |
16 = L 2 потеря |
Therefore, the Mean Squared Error is:
Mean Squared Error = L2 loss / Number of Examples Mean Squared Error = 16/5 = 3.2
Mean Squared Error is a popular training optimizer , particularly for linear regression .
Contrast Mean Squared Error with Mean Absolute Error and Root Mean Squared Error .
TensorFlow Playground uses Mean Squared Error to calculate loss values.
metric
A statistic that you care about.
An objective is a metric that a machine learning system tries to optimize.
Metrics API (tf.metrics)
A TensorFlow API for evaluating models. For example, tf.metrics.accuracy
determines how often a model's predictions match labels.
minimax loss
A loss function for generative adversarial networks , based on the cross-entropy between the distribution of generated data and real data.
Minimax loss is used in the first paper to describe generative adversarial networks.
See Loss Functions in the Generative Adversarial Networks course for more information.
model capacity
The complexity of problems that a model can learn. The more complex the problems that a model can learn, the higher the model's capacity. A model's capacity typically increases with the number of model parameters. For a formal definition of classification model capacity, see VC dimension .
Не
отрицательный класс
В бинарной классификации один класс называется положительным , а другой называется отрицательным . Положительный класс - это то, что модель тестирует, а отрицательный класс - другая возможность. Например:
- The negative class in a medical test might be "not tumor."
- Отрицательный класс в модели классификации электронной почты может быть «не спам».
Контраст с положительным классом .
О
цель
A metric that your algorithm is trying to optimize.
целевая функция
The mathematical formula or metric that a model aims to optimize. For example, the objective function for linear regression is usually Mean Squared Loss . Therefore, when training a linear regression model, training aims to minimize Mean Squared Loss.
In some cases, the goal is to maximize the objective function. For example, if the objective function is accuracy, the goal is to maximize accuracy.
See also loss .
П
pass at k (pass@k)
A metric to determine the quality of code (for example, Python) that a large language model generates. More specifically, pass at k tells you the likelihood that at least one generated block of code out of k generated blocks of code will pass all of its unit tests.
Large language models often struggle to generate good code for complex programming problems. Software engineers adapt to this problem by prompting the large language model to generate multiple ( k ) solutions for the same problem. Then, software engineers test each of the solutions against unit tests. The calculation of pass at k depends on the outcome of the unit tests:
- If one or more of those solutions pass the unit test, then the LLM Passes that code generation challenge.
- If none of the solutions pass the unit test, then the LLM Fails that code generation challenge.
The formula for pass at k is as follows:
\[\text{pass at k} = \frac{\text{total number of passes}} {\text{total number of challenges}}\]
In general, higher values of k produce higher pass at k scores; however, higher values of k require more large language model and unit testing resources.
производительность
Overloaded term with the following meanings:
- The standard meaning within software engineering. Namely: How fast (or efficiently) does this piece of software run?
- The meaning within machine learning. Here, performance answers the following question: How correct is this model ? That is, how good are the model's predictions?
permutation variable importances
A type of variable importance that evaluates the increase in the prediction error of a model after permuting the feature's values. Permutation variable importance is a model-independent metric.
недоумение
One measure of how well a model is accomplishing its task. For example, suppose your task is to read the first few letters of a word a user is typing on a phone keyboard, and to offer a list of possible completion words. Perplexity, P, for this task is approximately the number of guesses you need to offer in order for your list to contain the actual word the user is trying to type.
Perplexity is related to cross-entropy as follows:
positive class
The class you are testing for.
For example, the positive class in a cancer model might be "tumor." The positive class in an email classification model might be "spam."
Contrast with negative class .
PR AUC (area under the PR curve)
Area under the interpolated precision-recall curve , obtained by plotting (recall, precision) points for different values of the classification threshold .
точность
A metric for classification models that answers the following question:
When the model predicted the positive class , what percentage of the predictions were correct?
Here is the formula:
где:
- true positive means the model correctly predicted the positive class.
- false positive means the model mistakenly predicted the positive class.
For example, suppose a model made 200 positive predictions. Of these 200 positive predictions:
- 150 were true positives.
- 50 were false positives.
В этом случае:
Contrast with accuracy and recall .
Дополнительную информацию см. в разделе «Классификация: точность, полнота, прецизионность и связанные с ними показатели» в ускоренном курсе машинного обучения.
precision at k (precision@k)
A metric for evaluating a ranked (ordered) list of items. Precision at k identifies the fraction of the first k items in that list that are "relevant." То есть:
\[\text{precision at k} = \frac{\text{relevant items in first k items of the list}} {\text{k}}\]
The value of k must be less than or equal to the length of the returned list. Note that the length of the returned list is not part of the calculation.
Relevance is often subjective; even expert human evaluators often disagree on which items are relevant.
Compare with:
precision-recall curve
A curve of precision versus recall at different classification thresholds .
prediction bias
A value indicating how far apart the average of predictions is from the average of labels in the dataset.
Not to be confused with the bias term in machine learning models or with bias in ethics and fairness .
predictive parity
A fairness metric that checks whether, for a given classifier, the precision rates are equivalent for subgroups under consideration.
For example, a model that predicts college acceptance would satisfy predictive parity for nationality if its precision rate is the same for Lilliputians and Brobdingnagians.
Predictive parity is sometime also called predictive rate parity .
See "Fairness Definitions Explained" (section 3.2.1) for a more detailed discussion of predictive parity.
predictive rate parity
Another name for predictive parity .
probability density function
A function that identifies the frequency of data samples having exactly a particular value. When a dataset's values are continuous floating-point numbers, exact matches rarely occur. However, integrating a probability density function from value x
to value y
yields the expected frequency of data samples between x
and y
.
For example, consider a normal distribution having a mean of 200 and a standard deviation of 30. To determine the expected frequency of data samples falling within the range 211.4 to 218.7, you can integrate the probability density function for a normal distribution from 211.4 to 218.7.
Р
отзывать
A metric for classification models that answers the following question:
When ground truth was the positive class , what percentage of predictions did the model correctly identify as the positive class?
Here is the formula:
\[\text{Recall} = \frac{\text{true positives}} {\text{true positives} + \text{false negatives}} \]
где:
- true positive means the model correctly predicted the positive class.
- false negative means that the model mistakenly predicted the negative class .
For instance, suppose your model made 200 predictions on examples for which ground truth was the positive class. Of these 200 predictions:
- 180 were true positives.
- 20 were false negatives.
В этом случае:
\[\text{Recall} = \frac{\text{180}} {\text{180} + \text{20}} = 0.9 \]
See Classification: Accuracy, recall, precision and related metrics for more information.
recall at k (recall@k)
A metric for evaluating systems that output a ranked (ordered) list of items. Recall at k identifies the fraction of relevant items in the first k items in that list out of the total number of relevant items returned.
\[\text{recall at k} = \frac{\text{relevant items in first k items of the list}} {\text{total number of relevant items in the list}}\]
Contrast with precision at k .
ROC (receiver operating characteristic) Curve
A graph of true positive rate versus false positive rate for different classification thresholds in binary classification.
The shape of an ROC curve suggests a binary classification model's ability to separate positive classes from negative classes. Suppose, for example, that a binary classification model perfectly separates all the negative classes from all the positive classes:
The ROC curve for the preceding model looks as follows:
In contrast, the following illustration graphs the raw logistic regression values for a terrible model that can't separate negative classes from positive classes at all:
The ROC curve for this model looks as follows:
Meanwhile, back in the real world, most binary classification models separate positive and negative classes to some degree, but usually not perfectly. So, a typical ROC curve falls somewhere between the two extremes:
The point on an ROC curve closest to (0.0,1.0) theoretically identifies the ideal classification threshold. However, several other real-world issues influence the selection of the ideal classification threshold. For example, perhaps false negatives cause far more pain than false positives.
A numerical metric called AUC summarizes the ROC curve into a single floating-point value.
Root Mean Squared Error (RMSE)
The square root of the Mean Squared Error .
ROUGE (Recall-Oriented Understudy for Gisting Evaluation)
A family of metrics that evaluate automatic summarization and machine translation models. ROUGE metrics determine the degree to which a reference text overlaps an ML model's generated text . Each member of the ROUGE family measures overlap in a different way. Higher ROUGE scores indicate more similarity between the reference text and generated text than lower ROUGE scores.
Each ROUGE family member typically generates the following metrics:
- Точность
- Отзывать
- F 1
For details and examples, see:
ROUGE-L
A member of the ROUGE family focused on the length of the longest common subsequence in the reference text and generated text . The following formulas calculate recall and precision for ROUGE-L:
You can then use F 1 to roll up ROUGE-L recall and ROUGE-L precision into a single metric:
ROUGE-L ignores any newlines in the reference text and generated text, so the longest common subsequence could cross multiple sentences. When the reference text and generated text involve multiple sentences, a variation of ROUGE-L called ROUGE-Lsum is generally a better metric. ROUGE-Lsum determines the longest common subsequence for each sentence in a passage and then calculates the mean of those longest common subsequences.
ROUGE-N
A set of metrics within the ROUGE family that compares the shared N-grams of a certain size in the reference text and generated text . Например:
- ROUGE-1 measures the number of shared tokens in the reference text and generated text.
- ROUGE-2 measures the number of shared bigrams (2-grams) in the reference text and generated text.
- ROUGE-3 measures the number of shared trigrams (3-grams) in the reference text and generated text.
You can use the following formulas to calculate ROUGE-N recall and ROUGE-N precision for any member of the ROUGE-N family:
You can then use F 1 to roll up ROUGE-N recall and ROUGE-N precision into a single metric:
ROUGE-S
A forgiving form of ROUGE-N that enables skip-gram matching. That is, ROUGE-N only counts N-grams that match exactly , but ROUGE-S also counts N-grams separated by one or more words. For example, consider the following:
- reference text : White clouds
- generated text : White billowing clouds
When calculating ROUGE-N, the 2-gram, White clouds doesn't match White billowing clouds . However, when calculating ROUGE-S, White clouds does match White billowing clouds .
R-squared
A regression metric indicating how much variation in a label is due to an individual feature or to a feature set. R-squared is a value between 0 and 1, which you can interpret as follows:
- An R-squared of 0 means that none of a label's variation is due to the feature set.
- An R-squared of 1 means that all of a label's variation is due to the feature set.
- An R-squared between 0 and 1 indicates the extent to which the label's variation can be predicted from a particular feature or the feature set. For example, an R-squared of 0.10 means that 10 percent of the variance in the label is due to the feature set, an R-squared of 0.20 means that 20 percent is due to the feature set, and so on.
R-squared is the square of the Pearson correlation coefficient between the values that a model predicted and ground truth .
С
подсчет очков
The part of a recommendation system that provides a value or ranking for each item produced by the candidate generation phase.
similarity measure
In clustering algorithms, the metric used to determine how alike (how similar) any two examples are.
sparsity
The number of elements set to zero (or null) in a vector or matrix divided by the total number of entries in that vector or matrix. For example, consider a 100-element matrix in which 98 cells contain zero. The calculation of sparsity is as follows:
Feature sparsity refers to the sparsity of a feature vector; model sparsity refers to the sparsity of the model weights.
squared hinge loss
The square of the hinge loss . Squared hinge loss penalizes outliers more harshly than regular hinge loss.
squared loss
Synonym for L 2 loss .
Т
Тестовая потеря
A metric representing a model's loss against the test set . When building a model , you typically try to minimize test loss. That's because a low test loss is a stronger quality signal than a low training loss or low validation loss .
A large gap between test loss and training loss or validation loss sometimes suggests that you need to increase the regularization rate .
top-k accuracy
The percentage of times that a "target label" appears within the first k positions of generated lists. The lists could be personalized recommendations or a list of items ordered by softmax .
Top-k accuracy is also known as accuracy at k .
токсичность
The degree to which content is abusive, threatening, or offensive. Many machine learning models can identify and measure toxicity. Most of these models identify toxicity along multiple parameters, such as the level of abusive language and the level of threatening language.
Потеря обучения
A metric representing a model's loss during a particular training iteration. For example, suppose the loss function is Mean Squared Error . Perhaps the training loss (the Mean Squared Error) for the 10th iteration is 2.2, and the training loss for the 100th iteration is 1.9.
A loss curve plots training loss versus the number of iterations. A loss curve provides the following hints about training:
- A downward slope implies that the model is improving.
- An upward slope implies that the model is getting worse.
- A flat slope implies that the model has reached convergence .
For example, the following somewhat idealized loss curve shows:
- A steep downward slope during the initial iterations, which implies rapid model improvement.
- A gradually flattening (but still downward) slope until close to the end of training, which implies continued model improvement at a somewhat slower pace then during the initial iterations.
- A flat slope towards the end of training, which suggests convergence.
Although training loss is important, see also generalization .
true negative (TN)
An example in which the model correctly predicts the negative class . For example, the model infers that a particular email message is not spam , and that email message really is not spam .
true positive (TP)
An example in which the model correctly predicts the positive class . For example, the model infers that a particular email message is spam, and that email message really is spam.
true positive rate (TPR)
Synonym for recall . То есть:
True positive rate is the y-axis in an ROC curve .
В
убытка валидации
A metric representing a model's loss on the validation set during a particular iteration of training.
См. Также кривая обобщения .
variable importances
A set of scores that indicates the relative importance of each feature to the model.
For example, consider a decision tree that estimates house prices. Suppose this decision tree uses three features: size, age, and style. If a set of variable importances for the three features are calculated to be {size=5.8, age=2.5, style=4.7}, then size is more important to the decision tree than age or style.
Different variable importance metrics exist, which can inform ML experts about different aspects of models.
Вт
Wasserstein loss
One of the loss functions commonly used in generative adversarial networks , based on the earth mover's distance between the distribution of generated data and real data.
,This page contains Metrics glossary terms. Чтобы просмотреть все термины глоссария, нажмите здесь .
А
точность
Количество правильных прогнозов классификации, разделенное на общее количество прогнозов. То есть:
Например, модель, которая сделала 40 правильных прогнозов и 10 неправильных прогнозов, будет иметь точность:
Бинарная классификация дает конкретные названия различным категориям правильных и неправильных прогнозов . Итак, формула точности бинарной классификации выглядит следующим образом:
где:
- TP — количество истинных положительных результатов (правильных прогнозов).
- TN — количество истинных негативов (правильных прогнозов).
- FP — количество ложных срабатываний (неверных прогнозов).
- FN — количество ложноотрицательных результатов (неверных прогнозов).
Сравните и сопоставьте точность с точностью и отзывом .
Дополнительную информацию см. в разделе «Классификация: точность, полнота, прецизионность и связанные с ними показатели» в ускоренном курсе машинного обучения.
area under the PR curve
See PR AUC (Area under the PR Curve) .
area under the ROC curve
See AUC (Area under the ROC curve) .
AUC (Площадь под кривой ROC)
Число от 0,0 до 1,0, обозначающее способность модели бинарной классификации отделять положительные классы от отрицательных классов . Чем ближе AUC к 1,0, тем лучше способность модели отделять классы друг от друга.
Например, на следующем рисунке показана модель классификации , которая идеально отделяет положительные классы (зеленые овалы) от отрицательных классов (фиолетовые прямоугольники). Эта нереально идеальная модель имеет AUC 1,0:
И наоборот, на следующем рисунке показаны результаты для модели классификации , которая генерировала случайные результаты. Эта модель имеет AUC 0,5:
Да, предыдущая модель имеет AUC 0,5, а не 0,0.
Большинство моделей находятся где-то между двумя крайностями. Например, следующая модель несколько отделяет положительные значения от отрицательных и поэтому имеет AUC где-то между 0,5 и 1,0:
AUC игнорирует любые значения, установленные вами для порога классификации . Вместо этого AUC учитывает все возможные пороги классификации.
Дополнительную информацию см. в разделе «Классификация: ROC и AUC в ускоренном курсе машинного обучения».
average precision at k
A metric for summarizing a model's performance on a single prompt that generates ranked results, such as a numbered list of book recommendations. Average precision at k is, well, the average of the precision at k values for each relevant result. The formula for average precision at k is therefore:
\[{\text{average precision at k}} = \frac{1}{n} \sum_{i=1}^n {\text{precision at k for each relevant item} } \]
где:
- \(n\) is the number of relevant items in the list.
Contrast with recall at k .
Б
baseline
A model used as a reference point for comparing how well another model (typically, a more complex one) is performing. For example, a logistic regression model might serve as a good baseline for a deep model .
For a particular problem, the baseline helps model developers quantify the minimal expected performance that a new model must achieve for the new model to be useful.
С
расходы
Synonym for loss .
counterfactual fairness
A fairness metric that checks whether a classification model produces the same result for one individual as it does for another individual who is identical to the first, except with respect to one or more sensitive attributes . Evaluating a classification model for counterfactual fairness is one method for surfacing potential sources of bias in a model.
See either of the following for more information:
- Fairness: Counterfactual fairness in Machine Learning Crash Course.
- When Worlds Collide: Integrating Different Counterfactual Assumptions in Fairness
cross-entropy
A generalization of Log Loss to multi-class classification problems . Cross-entropy quantifies the difference between two probability distributions. See also perplexity .
cumulative distribution function (CDF)
A function that defines the frequency of samples less than or equal to a target value. For example, consider a normal distribution of continuous values. A CDF tells you that approximately 50% of samples should be less than or equal to the mean and that approximately 84% of samples should be less than or equal to one standard deviation above the mean.
Д
demographic parity
A fairness metric that is satisfied if the results of a model's classification are not dependent on a given sensitive attribute .
For example, if both Lilliputians and Brobdingnagians apply to Glubbdubdrib University, demographic parity is achieved if the percentage of Lilliputians admitted is the same as the percentage of Brobdingnagians admitted, irrespective of whether one group is on average more qualified than the other.
Contrast with equalized odds and equality of opportunity , which permit classification results in aggregate to depend on sensitive attributes, but don't permit classification results for certain specified ground truth labels to depend on sensitive attributes. See "Attacking discrimination with smarter machine learning" for a visualization exploring the tradeoffs when optimizing for demographic parity.
See Fairness: demographic parity in Machine Learning Crash Course for more information.
Э
earth mover's distance (EMD)
A measure of the relative similarity of two distributions . The lower the earth mover's distance, the more similar the distributions.
edit distance
A measurement of how similar two text strings are to each other. In machine learning, edit distance is useful for the following reasons:
- Edit distance is easy to compute.
- Edit distance can compare two strings known to be similar to each other.
- Edit distance can determine the degree to which different strings are similar to a given string.
There are several definitions of edit distance, each using different string operations. See Levenshtein distance for an example.
empirical cumulative distribution function (eCDF or EDF)
A cumulative distribution function based on empirical measurements from a real dataset. The value of the function at any point along the x-axis is the fraction of observations in the dataset that are less than or equal to the specified value.
энтропия
In information theory , a description of how unpredictable a probability distribution is. Alternatively, entropy is also defined as how much information each example contains. A distribution has the highest possible entropy when all values of a random variable are equally likely.
The entropy of a set with two possible values "0" and "1" (for example, the labels in a binary classification problem) has the following formula:
H = -p log p - q log q = -p log p - (1-p) * log (1-p)
где:
- H is the entropy.
- p is the fraction of "1" examples.
- q is the fraction of "0" examples. Note that q = (1 - p)
- log is generally log 2 . In this case, the entropy unit is a bit.
For example, suppose the following:
- 100 examples contain the value "1"
- 300 examples contain the value "0"
Therefore, the entropy value is:
- p = 0.25
- q = 0.75
- H = (-0.25)log 2 (0.25) - (0.75)log 2 (0.75) = 0.81 bits per example
A set that is perfectly balanced (for example, 200 "0"s and 200 "1"s) would have an entropy of 1.0 bit per example. As a set becomes more imbalanced , its entropy moves towards 0.0.
In decision trees , entropy helps formulate information gain to help the splitter select the conditions during the growth of a classification decision tree.
Compare entropy with:
- gini impurity
- cross-entropy loss function
Entropy is often called Shannon's entropy .
See Exact splitter for binary classification with numerical features in the Decision Forests course for more information.
equality of opportunity
A fairness metric to assess whether a model is predicting the desirable outcome equally well for all values of a sensitive attribute . In other words, if the desirable outcome for a model is the positive class , the goal would be to have the true positive rate be the same for all groups.
Equality of opportunity is related to equalized odds , which requires that both the true positive rates and false positive rates are the same for all groups.
Suppose Glubbdubdrib University admits both Lilliputians and Brobdingnagians to a rigorous mathematics program. Lilliputians' secondary schools offer a robust curriculum of math classes, and the vast majority of students are qualified for the university program. Brobdingnagians' secondary schools don't offer math classes at all, and as a result, far fewer of their students are qualified. Equality of opportunity is satisfied for the preferred label of "admitted" with respect to nationality (Lilliputian or Brobdingnagian) if qualified students are equally likely to be admitted irrespective of whether they're a Lilliputian or a Brobdingnagian.
For example, suppose 100 Lilliputians and 100 Brobdingnagians apply to Glubbdubdrib University, and admissions decisions are made as follows:
Table 1. Lilliputian applicants (90% are qualified)
Qualified | Unqualified | |
---|---|---|
Допущенный | 45 | 3 |
Отклоненный | 45 | 7 |
Общий | 90 | 10 |
Percentage of qualified students admitted: 45/90 = 50% Percentage of unqualified students rejected: 7/10 = 70% Total percentage of Lilliputian students admitted: (45+3)/100 = 48% |
Table 2. Brobdingnagian applicants (10% are qualified):
Qualified | Unqualified | |
---|---|---|
Допущенный | 5 | 9 |
Отклоненный | 5 | 81 |
Общий | 10 | 90 |
Percentage of qualified students admitted: 5/10 = 50% Percentage of unqualified students rejected: 81/90 = 90% Total percentage of Brobdingnagian students admitted: (5+9)/100 = 14% |
The preceding examples satisfy equality of opportunity for acceptance of qualified students because qualified Lilliputians and Brobdingnagians both have a 50% chance of being admitted.
While equality of opportunity is satisfied, the following two fairness metrics are not satisfied:
- demographic parity : Lilliputians and Brobdingnagians are admitted to the university at different rates; 48% of Lilliputians students are admitted, but only 14% of Brobdingnagian students are admitted.
- equalized odds : While qualified Lilliputian and Brobdingnagian students both have the same chance of being admitted, the additional constraint that unqualified Lilliputians and Brobdingnagians both have the same chance of being rejected is not satisfied. Unqualified Lilliputians have a 70% rejection rate, whereas unqualified Brobdingnagians have a 90% rejection rate.
See Fairness: Equality of opportunity in Machine Learning Crash Course for more information.
equalized odds
A fairness metric to assess whether a model is predicting outcomes equally well for all values of a sensitive attribute with respect to both the positive class and negative class —not just one class or the other exclusively. In other words, both the true positive rate and false negative rate should be the same for all groups.
Equalized odds is related to equality of opportunity , which only focuses on error rates for a single class (positive or negative).
For example, suppose Glubbdubdrib University admits both Lilliputians and Brobdingnagians to a rigorous mathematics program. Lilliputians' secondary schools offer a robust curriculum of math classes, and the vast majority of students are qualified for the university program. Brobdingnagians' secondary schools don't offer math classes at all, and as a result, far fewer of their students are qualified. Equalized odds is satisfied provided that no matter whether an applicant is a Lilliputian or a Brobdingnagian, if they are qualified, they are equally as likely to get admitted to the program, and if they are not qualified, they are equally as likely to get rejected.
Suppose 100 Lilliputians and 100 Brobdingnagians apply to Glubbdubdrib University, and admissions decisions are made as follows:
Table 3. Lilliputian applicants (90% are qualified)
Qualified | Unqualified | |
---|---|---|
Допущенный | 45 | 2 |
Отклоненный | 45 | 8 |
Общий | 90 | 10 |
Percentage of qualified students admitted: 45/90 = 50% Percentage of unqualified students rejected: 8/10 = 80% Total percentage of Lilliputian students admitted: (45+2)/100 = 47% |
Table 4. Brobdingnagian applicants (10% are qualified):
Qualified | Unqualified | |
---|---|---|
Допущенный | 5 | 18 |
Отклоненный | 5 | 72 |
Общий | 10 | 90 |
Percentage of qualified students admitted: 5/10 = 50% Percentage of unqualified students rejected: 72/90 = 80% Total percentage of Brobdingnagian students admitted: (5+18)/100 = 23% |
Equalized odds is satisfied because qualified Lilliputian and Brobdingnagian students both have a 50% chance of being admitted, and unqualified Lilliputian and Brobdingnagian have an 80% chance of being rejected.
Equalized odds is formally defined in "Equality of Opportunity in Supervised Learning" as follows: "predictor Ŷ satisfies equalized odds with respect to protected attribute A and outcome Y if Ŷ and A are independent, conditional on Y."
evals
Primarily used as an abbreviation for LLM evaluations . More broadly, evals is an abbreviation for any form of evaluation .
оценка
The process of measuring a model's quality or comparing different models against each other.
To evaluate a supervised machine learning model, you typically judge it against a validation set and a test set . Evaluating a LLM typically involves broader quality and safety assessments.
Ф
F 1
A "roll-up" binary classification metric that relies on both precision and recall . Here is the formula:
fairness metric
A mathematical definition of "fairness" that is measurable. Some commonly used fairness metrics include:
Many fairness metrics are mutually exclusive; see incompatibility of fairness metrics .
ложноотрицательный (ЛН)
Пример, в котором модель ошибочно предсказывает отрицательный класс . Например, модель предсказывает, что конкретное сообщение электронной почты не является спамом (негативный класс), но на самом деле это сообщение электронной почты является спамом .
ложноотрицательный показатель
The proportion of actual positive examples for which the model mistakenly predicted the negative class. The following formula calculates the false negative rate:
Дополнительные сведения см. в разделе «Пороговые значения и матрица путаницы» в ускоренном курсе машинного обучения.
ложноположительный результат (FP)
An example in which the model mistakenly predicts the positive class . Например, модель предсказывает, что конкретное сообщение электронной почты является спамом (положительный класс), но на самом деле это сообщение электронной почты не является спамом .
Дополнительные сведения см. в разделе «Пороговые значения и матрица путаницы» в ускоренном курсе машинного обучения.
уровень ложноположительных результатов (FPR)
Доля реальных отрицательных примеров, для которых модель ошибочно предсказала положительный класс. Следующая формула рассчитывает уровень ложноположительных результатов:
Частота ложноположительных результатов — это ось X на кривой ROC .
Дополнительную информацию см. в разделе «Классификация: ROC и AUC в ускоренном курсе машинного обучения».
feature importances
Synonym for variable importances .
fraction of successes
A metric for evaluating an ML model's generated text . The fraction of successes is the number of "successful" generated text outputs divided by the total number of generated text outputs. For example, if a large language model generated 10 blocks of code, five of which were successful, then the fraction of successes would be 50%.
Although fraction of successes is broadly useful throughout statistics, within ML, this metric is primarily useful for measuring verifiable tasks like code generation or math problems.
Г
gini impurity
A metric similar to entropy . Splitters use values derived from either gini impurity or entropy to compose conditions for classification decision trees . Information gain is derived from entropy. There is no universally accepted equivalent term for the metric derived from gini impurity; however, this unnamed metric is just as important as information gain.
Gini impurity is also called gini index , or simply gini .
ЧАС
hinge loss
A family of loss functions for classification designed to find the decision boundary as distant as possible from each training example, thus maximizing the margin between examples and the boundary. KSVMs use hinge loss (or a related function, such as squared hinge loss). For binary classification, the hinge loss function is defined as follows:
where y is the true label, either -1 or +1, and y' is the raw output of the classification model :
Consequently, a plot of hinge loss versus (y * y') looks as follows:
я
incompatibility of fairness metrics
The idea that some notions of fairness are mutually incompatible and cannot be satisfied simultaneously. As a result, there is no single universal metric for quantifying fairness that can be applied to all ML problems.
While this may seem discouraging, incompatibility of fairness metrics doesn't imply that fairness efforts are fruitless. Instead, it suggests that fairness must be defined contextually for a given ML problem, with the goal of preventing harms specific to its use cases.
See "On the (im)possibility of fairness" for a more detailed discussion of the incompatibility of fairness metrics.
individual fairness
A fairness metric that checks whether similar individuals are classified similarly. For example, Brobdingnagian Academy might want to satisfy individual fairness by ensuring that two students with identical grades and standardized test scores are equally likely to gain admission.
Note that individual fairness relies entirely on how you define "similarity" (in this case, grades and test scores), and you can run the risk of introducing new fairness problems if your similarity metric misses important information (such as the rigor of a student's curriculum).
See "Fairness Through Awareness" for a more detailed discussion of individual fairness.
information gain
In decision forests , the difference between a node's entropy and the weighted (by number of examples) sum of the entropy of its children nodes. A node's entropy is the entropy of the examples in that node.
For example, consider the following entropy values:
- entropy of parent node = 0.6
- entropy of one child node with 16 relevant examples = 0.2
- entropy of another child node with 24 relevant examples = 0.1
So 40% of the examples are in one child node and 60% are in the other child node. Поэтому:
- weighted entropy sum of child nodes = (0.4 * 0.2) + (0.6 * 0.1) = 0.14
So, the information gain is:
- information gain = entropy of parent node - weighted entropy sum of child nodes
- information gain = 0.6 - 0.14 = 0.46
Most splitters seek to create conditions that maximize information gain.
inter-rater agreement
A measurement of how often human raters agree when doing a task. If raters disagree, the task instructions may need to be improved. Also sometimes called inter-annotator agreement or inter-rater reliability . See also Cohen's kappa , which is one of the most popular inter-rater agreement measurements.
See Categorical data: Common issues in Machine Learning Crash Course for more information.
л
L 1 потеря
Функция потери , которая вычисляет абсолютное значение разницы между фактическими значениями метки и значениями, которые предсказывает модель . Например, вот расчет потери L 1 для партии из пяти примеров :
Фактическое значение примера | Прогнозируемое значение модели | Абсолютное значение дельты |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 3 |
4 | 6 | 2 |
9 | 8 | 1 |
8 = L 1 потеря |
L 1 Потеря менее чувствительна к выбросам , чем потеря L 2 .
The Mean Absolute Error is the average L 1 loss per example.
См. Линейную регрессию: курс потерь в машинном обучении для получения дополнительной информации.
L 2 потеря
Функция потери , которая вычисляет квадрат разницы между фактическими значениями метки и значениями, которые предсказывает модель . Например, вот расчет потери L 2 для партии из пяти примеров :
Фактическое значение примера | Прогнозируемое значение модели | Квадрат Дельта |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 9 |
4 | 6 | 4 |
9 | 8 | 1 |
16 = L 2 потеря |
Из -за квадрата потери L 2 усиливают влияние выбросов . То есть потеря L 2 реагирует более сильно на плохие прогнозы, чем потеря L 1 . Например, потеря L 1 для предыдущей партии составит 8, а не 16. Обратите внимание, что один выброс учитывает 9 из 16.
Регрессионные модели обычно используют потерю L 2 в качестве функции потери.
Средняя квадратная ошибка - это средняя потеря L 2 за пример. Потери квадрата - это еще одно название для потери L 2 .
См. Логистическая регрессия: потеря и регуляризация в курсе сбоя машинного обучения для получения дополнительной информации.
LLM evaluations (evals)
A set of metrics and benchmarks for assessing the performance of large language models (LLMs). At a high level, LLM evaluations:
- Help researchers identify areas where LLMs need improvement.
- Are useful in comparing different LLMs and identifying the best LLM for a particular task.
- Help ensure that LLMs are safe and ethical to use.
See Large language models (LLMs) in Machine Learning Crash Course for more information.
потеря
Во время обучения контролируемой модели мера того, насколько далеко прогнозирование модели от его ярлыка .
Функция потери вычисляет потерю.
См. Линейную регрессию: курс потерь в машинном обучении для получения дополнительной информации.
функция потерь
Во время обучения или тестирования математическая функция, которая вычисляет потерю на партии примеров. Функция потери возвращает более низкую потерю для моделей, которые делают хорошие прогнозы, чем для моделей, которые делают плохие прогнозы.
Цель обучения, как правило, состоит в том, чтобы минимизировать потери, которую возвращает функция потери.
Существует много различных видов потерь. Выберите соответствующую функцию потерь для той модели, которую вы строите. Например:
- L 2 Потеря (или средняя квадратная ошибка ) является функцией потери для линейной регрессии .
- Потеря журнала - это функция потери для логистической регрессии .
М
Mean Absolute Error (MAE)
The average loss per example when L 1 loss is used. Calculate Mean Absolute Error as follows:
- Calculate the L 1 loss for a batch.
- Divide the L 1 loss by the number of examples in the batch.
For example, consider the calculation of L 1 loss on the following batch of five examples:
Фактическое значение примера | Прогнозируемое значение модели | Loss (difference between actual and predicted) |
---|---|---|
7 | 6 | 1 |
5 | 4 | 1 |
8 | 11 | 3 |
4 | 6 | 2 |
9 | 8 | 1 |
8 = L 1 потеря |
So, L 1 loss is 8 and the number of examples is 5. Therefore, the Mean Absolute Error is:
Mean Absolute Error = L1 loss / Number of Examples Mean Absolute Error = 8/5 = 1.6
Contrast Mean Absolute Error with Mean Squared Error and Root Mean Squared Error .
mean average precision at k (mAP@k)
The statistical mean of all average precision at k scores across a validation dataset. One use of mean average precision at k is to judge the quality of recommendations generated by a recommendation system .
Although the phrase "mean average" sounds redundant, the name of the metric is appropriate. After all, this metric finds the mean of multiple average precision at k values.
Mean Squared Error (MSE)
The average loss per example when L 2 loss is used. Calculate Mean Squared Error as follows:
- Calculate the L 2 loss for a batch.
- Divide the L 2 loss by the number of examples in the batch.
For example, consider the loss on the following batch of five examples:
Actual value | Model's prediction | Потеря | Squared loss |
---|---|---|---|
7 | 6 | 1 | 1 |
5 | 4 | 1 | 1 |
8 | 11 | 3 | 9 |
4 | 6 | 2 | 4 |
9 | 8 | 1 | 1 |
16 = L 2 потеря |
Therefore, the Mean Squared Error is:
Mean Squared Error = L2 loss / Number of Examples Mean Squared Error = 16/5 = 3.2
Mean Squared Error is a popular training optimizer , particularly for linear regression .
Contrast Mean Squared Error with Mean Absolute Error and Root Mean Squared Error .
TensorFlow Playground uses Mean Squared Error to calculate loss values.
metric
A statistic that you care about.
An objective is a metric that a machine learning system tries to optimize.
Metrics API (tf.metrics)
A TensorFlow API for evaluating models. For example, tf.metrics.accuracy
determines how often a model's predictions match labels.
minimax loss
A loss function for generative adversarial networks , based on the cross-entropy between the distribution of generated data and real data.
Minimax loss is used in the first paper to describe generative adversarial networks.
See Loss Functions in the Generative Adversarial Networks course for more information.
model capacity
The complexity of problems that a model can learn. The more complex the problems that a model can learn, the higher the model's capacity. A model's capacity typically increases with the number of model parameters. For a formal definition of classification model capacity, see VC dimension .
Не
отрицательный класс
В бинарной классификации один класс называется положительным , а другой называется отрицательным . Положительный класс - это то, что модель тестирует, а отрицательный класс - другая возможность. Например:
- The negative class in a medical test might be "not tumor."
- Отрицательный класс в модели классификации электронной почты может быть «не спам».
Контраст с положительным классом .
О
цель
A metric that your algorithm is trying to optimize.
целевая функция
The mathematical formula or metric that a model aims to optimize. For example, the objective function for linear regression is usually Mean Squared Loss . Therefore, when training a linear regression model, training aims to minimize Mean Squared Loss.
In some cases, the goal is to maximize the objective function. For example, if the objective function is accuracy, the goal is to maximize accuracy.
See also loss .
П
pass at k (pass@k)
A metric to determine the quality of code (for example, Python) that a large language model generates. More specifically, pass at k tells you the likelihood that at least one generated block of code out of k generated blocks of code will pass all of its unit tests.
Large language models often struggle to generate good code for complex programming problems. Software engineers adapt to this problem by prompting the large language model to generate multiple ( k ) solutions for the same problem. Then, software engineers test each of the solutions against unit tests. The calculation of pass at k depends on the outcome of the unit tests:
- If one or more of those solutions pass the unit test, then the LLM Passes that code generation challenge.
- If none of the solutions pass the unit test, then the LLM Fails that code generation challenge.
The formula for pass at k is as follows:
\[\text{pass at k} = \frac{\text{total number of passes}} {\text{total number of challenges}}\]
In general, higher values of k produce higher pass at k scores; however, higher values of k require more large language model and unit testing resources.
производительность
Overloaded term with the following meanings:
- The standard meaning within software engineering. Namely: How fast (or efficiently) does this piece of software run?
- The meaning within machine learning. Here, performance answers the following question: How correct is this model ? That is, how good are the model's predictions?
permutation variable importances
A type of variable importance that evaluates the increase in the prediction error of a model after permuting the feature's values. Permutation variable importance is a model-independent metric.
недоумение
One measure of how well a model is accomplishing its task. For example, suppose your task is to read the first few letters of a word a user is typing on a phone keyboard, and to offer a list of possible completion words. Perplexity, P, for this task is approximately the number of guesses you need to offer in order for your list to contain the actual word the user is trying to type.
Perplexity is related to cross-entropy as follows:
positive class
The class you are testing for.
For example, the positive class in a cancer model might be "tumor." The positive class in an email classification model might be "spam."
Contrast with negative class .
PR AUC (area under the PR curve)
Area under the interpolated precision-recall curve , obtained by plotting (recall, precision) points for different values of the classification threshold .
точность
A metric for classification models that answers the following question:
When the model predicted the positive class , what percentage of the predictions were correct?
Here is the formula:
где:
- true positive means the model correctly predicted the positive class.
- false positive means the model mistakenly predicted the positive class.
For example, suppose a model made 200 positive predictions. Of these 200 positive predictions:
- 150 were true positives.
- 50 were false positives.
В этом случае:
Contrast with accuracy and recall .
Дополнительную информацию см. в разделе «Классификация: точность, полнота, прецизионность и связанные с ними показатели» в ускоренном курсе машинного обучения.
precision at k (precision@k)
A metric for evaluating a ranked (ordered) list of items. Precision at k identifies the fraction of the first k items in that list that are "relevant." То есть:
\[\text{precision at k} = \frac{\text{relevant items in first k items of the list}} {\text{k}}\]
The value of k must be less than or equal to the length of the returned list. Note that the length of the returned list is not part of the calculation.
Relevance is often subjective; even expert human evaluators often disagree on which items are relevant.
Compare with:
precision-recall curve
A curve of precision versus recall at different classification thresholds .
prediction bias
A value indicating how far apart the average of predictions is from the average of labels in the dataset.
Not to be confused with the bias term in machine learning models or with bias in ethics and fairness .
predictive parity
A fairness metric that checks whether, for a given classifier, the precision rates are equivalent for subgroups under consideration.
For example, a model that predicts college acceptance would satisfy predictive parity for nationality if its precision rate is the same for Lilliputians and Brobdingnagians.
Predictive parity is sometime also called predictive rate parity .
See "Fairness Definitions Explained" (section 3.2.1) for a more detailed discussion of predictive parity.
predictive rate parity
Another name for predictive parity .
probability density function
A function that identifies the frequency of data samples having exactly a particular value. When a dataset's values are continuous floating-point numbers, exact matches rarely occur. However, integrating a probability density function from value x
to value y
yields the expected frequency of data samples between x
and y
.
For example, consider a normal distribution having a mean of 200 and a standard deviation of 30. To determine the expected frequency of data samples falling within the range 211.4 to 218.7, you can integrate the probability density function for a normal distribution from 211.4 to 218.7.
Р
отзывать
A metric for classification models that answers the following question:
When ground truth was the positive class , what percentage of predictions did the model correctly identify as the positive class?
Here is the formula:
\[\text{Recall} = \frac{\text{true positives}} {\text{true positives} + \text{false negatives}} \]
где:
- true positive means the model correctly predicted the positive class.
- false negative means that the model mistakenly predicted the negative class .
For instance, suppose your model made 200 predictions on examples for which ground truth was the positive class. Of these 200 predictions:
- 180 were true positives.
- 20 were false negatives.
В этом случае:
\[\text{Recall} = \frac{\text{180}} {\text{180} + \text{20}} = 0.9 \]
See Classification: Accuracy, recall, precision and related metrics for more information.
recall at k (recall@k)
A metric for evaluating systems that output a ranked (ordered) list of items. Recall at k identifies the fraction of relevant items in the first k items in that list out of the total number of relevant items returned.
\[\text{recall at k} = \frac{\text{relevant items in first k items of the list}} {\text{total number of relevant items in the list}}\]
Contrast with precision at k .
ROC (receiver operating characteristic) Curve
A graph of true positive rate versus false positive rate for different classification thresholds in binary classification.
The shape of an ROC curve suggests a binary classification model's ability to separate positive classes from negative classes. Suppose, for example, that a binary classification model perfectly separates all the negative classes from all the positive classes:
The ROC curve for the preceding model looks as follows:
In contrast, the following illustration graphs the raw logistic regression values for a terrible model that can't separate negative classes from positive classes at all:
The ROC curve for this model looks as follows:
Meanwhile, back in the real world, most binary classification models separate positive and negative classes to some degree, but usually not perfectly. So, a typical ROC curve falls somewhere between the two extremes:
The point on an ROC curve closest to (0.0,1.0) theoretically identifies the ideal classification threshold. However, several other real-world issues influence the selection of the ideal classification threshold. For example, perhaps false negatives cause far more pain than false positives.
A numerical metric called AUC summarizes the ROC curve into a single floating-point value.
Root Mean Squared Error (RMSE)
The square root of the Mean Squared Error .
ROUGE (Recall-Oriented Understudy for Gisting Evaluation)
A family of metrics that evaluate automatic summarization and machine translation models. ROUGE metrics determine the degree to which a reference text overlaps an ML model's generated text . Each member of the ROUGE family measures overlap in a different way. Higher ROUGE scores indicate more similarity between the reference text and generated text than lower ROUGE scores.
Each ROUGE family member typically generates the following metrics:
- Точность
- Отзывать
- F 1
For details and examples, see:
ROUGE-L
A member of the ROUGE family focused on the length of the longest common subsequence in the reference text and generated text . The following formulas calculate recall and precision for ROUGE-L:
You can then use F 1 to roll up ROUGE-L recall and ROUGE-L precision into a single metric:
ROUGE-L ignores any newlines in the reference text and generated text, so the longest common subsequence could cross multiple sentences. When the reference text and generated text involve multiple sentences, a variation of ROUGE-L called ROUGE-Lsum is generally a better metric. ROUGE-Lsum determines the longest common subsequence for each sentence in a passage and then calculates the mean of those longest common subsequences.
ROUGE-N
A set of metrics within the ROUGE family that compares the shared N-grams of a certain size in the reference text and generated text . Например:
- ROUGE-1 measures the number of shared tokens in the reference text and generated text.
- ROUGE-2 measures the number of shared bigrams (2-grams) in the reference text and generated text.
- ROUGE-3 measures the number of shared trigrams (3-grams) in the reference text and generated text.
You can use the following formulas to calculate ROUGE-N recall and ROUGE-N precision for any member of the ROUGE-N family:
You can then use F 1 to roll up ROUGE-N recall and ROUGE-N precision into a single metric:
ROUGE-S
A forgiving form of ROUGE-N that enables skip-gram matching. That is, ROUGE-N only counts N-grams that match exactly , but ROUGE-S also counts N-grams separated by one or more words. For example, consider the following:
- reference text : White clouds
- generated text : White billowing clouds
When calculating ROUGE-N, the 2-gram, White clouds doesn't match White billowing clouds . However, when calculating ROUGE-S, White clouds does match White billowing clouds .
R-squared
A regression metric indicating how much variation in a label is due to an individual feature or to a feature set. R-squared is a value between 0 and 1, which you can interpret as follows:
- An R-squared of 0 means that none of a label's variation is due to the feature set.
- An R-squared of 1 means that all of a label's variation is due to the feature set.
- An R-squared between 0 and 1 indicates the extent to which the label's variation can be predicted from a particular feature or the feature set. For example, an R-squared of 0.10 means that 10 percent of the variance in the label is due to the feature set, an R-squared of 0.20 means that 20 percent is due to the feature set, and so on.
R-squared is the square of the Pearson correlation coefficient between the values that a model predicted and ground truth .
С
подсчет очков
The part of a recommendation system that provides a value or ranking for each item produced by the candidate generation phase.
similarity measure
In clustering algorithms, the metric used to determine how alike (how similar) any two examples are.
sparsity
The number of elements set to zero (or null) in a vector or matrix divided by the total number of entries in that vector or matrix. For example, consider a 100-element matrix in which 98 cells contain zero. The calculation of sparsity is as follows:
Feature sparsity refers to the sparsity of a feature vector; model sparsity refers to the sparsity of the model weights.
squared hinge loss
The square of the hinge loss . Squared hinge loss penalizes outliers more harshly than regular hinge loss.
squared loss
Synonym for L 2 loss .
Т
Тестовая потеря
A metric representing a model's loss against the test set . When building a model , you typically try to minimize test loss. That's because a low test loss is a stronger quality signal than a low training loss or low validation loss .
A large gap between test loss and training loss or validation loss sometimes suggests that you need to increase the regularization rate .
top-k accuracy
The percentage of times that a "target label" appears within the first k positions of generated lists. The lists could be personalized recommendations or a list of items ordered by softmax .
Top-k accuracy is also known as accuracy at k .
токсичность
The degree to which content is abusive, threatening, or offensive. Many machine learning models can identify and measure toxicity. Most of these models identify toxicity along multiple parameters, such as the level of abusive language and the level of threatening language.
Потеря обучения
A metric representing a model's loss during a particular training iteration. For example, suppose the loss function is Mean Squared Error . Perhaps the training loss (the Mean Squared Error) for the 10th iteration is 2.2, and the training loss for the 100th iteration is 1.9.
A loss curve plots training loss versus the number of iterations. A loss curve provides the following hints about training:
- A downward slope implies that the model is improving.
- An upward slope implies that the model is getting worse.
- A flat slope implies that the model has reached convergence .
For example, the following somewhat idealized loss curve shows:
- A steep downward slope during the initial iterations, which implies rapid model improvement.
- A gradually flattening (but still downward) slope until close to the end of training, which implies continued model improvement at a somewhat slower pace then during the initial iterations.
- A flat slope towards the end of training, which suggests convergence.
Although training loss is important, see also generalization .
true negative (TN)
An example in which the model correctly predicts the negative class . For example, the model infers that a particular email message is not spam , and that email message really is not spam .
true positive (TP)
An example in which the model correctly predicts the positive class . For example, the model infers that a particular email message is spam, and that email message really is spam.
true positive rate (TPR)
Synonym for recall . То есть:
True positive rate is the y-axis in an ROC curve .
В
убытка валидации
A metric representing a model's loss on the validation set during a particular iteration of training.
См. Также кривая обобщения .
variable importances
A set of scores that indicates the relative importance of each feature to the model.
For example, consider a decision tree that estimates house prices. Suppose this decision tree uses three features: size, age, and style. If a set of variable importances for the three features are calculated to be {size=5.8, age=2.5, style=4.7}, then size is more important to the decision tree than age or style.
Different variable importance metrics exist, which can inform ML experts about different aspects of models.
Вт
Wasserstein loss
One of the loss functions commonly used in generative adversarial networks , based on the earth mover's distance between the distribution of generated data and real data.