VHow do you know a model is good enough to ship?
Sentido da resposta✓
Língua2
Pergunta do entrevistadorMachine learning
Os entrevistadores de funções de machine learning costumam misturar teoria com critério prático. Perguntam o que faz um método, mas também como saberia que um modelo é bom e o que pode correr mal entre um notebook e um produto real. Muitos candidatos conhecem os algoritmos e esquecem a segunda parte.
Use um padrão falado simples: a ideia numa frase, um pequeno exemplo de um problema real e o risco principal. Não comece pela matemática. Se o entrevistador quiser a equação, perguntará, e a sua explicação simples já terá mostrado que a compreende.
- ✓Palavras → expressões → frases → fala
- ✓Sentido da resposta
- ✓Língua
Perguntas habituais e respostas de exemplo
What is the difference between supervised and unsupervised learning?
Qual é a diferença entre aprendizagem supervisionada e não supervisionada?
O que o entrevistador quer ouvir. Com etiquetas (labels) versus sem etiquetas, um exemplo realista de cada e a noção de que a avaliação e o custo de etiquetar são diferentes.
Resposta de exemplo em inglês para praticar em voz altaIn supervised learning, we have labelled examples: for each input, we know the right answer, and the model learns to predict it. Examples are predicting customer churn or marking emails as spam. In unsupervised learning, there are no labels, and the model looks for structure on its own, for example grouping customers into segments with clustering. Supervised results are easier to evaluate, because we can compare predictions with the truth. Unsupervised results need a person to judge whether the groups make sense. In practice, I first ask whether I have reliable labels, because getting good labels is often the hardest and most expensive part.
What is overfitting, and how do you deal with it?
O que é o overfitting e como lida com ele?
O que o entrevistador quer ouvir. Uma definição clara, como o detetar com um conjunto de validação e vários remédios, e não apenas um.
Resposta de exemplo em inglês para praticar em voz altaOverfitting means that the model learns the training data too well, including its noise, so it works well on the training data and badly on new data. The sign is a big gap between the training score and the validation score. To detect it, I always keep a validation set or use cross-validation. To reduce it, I can collect more data, simplify the model, add regularisation, use early stopping or remove noisy features. For trees, I limit the depth. The opposite problem is underfitting: the model is too simple and is bad on both sets. I start with a simple baseline, so I know how much a complex model really adds.
How do you choose an evaluation metric for a classification problem?
Como escolhe uma métrica de avaliação para um problema de classificação?
O que o entrevistador quer ouvir. Por que razão a exatidão (accuracy) pode enganar com dados desequilibrados, precision versus recall e uma ligação ao custo de cada erro.
Resposta de exemplo em inglês para praticar em voz altaThe right metric depends on the cost of each kind of mistake. Accuracy can be misleading when the classes are imbalanced. If only one percent of transactions are fraud, a model that always says "not fraud" is ninety-nine percent accurate and completely useless. So I look at precision and recall. Precision answers: of the cases I flagged, how many were correct? Recall answers: of all the real cases, how many did I find? For fraud or a medical test, I usually want high recall and accept more false alarms. For a spam filter, precision matters more, because blocking a real email is expensive. I choose the threshold together with the business.
What is data leakage, and how do you build features without it?
O que é o data leakage e como constrói features sem ele?
O que o entrevistador quer ouvir. Um exemplo concreto, o hábito de dividir primeiro, divisões por tempo e uma pergunta a fazer sobre cada feature.
Resposta de exemplo em inglês para praticar em voz altaData leakage is when the model gets information during training that it will not have at prediction time. The result is a great score in the notebook and a poor result in production. A common example is a feature that is created after the event, like a refund flag when we predict churn. Another is fitting a scaler on the whole dataset before the split. So I split the data first and do all feature engineering inside a pipeline fitted on the training part only. For time-based problems, I split by time, not randomly. For every feature, I ask: will I know this value at prediction time?
How do you take a model to production and keep it healthy?
Como leva um modelo para produção e o mantém saudável?
O que o entrevistador quer ouvir. Empacotamento, forma de disponibilização (serving), lançamento seguro, monitorização do data drift e um plano de retreino e de rollback.
Resposta de exemplo em inglês para praticar em voz altaA model in a notebook is only the first step. For production, I package the model together with its preprocessing, version it, and serve it either as an API for real-time predictions or as a batch job. Before the release, I compare it with the current solution, often in shadow mode or with an A/B test. After the release, I monitor the service, like latency and errors, but also the input data and the predictions. The world changes, so the data can drift, and the quality drops silently. I set alerts, keep the option to roll back, and plan retraining. I also make sure that features are calculated in the same way in training and in serving.
Como pronunciar os termos-chave
- overfitting
- ôu-ver-fí-ting
- precision
- pri-sí-jan
- recall
- rí-kol
- regularisation
- rég-iu-lai-zêi-chan
- gradient
- grêi-di-ent
- variance
- vé-ri-ans
- feature
- fí-tcher
Frases úteis para responder
- It depends on the cost of a false positive and a false negative.Depende do custo de um falso positivo e de um falso negativo.
- First I would build a simple baseline.Primeiro eu construiria uma linha de base (baseline) simples.
- The model works well on the training data but not on new data.O modelo funciona bem com os dados de treino, mas não com dados novos.
- I would check for data leakage.Eu verificaria se há data leakage.
- We measured it on a held-out test set.Medimos num conjunto de teste reservado (held-out).
- The data may have drifted since we trained the model.Os dados podem ter mudado (drift) desde que treinámos o modelo.
- I would validate this with an experiment.Eu validaria isto com uma experiência.
Erros comuns a evitar
- Confundir "feature" e "future". Feature diz-se fí-tcher e future diz-se fiú-tcher, e nesta área diz-se "feature" o dia inteiro.
- Ler números de forma pouco clara. Diga "zero point nine five" ou "ninety-five percent" e cuidado com a sílaba tónica de fifteen (fifTEEN) e de fifty (FIFty).
- Citar a exatidão sem mencionar o equilíbrio das classes. Uma exatidão elevada com dados desequilibrados pode não significar nada.
- Começar por uma rede neuronal profunda para todos os problemas. Em muitos problemas com dados tabulares, um modelo simples é uma linha de base forte, e dizê-lo mostra critério.
- Descrever o modelo sem nunca falar do objetivo de negócio. Diga que decisão a previsão apoia e como saberia que ajudou.
Perguntas frequentes
Quanta matemática preciso de explicar?
Deve conseguir explicar a intuição por trás dos modelos e das funções de perda mais comuns e descrever o gradient descent de forma simples. As demonstrações longas são mais comuns em funções de investigação do que em funções aplicadas.
Que ferramentas devo mencionar?
Nomeie as que realmente usou, por exemplo scikit-learn, PyTorch ou XGBoost, e diga como registava as experiências e as versões. Uma lista curta e honesta é melhor do que uma longa.
Como falo de um projeto quando os dados são confidenciais?
Descreva o tipo de problema, o tipo de dados e a sua abordagem sem nomes nem números exatos. Concentre-se nas suas decisões: como dividiu os dados, que métrica escolheu e o que fez quando o primeiro modelo falhou.
Ler uma resposta não é o mesmo que dizê-la. Pratique cada pergunta em voz alta e depois compare o sentido e a língua da sua própria resposta.
Experimentar o SpeakRole ↗