Imaginez que vous construisez un algorithme de recommandation pour votre nouveau site en ligne. Comment mesurez-vous sa qualité, pour vous assurer que son envoi des utilisateurs de contenu pertinent et personnalisé Click-through taux peut être votre espoir initial, mais après un peu de réflexion, ce n'est pas clair que c'est le meilleur paramètre après tout. Prenez le moteur de recherche Googles. Dans de nombreux cas, l'amélioration de la qualité des résultats de recherche diminuera CTR Par exemple, le scénario idéal pour les requêtes comme Quand était Barack Obama né est que les utilisateurs n'ont jamais à cliquer, puisque la question doit être répondu sur la page elle-même. Ou prendre Twitter, qui un jour pourrait vouloir vous recommander des tweets intéressants. Les paramètres comme CTR, ou même le nombre de favoris et de retweets, seront probablement optimisés pour montrer rapidement un-liners et des photos de chats drôles. Mais est-ce que Reddit-comme le site ce que Twitter veut vraiment être Twitter, pour beaucoup de gens, a commencé comme un site de nouvelles, de sorte que les utilisateurs peuvent préférer voir des liens vers un contenu plus profond et plus intéressant, même si theyre moins susceptibles de cliquer sur chaque suggestion global. Ou prenez eBay, qui veut vous aider à trouver les produits que vous voulez acheter. CTR est-il une bonne mesure Peut-être pas: plus de clics peuvent être une indication que youre avoir du mal à trouver ce que vous cherchez. Qu'en est-il des revenus Qui pourrait ne pas être idéal non plus: du point de vue de l'utilisateur, vous voulez faire vos achats au plus bas prix possible, et en optimisant pour les revenus, eBay peut être vous tournant vers des produits plus chers qui vous font un client moins fréquent dans le long terme. Donc, sur de nombreux sites en ligne, il n'est pas clair comment mesurer la qualité de la personnalisation et des recommandations en utilisant des métriques comme CTR, ou le revenu, ou le temps de séjour, ou autre. Ce qui est un ingénieur à faire Bien, considérer le fait que beaucoup d'entre eux sont des algorithmes de pertinence. Google veut vous montrer des résultats de recherche pertinents. Twitter veut vous montrer des tweets et des annonces pertinentes. Netflix veut vous recommander des films pertinents. LinkedIn veut vous trouver des personnes pertinentes à suivre. Alors pourquoi, si souvent, ne jamais essayer de mesurer la pertinence de nos modèles Im un grand fan de l'homme dans la machine des techniques. Afin de contourner ce problème, je vais parler d'une approche d'évaluation humaine pour mesurer la performance des produits de personnalisation et de découverte. En particulier, je vais utiliser l'exemple des suggestions de livre sur Amazon comme je marche à travers le reste de ce post. Amazon et déménagement au-delà des métriques basées sur les logs (Continuons de motiver un peu pourquoi les mesures log-based sont souvent des mesures imparfaites de pertinence et de qualité, car c'est un point important, mais difficile à comprendre). L'article a également acheté la caractéristique, qui essaye de vous montrer des livres reliés. Pour mesurer son efficacité, l'approche standard consiste à exécuter une expérience en direct et à mesurer la variation des paramètres, comme les revenus ou le CTR. Mais imaginez que nous remplaçons soudainement toutes les suggestions de livre Amazones par la pornographie. Whats going to happen CTRs susceptibles de tirer à travers le toit Ou supposons que nous remplaçons tous les Amazones liés livres avec des articles plus brillants, plus chers. Encore une fois, CTR et les revenus sont susceptibles d'augmenter, comme le contenu flashier dessine globes oculaires. Mais est-ce tout sauf un coup de pouce à court terme Peut-être le changement diminue les ventes totales à long terme, comme les clients commencent à trouver Amazon trop cher pour leurs goûts et se déplacer vers d'autres marchés. Des scénarios comme ceux-ci sont l'analogue de l'apprentissage automatique de la transformation des annonces en chapiteaux clignotants. Bien qu'ils puissent augmenter les clics et les vues au départ, ils ne sont probablement pas optimiser le bonheur des utilisateurs ou la qualité du site pour l'avenir. Alors, comment pouvons-nous les éviter, et de veiller à ce que la qualité de nos suggestions reste toujours élevé Il s'agit d'un algorithme liés livres, après tout, pourquoi, en s'en tenant à une expérience en direct et des métriques comme CTR, ne sont nulle part inspecter la relation de nos recommandations Solution d'évaluation humaine: permet d'injecter des humains dans le processus. Les ordinateurs ne peuvent pas mesurer la parenté (s'ils le pouvaient, se faire), mais les gens peuvent évidemment le faire. Par exemple, dans la capture d'écran ci-dessous, j'ai demandé à un travailleur (sur une plate-forme de crowdsourcing Ive construit sur mon propre) pour évaluer les trois premiers clients qui ont acheté ce également acheté des suggestions pour un livre sur barnesandnoble. (Copie du texte de la capture d 'écran: Fools Assassin) par Robin Hobb. (Livre original) Je viens de lire ceci récemment, mais c'est l' un de mes favoris de cette année. Le genre fantastique, mais souvent son style stylistique est tout à fait semblable. Le roman a eu une manière merveilleuse avec des personnages et de la narration. L'enregistrement était absolument déchirante et me conduire à vouloir un autre livre. Le Broken Eye (Lightbringer Series 3) par Brent Weeks. C'est une bonne, mais pas super, recommandation. Ce livre semble assez intéressant. C'est le troisième d'une série bien, donc je dois voir comment j'aime le premier couple de livres d'abord. Poiture et lumière: un roman de sanctuaire. Berg (second ouvrage lié) C'est une recommandation correcte Im pas tellement familier avec cet auteur, mais j'aime certains de la prémisse du livre Je connais le dicton Ne jugez pas un livre par sa couverture. À moi et sorte de me tourne hors du livre. Par Anthony Ryan. (Troisième livre connexe) C'est un bon, mais pas super, recommandation. Un autre auteur complètement inconnu pour moi (un peu comme cela, mais, il me montre de nouveaux endroits pour chercher des livres) C'est aussi une suite, cependant, donc je dois voir comment j'ai aimé le premier livre avant d'acheter celui-ci.) Les recommandations Sont décents, mais déjà nous voyons un couple de moyens pour les améliorer: D'abord, deux des recommandations (The Broken Eye et Tower Lord) font chacun partie d'une série, mais pas Book 1. Donc, une amélioration serait de s'assurer que seules les séries Les introductions sont affichées à moins qu'elles ne suivent le livre principal. En fait, la deuxième suggestion ressemble plus à un roman d'amour de fantaisie que le genre de fantaisie que Robin Hobb tend à écrire. (Donc peut-être BampN devrait investir dans un apprentissage approfondi.) CTR et les revenus ne nous donnera certainement pas ce niveau d'information, et il n'est pas clair qu'ils pourraient même nous dire nos algorithmes produisent des suggestions non pertinentes en premier lieu. Nulle part le panneau de défilement associé ne précise que deux des livres font partie d'une série, ainsi le CTR sur ces deux livres serait juste aussi haut que si elles étaient en fait les introductions de série. Et si les revenus sont faibles, ce n'est pas clair si c'est parce que les suggestions sont mauvaises ou parce que, séparément, nos algorithmes de tarification doivent être améliorés. Ainsi, en général, heres une façon de comprendre la qualité d'un Do This Next algorithme: Prenez un tas d'articles (par exemple des livres si étaient Amazon ou Barnes amp Noble), et de générer leurs frères connexes. Envoyez ces paires à un groupe de juges (par exemple, en utilisant une plateforme de crowdsourcing comme Mechanical Turk) et demandez-leur d'évaluer leur pertinence. Analyser les données qui reviennent. Algorithmic Pertinence sur Amazon, Barnes amp Noble, et Google Lets rendre ce processus concret. Pretend Im un VP fraîchement frappé de ce que les clients achètent également à Amazon, et je veux comprendre les défauts de produits et les étoiles. J'ai commencé par aller à Mechanical Turk et demander à quelques centaines de travailleurs de prendre un livre qu'ils ont aimé au cours de la dernière année et de le trouver sur Amazon. Theyd puis prendre les trois premières suggestions de livres connexes d'un auteur différent, les évaluer sur l'échelle suivante, et d'expliquer leurs cotes. Grande suggestion. Id certainement l'acheter. (Très positif) suggestion décente. Je pourrais l'acheter. (Légèrement positive) Pas une bonne suggestion. Je ne l'acheterais probablement pas. (Légèrement négatif) Terrible suggestion. Je ne voudrais certainement pas l'acheter. (Très négatif) (Note: Je préfère généralement une échelle Likert à trois ou cinq points avec une option neutre, mais je me sentais un peu sauvage.) Par exemple, voici comment un évaluateur a passé en revue les livres associés pour Anne Rices The Wolves De l'hiver. En fait, 47 des évaluateurs ont dit qu'ils achetaient certainement le premier livre lié, 29 autres disaient qu'il était assez bon pour qu'ils l'achètent, et seulement 24 des évaluateurs n'aimaient pas la suggestion. Les deuxième et troisième suggestions de livres, bien qu'un peu pire, semblent performer assez bien aussi: environ 65 des évaluateurs les ont jugés positifs. Que pouvons-nous apprendre des mauvaises notes J'ai couru une tâche de suivi qui a demandé aux travailleurs de catégoriser les mauvais livres liés, et heres la ventilation. Relatif, mais sous-sujet différent. Il s'agissait de livres qui étaient généralement liés au livre original, mais qui étaient dans un sous-thème différent que le rater n'était pas intéressé po Par exemple, le premier livre connexe pour Sun Tzus L'art de la guerre (un livre nominalement sur la guerre, Mais qui aujourd'hui est devenu plus d'un livre de la vie) était sur la guerre (un traité de guerre), mais le rater n'était pas réellement intéressé par les aspects militaires: je n'achèterais pas ce livre, car il se concentre uniquement sur la guerre militaire. Je ne m'intéresse pas à cela. Je m'intéresse aux tactiques mentales qui m'aident à prospérer dans la vie. Complètement sans rapport. C'étaient des suggestions de livre qui n'étaient absolument pas liées au livre original. Par exemple, un dictionnaire Scrabble apparaissant sur la page de The Art of War. Inintéressant. C'étaient des suggestions qui étaient liées, mais dont les scénarios n'ont pas fait appel à l'évaluateur. Le scénario ne semble pas excitant. Je ne suis pas un ventilateur de chien et son environ un chien. Mauvais public. C'étaient des suggestions de livres dont le public cible était très différent de celui des livres originaux. Dans de nombreux cas, par exemple, une suggestion de livre connexe serait un livre pour enfants, mais le livre original serait orienté vers les adultes. Cela semble être un livre pour enfants. Si j'avais un enfant, je l'acheterai certainement, hélas, je ne le fais pas, donc je n'en ai pas besoin. Type de livre erroné. Les suggestions dans cette catégorie étaient des articles comme des manuels scolaires ou apparaissant aux côtés de romans. Auteur mal aimé. Ces recommandations ont été faites par des auteurs semblables, mais que le rédacteur n'a pas aimé. Je n'aime pas Amber Portwood. Je ne voudrais certainement pas vouloir lire un livre par et au sujet d'elle. Pas la première en série. Quelques recommandations de livre seraient pour une série intéressante le rater n'était pas familier avec, mais ils wouldnt être le premier livre dans la série. Mauvaise cote. C'étaient des suggestions de livre qui avaient une cote d'Amazon particulièrement faible. Afin d'améliorer leurs recommandations, Amazon pourrait essayer d'améliorer ses modèles de sujets, ajouter des fonctionnalités basées sur l'âge à ses livres, de distinguer entre les manuels et les romans, et d'investir dans les détecteurs de série. (Bien sûr, pour tout ce que je sais, ils font tout cela déjà.) Analyse concurrentielle Nous avons maintenant une compréhension générale des Amazones suggestions de livres connexes et comment ils pourraient être améliorés, et tout comme nous pourrions citer une métrique comme un CTR de 6.2 ou Whatnot, nous pouvons aussi maintenant citer un score de pertinence de 0,62 (ou quoi que ce soit). Alors laissez-vous tourner à la question de comment Amazon se compare à d'autres libraires en ligne comme Barnes amp Noble et Google Play. J'ai pris la même tâche que j'ai utilisé ci-dessus, mais cette fois-ci demandé aux évaluateurs d'examiner les suggestions connexes sur ces deux sites ainsi. Barnes amp Nobless algorithme sont presque aussi bon que les Amazones. Les trois premières suggestions ont été classées positives 58 fois, contre 68 sur Amazon. Mais Play Store recommandations sont atroces. Un énorme 51 de Googles recommandations livres connexes ont été marqués terrible. Pourquoi les suggestions Play Stores sont-elles si mauvaises? Laissez-vous regarder quelques exemples. Voici la page Play Store de John Greens The Fault dans Our Stars. Un critique-aimé-il livre sur le cancer et le roman (et maintenant aussi un film). Deux des suggestions sont complètement aléatoires: un manuel Excel mal évalué et un manuel mal évalué sur la santé sexuelle. Les autres sont des livres de cow-boy complètement indépendants, par un autre John Green. Voici la page pour The Strain. Dans ce cas, toutes les suggestions sont dans un langage différent Et il n'y en a que quatre. Encore une fois, demander aux évaluateurs de catégoriser toutes les mauvaises recommandations de Play Stores. 45 du temps, les suggestions de livre connexes étaient complètement sans rapport avec le livre original en question. Par exemple: affichage d'un manuel de physique sur la page d'un roman d'amour. 32 du temps, il n'y avait tout simplement pas une suggestion de livre à tous. (Im deviner le catalogue Play Bookstores est assez limité.) 14 du temps, les livres connexes étaient dans une langue différente. Donc, malgré Googles state-of-the-art apprentissage de la machine ailleurs, ses suggestions Play Store ne pouvait pas vraiment devenir pire. Side-by-Sides Laisse un peu de recul. Jusqu'à présent, je me suis concentré sur un paradigme de jugements absolus, dans lequel les juges jugent à quel point un livre est pertinent à l'original sur une échelle absolue. Ce modèle est idéal pour la compréhension de la qualité globale de l'Amazonie livre connexes algorithme. Dans de nombreux cas, cependant, nous voulons utiliser l'évaluation humaine pour comparer les expériences. Par exemple, il est commun à de nombreuses entreprises de: Lancer un test AB d'évaluation humaine avant une expérience en direct, à la fois pour éviter d'envoyer accidentellement des expériences incroyablement buggy aux utilisateurs, ainsi que pour éviter la longue attente requise dans les tests en direct. Utiliser un score de pertinence généré par l'humain comme supplément aux paramètres d'expérience en live lors des décisions de lancement. Pour ces types de tâches, ce qui est préférable est souvent un modèle côte à côte, dans lequel les juges sont donnés deux articles et a demandé lequel est meilleur. Après tout, les jugements comparatifs sont souvent beaucoup plus faciles à faire que les absolus, et nous pourrions vouloir détecter des différences à un niveau plus fin que ce qui est disponible à l'échelle absolue. L'idée est que nous pouvons attribuer une note à chaque note (négative, disons, si le rater préfère l'élément de contrôle positif si le rater préfère l'expérience), et nous les agréger pour former une note globale pour le côte à côte. Ensuite, de la même façon que les chutes dans CTR peut bloquer un lancement d'expérience, un score d'évaluation humaine négative devrait également donner beaucoup de source de préoccupation. Malheureusement, je n'ai pas un moyen facile de générer des données pour un côte à côte (bien que je pourrais effectuer un côté à côté sur Amazon vs Barnes amp Noble), donc mal omettre un exemple, mais l'idée devrait être jolie clair. Personnalisation Voici une autre subtilité. Dans mes exemples ci-dessus, j'ai demandé aux évaluateurs de choisir eux-mêmes un livre de départ (celui qu'ils ont lu et aimé au cours de l'année écoulée), puis évaluer s'ils voudraient personnellement lire les suggestions connexes. Une autre approche consiste à choisir les livres de départ pour les évaluateurs, et ensuite avoir le taux les suggestions connexes plus objectivement, en essayant de se mettre dans la peau de quelqu'un whod être intéressé par l'élément de départ. Quelle approche est meilleure Comme vous pouvez probablement deviner, theres pas de réponse claire, il dépend de la tâche et les objectifs à portée de main. Avantages de la première approche: Son beaucoup plus nuancé. Il peut souvent être difficile de vous mettre dans quelqu'un chaussures elses: quelqu'un de lecture Harry Potter être intéressé par Twilight D'une part, theyre deux livres de fantaisie d'autre part, Twilight semble un peu plus orientée vers le public féminin. Avantages de la deuxième approche: Parfois, l'objectivité est une bonne chose. (Si vous vous souciez vraiment si quelqu'un n'aime pas Twilight simplement parce que Edward lui rappelle son petit ami) Permettre aux gens de choisir leurs articles de départ peut biaiser certaines métriques. Par exemple, les gens sont beaucoup plus susceptibles de choisir des livres populaires pour évaluer, alors que nous pourrions vouloir mesurer la qualité des suggestions Amazones à travers une plus large, plus représentatif tranche de son catalogue. Examinons ce que j'ai discuté jusqu'ici. Des mesures en ligne, basées sur des logs comme le CTR et le revenu ne sont pas nécessairement les meilleures mesures d'une qualité d'algorithmes de découverte. Les éléments avec un CTR élevé, par exemple, peuvent être simplement raciaux et flashy, pas les plus pertinents. Donc, au lieu de compter sur ces procurations, permet de mesurer directement la pertinence de nos recommandations en demandant à un groupe d'évaluateurs humains. Il existe plusieurs approches différentes pour l'envoi des éléments à juger. Nous pouvons laisser les évaluateurs choisir les éléments (une approche qui est souvent nécessaire pour les algorithmes personnalisés), ou nous pouvons générer les éléments nous-mêmes (souvent utile pour des tâches plus objectives comme la recherche cela a également l'avantage de rendre plus facile de dériver la popularité pondérée Ou des mesures uniformément pondérées de pertinence). Nous pouvons également adopter une approche de jugement absolu, ou utiliser côte à côte. En analysant les données de nos évaluations, nous pouvons prendre de meilleures décisions de lancement, découvrir des exemples où nos algorithmes fonctionnent très bien ou très mal et trouver des schémas d'amélioration. Quels sont certains des avantages et des applications Comme mentionné, les métriques log-based comme CTR et les revenus ne captent pas toujours les signaux que nous voulons, ainsi les scores générés par l'homme de pertinence (ou d'autres dimensions) sont des compléments utiles. Les évaluations humaines peuvent rendre l'itération plus rapide et plus facile. Un changement d'algorithme peut normalement nécessiter des semaines de tests en direct avant de recueillir suffisamment de données pour savoir comment elle affecte les utilisateurs, mais nous pouvons facilement avoir une tâche jugée par les humains dans quelques heures. Imagine était une société de publicité, et nous choisissons les annonces à diffuser sur la base d'une combinaison de CTR et de revenus. Une fois que nous avons recueilli des centaines de milliers de jugements de pertinence à partir de nos évaluations, nous pouvons construire un modèle d'apprentissage basé sur la pertinence de la machine à ajouter au mélange, injectant ainsi une mesure plus directe de la qualité dans le système. Comment pouvons-nous décider quelles améliorations doivent être apportées à nos modèles? Les évaluations nous donnent des commentaires très concrets et des exemples précis sur ce qui fonctionne et ce qui est faux. Dans l'esprit des similitudes item-item, voici quelques autres messages que les lecteurs de ce post pourraient également lire. Et finalement, je terminerai avec un appel d'information. Faites-vous des évaluations ou utilisez des plates-formes de crowdsourcing comme Mechanical Turk ou Crowdflower (que ce soit à des fins d'évaluation ou pas) Ou voulez-vous Id amour de vous parler pour en savoir plus sur ce que vous faites, alors n'hésitez pas à m'envoyer un Email et me frapper Imaginez que vous venez de commencer un emploi dans une nouvelle entreprise. Vous avez regardé la Seconde Guerre mondiale récemment, alors vous êtes dans un climat de scepticisme, et étant donné que vos deux dernières startups ont échoué de ce que vous croyez être un manque de données, vous donnez tout un œil critique supplémentaire. Vous commencez par penser à l'impact de l'équipe de vente. Combien de recettes supplémentaires sont-ils générer pour l'entreprise Les gens de ventes youve rencontré dire que plus de 90 des prospects theyve parlé à finir par acheter le produit de l'entreprise, mais vous vous demandez, combien de ces prospects aurait converti de toute façon Vous jetez un oeil Les journaux, et noter quelque chose d'intéressant: la semaine dernière a été la semaine de hack, et la moitié de la force de vente a pris le temps de faire des appels pour faire des cartes Marauders à la place, mais le taux de conversé conduit est resté le même. Soudain, l'un de vos coéquipiers tombe près de votre bureau. Il fait un lot de Soylent. Et il veut que vous preniez une gorgée. Il semble désagréable, alors vous demandez quels sont les avantages, et il répond que ses amis qui ont été boire pour les derniers mois a juste couru un marathon Oh, ils ont juste commencer à courir Nope, ils ont couru le marathon l'année dernière aussi. Inspiré par une histoire vraie. Inférence causale Causalité est extrêmement important, mais souvent extrêmement difficile à établir. Est-ce que votre personnel de vente effectivement efficace, ou sont-ils tout simplement parler aux clients qui envisagent déjà de convertir est Soylent (ou votre entreprise Million de dollars) valent vraiment votre temps Dans un monde idéal, wed être en mesure d'exécuter des expériences de l'étalon-or pour mesurer la causalité quand on le souhaite. Dans le monde réel, cependant, nous ne pouvons pas. Il ya des raisons éthiques de donner à certains patients des placebos, ou des médicaments dangereux et non testés. La direction peut ne pas vouloir prendre un revenu potentiel à court terme frappé en affectant des ventes aux clients aléatoires, et une équipe gagnant des primes commission-basées peut rebelle contre la pensée aussi bien. Comment pouvons-nous comprendre les élévations causales en l'absence d'un test AB C'est ici que la modélisation de la propension, ou d'autres techniques d'inférence causale, entre en jeu. Modélisation de la propension So supposons que nous voulons modéliser l'effet de la consommation de Soylent en utilisant une technique de modèle de propension. Pour expliquer l'idée, commençons par une expérience de pensée. Imaginez Brad Pitt a un frère jumeau, indistinguable dans tous les sens: Brad 1 et Brad 2 se réveillent dans le même temps, ils mangent les mêmes aliments, ils exercent la même quantité, et ainsi de suite. Un jour, Brad 1 arrive à recevoir le dernier lot de Soylent d'un commerçant dans la rue, tandis que Brad 2 ne le fait pas, et donc seul Brad 1 commence à incorporer Soylent dans son alimentation. Dans ce scénario, toute différence de comportement ultérieure entre les jumeaux est précisément l'effet de boissons. En prenant ce scénario dans le monde réel, une façon d'estimer l'effet Soylents sur la santé serait la suivante: Pour chaque buveur Soylent, trouver un abstention Soylent whos aussi proche d'un match que possible. Par exemple, nous pourrions faire correspondre un Soy-l-potable Jay-Z avec un non-Soylent Kanye, un Soylent-potable Natalie Portman avec une non-Soylent Keira Knightley, et un Soylent-boire JK Rowling avec un non-Soylent Stephenie Meyer. Nous mesurons l'effet Soylents comme la différence entre chaque paire de jumeaux. Cependant, trouver des jumeaux intimement liés est extrêmement difficile dans la pratique. Est-Jay-Z vraiment un match serré avec Kanye, si Jay-Z dort une heure de plus en moyenne Qu'en est-il de la modélisation Jonas Brothers et One Direction Propension. Alors, est une simplification de cette procédure de jumelage. Au lieu de faire correspondre des paires de personnes en fonction de toutes les variables que nous avons, nous allons simplement faire correspondre tous les utilisateurs sur la base d'un seul nombre, la probabilité (propension) qu'ils commencent à boire Soylent. Plus en détail, voici comment construire un modèle de propension. Tout d'abord, sélectionnez les variables à utiliser en tant que fonctionnalités. (Par exemple, quels aliments mangent, quand ils dorment, où ils vivent, etc.) Ensuite, construisez un modèle probabiliste (disons, une régression logistique) basé sur ces variables pour prédire si un utilisateur va commencer à boire Soylent ou non. Par exemple, notre groupe de formation pourrait être composé d'un groupe de personnes, dont certains ont commandé Soylent au cours de la première semaine de mars 2014, et nous formerions le classificateur pour modéliser les utilisateurs devenant les utilisateurs de Soylent. L'estimation probabiliste des modèles que l'utilisateur va commencer à boire Soylent est appelé un score de propension. Formez un certain nombre de seaux, disons 10 seaux au total (un seau couvre les utilisateurs avec un 0.0 - 0.1 propension à prendre la boisson, un seau deuxième couvre les utilisateurs avec une propension 0.1-0.2, et ainsi de suite), et place les gens dans chacun . Enfin, comparez les buveurs et les non-buveurs dans chaque seau (par exemple en mesurant leur activité physique, leur poids ou toute autre mesure de santé) pour estimer l'effet causal de Soylents. Par exemple, voici une distribution hypothétique des âges Soylent et non Soylent. Nous voyons que les buveurs ont tendance à être un peu plus âgés, et ce fait confusion est une des raisons que nous ne pouvons pas simplement exécuter une analyse corrélationnelle. Après avoir formé un modèle pour estimer la propension Soylent et les utilisateurs du groupe dans des seaux de propension, ceci pourrait être un graphique de l'effet que Soylent a sur un kilométrage hebdomadaire des personnes. Dans le graphique (hypothétique) ci-dessus, chaque rangée représente un seau de propensité de personnes, et la semaine d'exposition indique la première semaine de mars, lorsque le groupe de traitement a reçu son envoi Soylent. Nous voyons qu'avant cette semaine, les deux groupes de personnes suivent assez bien. Après le groupe de traitement (les buveurs Soylent) démarrer leur plan, cependant, leur kilométrage hebdomadaire rampes en place, ce qui forme notre estimation de l'effet de causalité boissons. D'autres méthodes d'inférence causale Bien sûr, il existe de nombreuses autres méthodes d'inférence causale sur les données d'observation. Je vais courir à travers deux de mes favoris. (J'ai écrit à l'origine ce post en réponse à une question sur Quora, c'est pourquoi je prends mes exemples à partir de là.) Régression Discontinuity Quora a récemment commencé à afficher des insignes de statut sur les profils de ses meilleurs auteurs. Donc supposons que nous voulons comprendre l'effet de cette fonctionnalité. (Supposons qu'il est impossible d'exécuter un test AB dès que la fonctionnalité a été lancée). Plus précisément, le badge lui-même amener les utilisateurs à gagner plus de followers Pour la simplicité, supposons que le badge a été donné à tous les utilisateurs qui ont reçu au moins 5000 upvotes En 2013. L'idée derrière un modèle de discontinuité de régression est que la différence entre les utilisateurs qui reçoivent à peine un badge Top Writer (c'est-à-dire recevoir 5000 upvotes) et ceux qui ne reçoivent que 4999 upvotes est plus ou moins chance aléatoire, De sorte que nous pouvons utiliser ce seuil pour estimer un effet causal. Par exemple, dans le graphique imaginaire ci-dessous, la discontinuité à 5000 upvotes suggère qu'un badge Top Writer conduit à environ 100 adeptes en moyenne. Expériences naturelles Comprendre l'effet d'un badge Top Writer est une question assez intéressante, cependant. Une question plus profonde et plus fondamentale pourrait être de se poser: que se passe-t-il lorsqu'un utilisateur découvre un nouvel écrivain qu'il aime? L'écrivain les inspire-t-il à écrire une partie de leur propre contenu, à explorer plus Les mêmes sujets, et à travers la curation les amener à s'engager avec le site encore plus Quelle importance, en d'autres termes, est la connexion à un grand utilisateur par opposition à la lecture de grands messages aléatoires, j'ai étudié une question analogue quand j'étais chez Google, Donc au lieu de faire une étude de cas imaginaire Quora, Ill décrire une partie de ce travail ici. Supposons donc que nous voulons comprendre ce qui se passerait si nous pouvions faire correspondre les utilisateurs à la chaîne YouTube parfaite. Quelle est la valeur de la recommandation ultime Le fait de tomber amoureux d'une nouvelle chaîne entraîne un engagement au-delà de l'activité sur la chaîne elle-même, peut-être parce que les utilisateurs reviennent à YouTube spécifiquement pour la nouvelle chaîne et restent à regarder plus (un effet multiplicatif) TV monde, par exemple, peut-être beaucoup de gens restent à la maison le dimanche soir spécifiquement pour capturer le dernier épisode de Real Housewives, et canal de surf pour encore plus de divertissement une fois son plus. Est-ce que tomber amoureux d'un nouveau canal simplement augmenter l'activité sur le canal seul (un effet additif) Un nouveau canal de remplacer l'engagement existant sur YouTube Après tout, peut-être que les utilisateurs ont seulement une quantité limitée de temps qu'ils peuvent passer sur le site. (Un effet neutre) Est-ce que le canal parfait fait réellement que les utilisateurs passent moins de temps globalement sur le site, puisqu'ils passent peut-être moins de temps à parcourir et naviguer sur les canaux une fois qu'ils ont des canaux concrets qu'ils connaissent (effet négatif) , Un test AB serait idéal, mais son impossible dans ce cas à courir: nous ne pouvons pas obliger les utilisateurs à tomber en amour avec un canal (nous pouvons leur recommander des canaux, mais theres aucune garantie theyll effectivement comme eux), et nous ne pouvons bloquer de force Certains canaux. Une approche consiste à utiliser une expérience naturelle (un scénario dans lequel l'univers lui-même génère en quelque sorte une affectation aléatoire) pour étudier cet effet. Voici l'idée. Considérez un utilisateur qui télécharge une nouvelle vidéo tous les mercredis. Un mois, il laisse ses abonnés savoir qu'il ne sera pas le téléchargement de nouvelles vidéos pour quelques semaines, alors qu'il va en vacances. Comment ses abonnés répondent Ne cessent-ils de regarder YouTube le mercredi, puisque son canal était la seule raison de leurs visites Ou est-ce que leur activité est relativement peu affectée, puisqu'ils ne regardent que son contenu quand il apparaît sur la première page Imaginez, Commence à télécharger une nouvelle vidéo tous les vendredis. Est-ce que ses abonnés commencent à visiter aussi alors Et maintenant qu'ils sont sur YouTube, ils restent simplement pour la nouvelle vidéo, ou leur visite mène-t-elle à un puits de recherches et de contenu connexe trop? Il s'avère que ces scénarios se produisent. Par exemple, heres un calendrier de quand une chaîne populaire télécharge des vidéos. Vous pouvez voir qu'en 2011, il a eu tendance à télécharger des vidéos les mardis et vendredis, mais il est passé à des téléchargements le mercredi et le samedi à la fin de l'année. En utilisant ce changement comme une expérience naturelle qui quasi-aléatoire enlève un canal bien-aimé sur certains jours et l'introduit sur d'autres, nous pouvons essayer de comprendre l'effet de réussir à faire la recommandation parfaite. (Un exemple qui illustre peut-être mieux l'idée, supposons que nous voulons comprendre l'effet du revenu sur la santé mentale.) Nous ne pouvons pas obliger certaines personnes à devenir pauvres ou riches, Un article de NY Times décrit une expérience naturelle quand un groupe d'Indiens Cherokee a distribué des bénéfices de casino à ses membres, en soustrayant ainsi au hasard certains d'entre eux hors de la pauvreté. Un autre exemple, en supposant theres rien de spécial au sujet de la période dans laquelle hack Semaine est l'utilisation de la semaine hack comme un instrument qui empêche quasiment aléatoirement l'équipe de vente de faire leur travail, comme dans le scénario que j'ai décrit ci-dessus.) Découvrir les facteurs de croissance Laisse revenir à la modélisation de la propension. Imaginez que vous faisiez partie de l'équipe de croissance de notre entreprise et que vous étiez chargés de déterminer comment transformer les utilisateurs occasionnels du site en utilisateurs qui retournent chaque jour. Que faisons-nous? L'approche de la modélisation de la propension pourrait être la suivante. Nous pourrions prendre une liste de fonctionnalités (installation de l'application mobile, connexion, inscription à un bulletin d'information, suivi de certains utilisateurs, etc.) et construire un modèle de propension pour chacun d'eux. Nous pourrions ensuite classer chaque caractéristique par son effet causal estimé sur l'engagement, et utiliser la liste ordonnée de fonctionnalités pour hiérarchiser notre prochain sprint. (Ou nous pourrions utiliser ces chiffres afin de convaincre l'équipe d'exécution que nous avons besoin de plus de ressources.) Il s'agit d'une version un peu plus sophistiquée de l'idée de construire un modèle de régression de l'engagement (ou un modèle de régression de chute) et d'examiner les poids sur Chaque caractéristique. Malgré l'écriture de ce post, cependant, je reconnais Im généralement pas un fan de la propension à la modélisation pour de nombreuses applications dans le monde de la technologie. (Je n'ai pas travaillé dans le domaine médical, donc je n'ai pas une opinion forte sur son utilité là-bas, mais je pense que c'est un peu plus nécessaire là-bas.) Ill sauver plus de mes raisons pour un autre moment, mais après tout, inférence causale est extrêmement Difficile, et n'allait jamais être en mesure de contrôler pour tous les influenceurs cachés qui peuvent biaiser un traitement. En outre, le simple fait que nous devons choisir les caractéristiques à inclure dans notre modèle (et n'oubliez pas: les caractéristiques de construction est très long et difficile) signifie que nous avons déjà une croyance forte sur l'utilité de chaque caractéristique, alors que wed Vraiment comme de faire est de découvrir les motivations cachées de l'engagement que weve jamais pensé. Alors que pouvons-nous faire à la place Si essayaient de comprendre ce qui pousse les gens à devenir des utilisateurs lourds du site, pourquoi ne pas simplement leur demander En plus de détail, permet de faire ce qui suit: Tout d'abord, bien géré un sondage sur quelques centaines d'utilisateurs. Dans le sondage, bien leur demander si leur engagement sur le site a augmenté, diminué, ou est resté à peu près la même au cours de la dernière année. Eh bien également leur demander d'expliquer les raisons possibles de leur changement d'activité, et de décrire comment ils utilisent le site actuellement. We can also ask for supplemental details, like their demographic information. Finally, we can filter all responses for those users who heavily increased their engagement over the past year (or who heavily decreased it, if were trying to understand churn), and analyse their responses for the reasons. For example, heres one interesting response I got when I ran this study at YouTube. I have always been a big music fan, but recently I took up playing the guitar. Because of my new found passion (playing the guitar) my desire to watch concerts has increased. I started watching a whole lot of music festivals and concerts that are posted on Youtube and other music videos. I have spent a lot of time also watching guitar lessons on Youtube (from justinguitar). This response was representative of a general theme the survey uncovered: one big driver of engagement seemed to come from people discovering a new offline hobby, and using YouTube to increase their appreciation of it. People who wanted to start cooking at home would turn to YouTube for recipe videos, people who started playing tennis or some other sport would go to YouTube for lessons or other great shots, college students would look for channels like Khan Academy to supplement their lectures, and so on. In other words, offline activities were driving online growth, and instead of trying to figure out what kinds of online content people were interested in (which articles did they like on Facebook, who did they follow on Twitter, what did they read on Reddit), perhaps we should have been focusing on bringing their physical hobbies into the digital world. This offline hobby idea certainly wouldnt have been a feature I would have thrown into any engagement model, even if only because its a very difficult feature to create. (How do we know which videos are related to real-world behavior) But now that we suspect its a potentially big driver of growth (potentially because, of course, surveys arent necessarily representative), its something we can spend a lot more time studying in the logs. To summarize: propensity modeling is a powerful technique for measuring causal effects in the absence of a randomized experiment. Purely correlational analyses on top of observational studies can be very dangerous, after all. To take my favorite example: if we find that cities with more policemen tend to have more crime, does this mean that we should try to reduce the size of our police forces in order to reduce the nations amount of crime For another example, here s a post by Gelman on contradictory conclusions about hormone replacement therapy in the Harvard Nurses Study . That said, remember that (as always) a model is only as good as the data that you feed it. Its super difficult to account for all the hidden variables that might matter, and what you think might be a well-designed causal model might well in fact be missing many hidden factors. (I actually remember hearing that a propensity model on the nurses study generated a flawed conclusion, though I cant find any references to this at the moment.) So consider whether there are other approaches you can take, whether its an easier-to-understand causal technique or even just asking your users, and even if a randomized experiment seems too difficult to run now, the effort may be well worth the trouble in the end. One of the magical things about Twitter is that it opens a window to the world in real-time . An event happens, and just seconds later, it8217s shared for people across the planet to see. Consider, for example, what happened when Flight 1549 crashed in the Hudson. twitpic135xa - There8217s a plane in the Hudson. I8217m on the ferry going to pick up the people. Crazy. When Osama bin Laden was killed. Helicopter hovering above Abbottabad at 1AM (is a rare event). mdash Sohaib Athar (ReallyVirtual) May 1, 2011 Or when Mitt Romney mentioned binders during the presidential debates. Boy, I8217m full of women debates When each of these events happened, people instantly came to Twitter 8211 and, in particular, Twitter search 8211 to discover what was happening. From a search and advertising perspective, however, these sudden events pose several challenges: The queries people perform have never before been seen, so it8217s impossible to know beforehand what they mean. How would you know that bindersfullofwomen refers to politics, and not office accessories, or that people searching for 8220Horses and Bayonets8221 are interested in the debates Since these spikes in search queries are so short-lived. theres only a short window of opportunity to learn what they mean. So an event happens, people instantly come to Twitter to search for the event, and we need to teach our systems what these queries mean as quickly as we can, because in just a few hours those searches will be gone. How do we do this We8217ll describe a novel real-time human computation engine we built that allows us to find search queries as soon as they8217re trending, send these queries to real humans to be judged, and finally incorporate these human annotations into our backend models. Before we delve into the details, here8217s an overview of how the system works. (1) First, we monitor for which search queries are currently popular. Behind the scenes: we run a Storm topology that tracks statistics on search queries. For example: the query 8220Big Bird8221 may be averaging zero searches a day, but at 6pm on October 3, we suddenly see a spike in searches from the US. (2) Next, as soon as we discover a new popular search query, we send it to our human evaluation systems, where judges are asked a variety of questions about the query. Behind the scenes: when the Storm topology detects that a query has reached sufficient popularity, it connects to a Thrift API that dispatches the query to Amazon8217s Mechanical Turk service, and then polls Mechanical Turk for a response. For example: as soon as we notice 8220Big Bird8221 spiking, we may ask human judges to categorize the query, or provide other information (e. g. whether there are likely to be interesting pictures of the query, or whether the query is about a person or an event) that helps us serve relevant tweets and ads. Finally, after a response from a judge is received, we push the information to our backend systems, so that the next time a user searches for a query, our machine learning models will make use of the additional information. For example, suppose our human judges tell us that 8220Big Bird8221 is related to politics the next time someone performs this search, we know to surface ads by barackobama or mittromney, not ads about Dora the Explorer. Lets now explore the first two sections above in more detail. Monitoring for popular queries Storm is a distributed system for real-time computation. In contrast to batch systems like Hadoop, which often introduce delays of hours or more, Storm allows us to run online data processing algorithms to discover search spikes as soon as they happen. In brief, running a job on Storm involves creating a Storm topology that describes the processing steps that must occur, and deploying this topology to a Storm cluster. A topology itself consists of three things: Tuple streams of data. In our case, these may be tuples of (search query, timestamp). Spouts that produce these tuple streams. In our case, we attach spouts to our search logs, which get written to every time a search occurs. Bolts that process tuple streams. In our case, we use bolts for operations like updating total query counts, filtering out non-English queries, and checking whether an ad is currently being served up for the query. Heres a step-by-step walkthrough of how our popular query topology works: Whenever you perform a search on Twitter, the search request gets logged to a Kafka queue . The Storm topology attaches a spout to this Kafka queue, and the spout emits a tuple containing the query and other metadata (e. g. the time the query was issued and its location) to a bolt for processing. This bolt updates the count of the number of times we8217ve seen this query, checks whether the query is 8220currently popular8221 (using various statistics like time-decayed counts, the geographic distribution of the query, and the last time this query was sent for annotations), and dispatches it to our human computation pipeline if so. One interesting feature of our popularity algorithm is that we often rejudge queries that have been annotated before, since the intent of a search can change. For example, perhaps people normally search for 8220Clint Eastwood8221 because they8217re interested in his movies, but during the Republican National Convention users may have wanted to see tweets that were more political in nature. Human evaluation of popular search queries At Twitter, we use human computation for a variety of tasks. (See also Clockwork Raven. an open-source crowdsourcing platform we built that makes launching tasks easier.) For example, we often run experiments to measure ad relevance and search quality, we use it to gather data to train and evaluate our machine learning models, and in this section we8217ll describe how we use it to boost our understanding of popular search queries. So suppose that our Storm topology has detected that the query 8220Big Bird8221 is suddenly spiking. Since the query may remain popular for only a few hours, we send it off to live humans, who can help us quickly understand what it means this dispatch is performed via a Thrift service that allows us to design our tasks in a web frontend. and later programmatically submit them to crowdsourcing platforms like Mechanical Turk using any of the different languages we use across Twitter. On our crowdsourcing platforms, judges are asked several questions about the query that help us serve better ads. Without going into the exact questions, here are flavors of a few possibilities: What category does the query belong to For example, 8220Stanford8221 may typically be an education-related query, but perhaps there8217s a football game between Stanford and Berkeley at the moment, in which case the current search intent would be sports. Does the query refer to a person If so, who, and what is their Twitter handle if they have one For example, the query 8220Happy Birthday Harry8221 may be trending, but it8217s hard to know beforehand which of the numerous celebrities named Harry it8217s referring to. Is it One Direction 8217s Harry Styles. in which case the searcher is likely to be interested in teen pop Harry Potter, in which case the searcher is likely to be interested in fantasy novels Or someone else entirely Turkers in the machine Since humans are core to this system, let8217s describe how our workforce was designed to give us fast, reliable results. For completing all our tasks, we use a small custom pool of judges to ensure high quality. Other typical possibilities in the crowdsourcing world are to use a static set of in-house judges, to use the standard worker filters that Amazon provides, or to go through an outside company like Crowdflower. We8217ve experimented with these other solutions, and while they have their own benefits, we found that a custom pool fit our needs best for a few reasons: In-house judges can provide high-quality work as well, but they usually work standard hours (for example, 9 to 5 if they work onsite, or a relatively fixed and limited set of hours if they work from home), it can be difficult to communicate with them and schedule them for work, and it8217s hard to scale the hiring of more judges. Using Crowdflower or Amazon8217s standard filters makes it easy to scale the workforce, but their trust algorithms aren8217t perfect, so an endless problem is that spammy workers get through and many of the judgments will be very poor quality. Two methods of combatting low quality are to seed gold standard examples for which you know the true response throughout your task, or to use statistical analysis to determine which workers are the good ones, but these can be time-consuming and expensive to create, and we often run tasks of a free-response researchy nature for which these solutions don8217t work. Another problem is that using these filters gives you a fluid . constantly changing set of workers, which makes them hard to train. Our custom pool of judges work virtually all day. For many of them, this is a full-time job, and they8217re geographically distributed, so our tasks complete quickly at all hours we can easily ask for thousands of judgments before lunch, and have them finished by the time we get back, which makes iterating on our experiments much easier. We have several forums, mailing lists, and even live chatrooms set up, all of which makes it easy for judges to ask us questions and to respond to feedback. Our judges will even give us suggestions on how to improve our tasks for example, when we run categorization tasks, they8217ll often report helpful categories that we should add. Since we only launch tasks on demand, and Amazon provides a ready source of workers if we ever need more, our judges are never idly twiddling their thumbs waiting for tasks or completing busywork, and our jobs are rarely backlogged. Because our judges are culled from the best of the crowdsourcing world, they8217re experts at the kinds of tasks we send, and can often provide higher quality at a faster rate than what even in-house judges provide. For example, they8217ll often use the forums and chatrooms to collaborate amongst themselves to give us the best judgments, and they8217re already familiar with the Firefox and Chrome scripts that help them be the most efficient at their work. All the benefits described above are especially valuable in this real-time search annotation case: Having highly trusted workers means we don8217t need to wait for multiple annotations on a single search query to confirm validity, so we can send responses to our backend as soon as a single judge responds. This entire pipeline is design for real-time . after all, so the lower the latency on the human evaluation part, the better. The static nature of our custom pool means that the judges are already familiar with our questions, and don8217t need to be trained again. Because our workers aren8217t limited to a fixed schedule or location, they can work anywhere, anytime 8211 which is a requirement for this system, since global event spikes on Twitter are not beholden to a 9-to-5. And with the multiple easy avenues of communication we have set up, it8217s easy for us to answer questions that might arise when we add new questions or modify existing ones. Thanks to everyone on the Revenue and Storm teams, as well as our Turkers, for helping us launch this project. A couple weeks ago, Facebook launched a link prediction contest on Kaggle, with the goal of recommending missing edges in a social graph. I love investigating social networks. so I dug around a little, and since I did well enough to score one of the coveted prizes, I8217ll share my approach here. (For some background, the contest provided a training dataset of edges, a test set of nodes, and contestants were asked to predict missing outbound edges on the test set, using mean average precision as the evaluation metric.) Exploration What does the network look like I wanted to play around with the data a bit first just to get a rough feel, so I made an app to interact with the network around each node. Here8217s a sample: (Go ahead, click on the picture to play with the app yourself. It8217s pretty fun.) The node in black is a selected node from the training set, and we perform a breadth-first walk of the graph out to a maximum distance of 3 to uncover the local network. Nodes are sized according to their distance from the center, and colored according to a chosen metric (a personalized PageRank in this case more on this later). We can see that the central node is friends with three other users (in red), two of whom have fairly large, disjoint networks. There are quite a few dangling nodes (nodes at distance 3 with only one connection to the rest of the local network), though, so let8217s remove these to reveal the core structure: And here8217s an embedded version you can manipulate inline: Since the default view doesn8217t encode the distinction between following and follower relationships, we can mouse over each node to see who it follows and who it8217s followed by. Here, for example, is the followingfollower network of one of the central node8217s friends: The moused over node is highlighted in black, its friends (users who both follow the node and are followed back in turn) are colored in purple, its followees are teal, and its followers in orange. We can also see that the node shares a friend with the central user (triadic closure. holla ). Here8217s another network, this time of the friend at the bottom: Interestingly, while the first friend had several only-followers (in orange), the second friend has none. (which suggests, perhaps, a node-level feature that measures how follow-hungry a user is8230) And here8217s one more node, a little further out (maybe a celebrity, given it has nothing but followers): The Quiet One Let8217s take a look at another graph, one whose local network is a little smaller: A Social Butterfly And one more, whose local network is a little larger: Again, I encourage everyone to play around with the app here. and I8217ll come back to the question of coloring each node later. Distributions Next, let8217s take a more quantitative look at the graph. Here8217s the distribution of the number of followers of each node in the training set (cut off at 50 followers for a better fit 8211 the maximum number of followers is 552), as well as the number of users each node is following (again, cut off at 50 8211 the maximum here is 1566) Nothing terribly surprising, but that alone is good to verify. (For people tempted to mutter about power laws, I8217ll hold you off with the bitter coldness of baby Gauss8217s tears .) Similarly, here are the same two graphs, but limited to the nodes in the test set alone: Notice that there are relatively more test set users with 0 followees than in the full training set, and relatively fewer test set users with 0 followers. This information could be used to better simulate a validation set for model selection, though I didn8217t end up doing this myself. Preliminary Probes Finally, let8217s move on to the models themselves. In order to quickly get up and running on a couple prediction algorithms, I started with some unsupervised approaches. For example, after building a new validation set to test performance offline, I tried: Recommending users who follow you (but you don8217t follow in return) Recommending users similar to you (when representing users as sets of their followers, and using cosine similarity and Jaccard similarity as the similarity metric) Recommending users based on a personalized PageRank score Recommending users that the people you follow also follow And so on, combining the votes of these algorithms in a fairly ad-hoc way (e. g. by taking the majority vote or by ordering by the number of followers). This worked quite well actually, but I8217d been planning to move on to a more machine learned model-based approach from the beginning, so I did that next. My validation set was formed by deleting random edges from the full training set. A slightly better approach, as mentioned above, might have been to more accurately simulate the distribution of the official test set, but I didn8217t end up trying this out myself. Candidate Selection In order to run a machine learning algorithm to recommend edges (which would take two nodes, a source and a candidate destination, and generate a score measuring the likelihood that the source would follow the destination), it8217s necessary to prune the set of candidates to run the algorithm on. I used two approaches for this filtering step, both based on random walks on the graph. Personalized PageRank The first approach was to calculate a personalized PageRank around each source node. Briefly, a personalized PageRank is like standard PageRank, except that when randomly teleporting to a new node, the surfer always teleports back to the given source node being personalized (rather than to a node chosen uniformly at random, as in the classic PageRank algorithm). That is, the random surfer in the personalized PageRank model works as follows: He starts at the source node X that we want to calculate a personalized PageRank around. At step i: with probability p, the surfer moves to a neighboring node chosen uniformly at random with probability 1-p, the surfer instead teleports back to the original source node X. The limiting probability that the surfer is at node N is then the personalized PageRank score of node N around X. Here8217s some Scala code that computes approximate personalized PageRank scores and takes the highest-scoring nodes as the candidates to feed into the machine learning model: Propagation Score Start at a specified user node and give it some score. In the first iteration, this user propagates its score equally to its neighbors. In the second iteration, each user duplicates and keeps half of its score S. It then propagates S equally to its neighbors. In subsequent iterations, the process is repeated, except that neighbors reached via a backwards link don8217t duplicate and keep half of their score. (The idea is that we want the score to reach followees and not followers.) Here8217s some Scala code to calculate these propagation scores: I played around with tweaking some parameters in both approaches (e. g. weighting followers and followees differently), but the natural defaults (as used in the code above) ended up performing the best. After pruning the set of candidate destination nodes to a more feasible level, I fed pairs of (source, destination) nodes into a machine learning model. From each pair, I extracted around 30 features in total. As mentioned above, one feature that worked quite well on its own was whether the destination node already follows the source. I also used a wide set of similarity-based features, for example, the Jaccard similarity between the source and destination when both are represented as sets of their followers, when both are represented as sets of their followees, or when one is represented as a set of followers while the other is represented as a set of followees. Along the same lines, I also computed a similarity score between the destination node and the source node8217s followees, and several variations thereof. Extended Similarity Scores Other features included the number of followers and followees of each node, the ratio of these, the personalized PageRank and propagation scores themselves, the number of followers in common, and triangleclosure-type features (e. g. whether the source node is friends with a node X who in turn is a friend of the destination node). If I had had more time, I would probably have tried weighted and more regularized versions of some of these features as well (e. g. downweighting nodes with large numbers of followers when computing cosine similarity scores based on followees, or shrinking the scores of nodes we have little information about). Feature Understanding But what are these features actually doing . Let8217s use the same app I built before to take a look. Here8217s the local network of node 317 (different from the node above), where each node is colored by its personalized PageRank (higher scores are in darker red): If we look at the following vs. follower relationships of the central node (recall that purple is friends, teal is followings, orange is followers): 8230we can see that, as expected (because edges that represented both following and follower were double-weighted in my PageRank calculation), the darkest red nodes are those that are friends with the central node, while those in a following-only or follower-only relationship have a lower score. How does the propagation score compare to personalized PageRank Here, I colored each node according to the log ratio of its propagation score and personalized PageRank: Comparing this coloring with the local followfollower network: 8230we can see that followed nodes (in teal) receive a higher propagation weight than friend nodes (in purple), while follower nodes (in orange) receive almost no propagation score at all. Going back to node 1, let8217s look at a different metric. Here, each node is colored according to its Jaccard similarity with the source, when nodes are represented by the set of their followers: We can see that, while the PageRank and propagation metrics tended to favor nodes close to the central node, the Jaccard similarity feature helps us explore nodes that are further out. However, if we look the high-scoring nodes more closely, we see that they often have only a single connection to the rest of the network: In other words, their high Jaccard similarity is due to the fact that they don8217t have many connections to begin with. This suggests that some regularization or shrinking is in order. So here8217s a regularized version of Jaccard similarity, where we downweight nodes with few connections: We can see that the outlier nodes are much more muted this time around. For a starker difference, compare the following two graphs of the Jaccard similarity metric around node 317 (the first graph is an unregularized version, the second is regularized): Notice, in particular, how the popular node in the top left and the popular nodes at the bottom have a much higher score when we regularize. And again, there are other networks and features I haven8217t mentioned here, so play around and discover them on the app itself. For the machine learning algorithms on top of my features, I experimented with two types of models: logistic regression (using both L1 and L2 regularization) and random forests. (If I had more time, I would probably have done some more parameter tuning and maybe tried gradient boosted trees as well.) So what is a random forest I wrote an old (layman8217s) post on it here. but since nobody ever clicks on these links, let8217s copy it over: Suppose you8217re very indecisive, so whenever you want to watch a movie, you ask your friend Willow if she thinks you8217ll like it. In order to answer, Willow first needs to figure out what movies you like, so you give her a bunch of movies and tell her whether you liked each one or not (i. e. you give her a labeled training set). Then, when you ask her if she thinks you8217ll like movie X or not, she plays a 20 questions-like game with IMDB, asking questions like 8220Is X a romantic movie8221, 8220Does Johnny Depp star in X8221, and so on. She asks more informative questions first (i. e. she maximizes the information gain of each question), and gives you a yesno answer at the end. Thus, Willow is a decision tree for your movie preferences. But Willow is only human, so she doesn8217t always generalize your preferences very well (i. e. she overfits). In order to get more accurate recommendations, you8217d like to ask a bunch of your friends, and watch movie X if most of them say they think you8217ll like it. That is, instead of asking only Willow, you want to ask Woody, Apple, and Cartman as well, and they vote on whether you8217ll like a movie (i. e. you build an ensemble classifier, aka a forest in this case). Now you don8217t want each of your friends to do the same thing and give you the same answer, so you first give each of them slightly different data. After all, you8217re not absolutely sure of your preferences yourself 8211 you told Willow you loved Titanic, but maybe you were just happy that day because it was your birthday, so maybe some of your friends shouldn8217t use the fact that you liked Titanic in making their recommendations. Or maybe you told her you loved Cinderella, but actually you really really loved it, so some of your friends should give Cinderella more weight. So instead of giving your friends the same data you gave Willow, you give them slightly perturbed versions. You don8217t change your lovehate decisions, you just say you lovehate some movies a little more or less (you give each of your friends a bootstrapped version of your original training data). For example, whereas you told Willow that you liked Black Swan and Harry Potter and disliked Avatar, you tell Woody that you liked Black Swan so much you watched it twice, you disliked Avatar, and don8217t mention Harry Potter at all. By using this ensemble, you hope that while each of your friends gives somewhat idiosyncratic recommendations (Willow thinks you like vampire movies more than you do, Woody thinks you like Pixar movies, and Cartman thinks you just hate everything), the errors get canceled out in the majority. Thus, your friends now form a bagged (bootstrap aggregated) forest of your movie preferences. There8217s still one problem with your data, however. While you loved both Titanic and Inception, it wasn8217t because you like movies that star Leonardio DiCaprio. Maybe you liked both movies for other reasons. Thus, you don8217t want your friends to all base their recommendations on whether Leo is in a movie or not. So when each friend asks IMDB a question, only a random subset of the possible questions is allowed (i. e. when you8217re building a decision tree, at each node you use some randomness in selecting the attribute to split on, say by randomly selecting an attribute or by selecting an attribute from a random subset). This means your friends aren8217t allowed to ask whether Leonardo DiCaprio is in the movie whenever they want. So whereas previously you injected randomness at the data level, by perturbing your movie preferences slightly, now you8217re injecting randomness at the model level, by making your friends ask different questions at different times. And so your friends now form a random forest. Moving on, I essentially trained scikit-learn 8217s classifiers on an equal split of true and false edges (sampled from the output of my pruning step, in order to match the distribution I8217d get when applying my algorithm to the official test set), and compared performance on the validation set I made, with a small amount of parameter tuning: So let8217s look at the variable importance scores as determined by one of my random forest models, which (unsurprisingly) consistently outperformed logistic regression. The random forest classifier here is one of my earlier models (using a slightly smaller subset of my full suite of features), where the targeting step consisted of taking the top 25 nodes with the highest propagation scores. We can see that the most important variables are: Personalized PageRank scores. (I put in both normalized and unnormalized versions, where the normalized versions consisted of taking all the candidates for a particular source node, and scaling them so that the maximum personalized PageRank score was 1.) Whether the destination node already follows the source. How similar the source node is to the people the destination node is following, when each node is represented as a set of followers. (Note that this is more or less measuring how likely the destination is to follow the source, which we already saw is a good predictor of whether the source is likely to follow the destination.) Plus several variations on this theme (e. g. how similar the destination node is to the source node8217s followers, when each node is represented as a set of followees). Model Comparison How do all of these models compare to each other Is the random forest model universally better than the logistic regression model, or are there some sets of users for which the logistic regression model actually performs better To enable these kinds of comparisons, I made a small module that allows you to select two models and then visualize their sliced performance. Above, I bucketed all test nodes into buckets based on (the logarithm of) their number of followers, and compared the mean average precision of two algorithms: one that recommends nodes to follow using a personalized PageRank alone, and one that recommends nodes that are following the source user but are not followed back in return. We see that except for the case of 0 followers (where the 8220is followed by8221 algorithm can do nothing), the personalized PageRank algorithm gets increasingly better in comparison: at first, the two algorithms have roughly equal performance, but as the source node gets more followers, the personalized PageRank algorithm dominates. And here8217s an embedded version you can interact with directly: Admittedly, building a slicer like this is probably overkill for a Kaggle competition, where the set of variables is fairly limited. But imagine having something similar for a real world model, where new algorithms are tried out every week and we can slice the performance by almost any dimension we can imagine (by geography, to make sure we don8217t improve Australia at the expense of the UK by user interests, to see where we could improve the performance of topic inference by number of user logins, to make sure we don8217t sacrifice the performance on new users for the gain of the core). Mathematicians do it with Matrices Let8217s switch directions slightly and think about how we could rewrite our computations in a different, matrix-oriented style. (I didn8217t do this in the competition 8211 this is more a preview of another post I8217m writing.) Personalized PageRank in Scalding Personalized PageRank, for example, is an obvious fit for a matrix rewrite. Here8217s how it would look in Scalding 8217s new Matrix library: (For those who don8217t know, Scalding is a Hadoop framework that Twitter released at the beginning of the year see my post on building a big data recommendation engine in Scalding for an introduction.) Personalized PageRank, Matrix Style Finish LineBall Python Care Sheet Normal ball python Gina Ciolii5 Studio Ball Python ( Python regius ) The ball python is quite simply the most popular pet python in the world. Ball pythons are generally a bit shy, but they make for ideal captives, because they are of a small size, are generally friendly, are easy to care for, and come in a remarkable array of colors and patterns. Ball pythons are native to central and western Africa and thrive in these warm, tropical areas. They are known as the royal python in many parts of the world and are revered in some areas of Africa. Ball pythons make for a quality pet for the first-time keeper and experienced herpetoculturists alike. Each year, breeders create incredible, innovative, never-before-seen pattern and color variations that continually generate new fans of the ball python. Photo credit: Kevin McCurley Granite Ball Python. Ball Python Availability Ball pythons are quite easy to acquire. They are commonly available from pet stores, reptile breeders, reptile expos, and through online vendors and breeders. The best choice will always be captive born and bred snakes because they are usually parasite free and most likely the healthiest. Any ball python should be well-started and eating prior to purchase. Ball Python Size Ball python hatchlings are approximately 10 inches in length. Adult female ball pythons average 3 to 5 feet long, and adult male ball pythons average 2 to 3 feet in size. This is a species in which mature females are typically much larger than the males. A 5-foot ball python is considered big, although lengths of 6 feet or more have been reported. Ball Python Life Span With proper care, ball pythons can live 30 years or more. The record age for a ball python is more than 40 years ndash so plan on a long life for your new pet snake. Photo credit: Kevin McCurley Spider Killer Bee Axanthic Ball Python. Ball Python Caging Ball python enclosures can be as simple or as elaborate as you want to care for. Remember that the more you put in the cage, the more you have to clean and disinfect on a regular basis. That said, there are different enclosures that work well for ball pythons, including, but not limited to, plastic sweaterboxes (i. e. Rubbermaid), melamine racks and any of the commercially available, plastic-type reptile cages. Glass aquariums and tanks are adequate for ball pythons, but the screen tops on such enclosures can make it very difficult to maintain proper humidity levels. Juvenile ball pythons seem to do well in small enclosures that make them feel secure. A small snake in a big cage can become overwhelmed and stressed. Adult ball pythons do not require exceptionally large or elaborate enclosures either. A 36-inch by 18-inch by 12-inch enclosure will more than comfortably house an adult ball python. Spot-clean your ball python39s enclosure as necessary. Remove feces and urates as soon as possible. Do a complete tear-down every 30 days by removing all substrate and cage accessories and completely disinfecting with a 5 percent bleach solution. Rinse the enclosure thoroughly with water, and allow it to dry completely before replacing cage accessories and your snake. The one cage accessory that is required for a happy ball python is a good hide box. maybe even a couple of them. Ball pythons are secretive snakes that appreciate and utilize hide spots. Provide one on each end of your python39s enclosure so that it doesn39t have to choose between temperature and security. Clay flowerpots, plastic flowerpot trays and commercially available hide boxes all work well. Photo credit: Kevin McCurley Inferno Super Pastel Ball Python. Ball Python Lighting and Temperature Remember that enclosures must allow for a proper thermal gradient that the ball python can utilize, with a hotspot on one end of the enclosure and a cool spot on the other. Provide your ball python with a basking spot temperature of 88 to 96 degrees Fahrenheit and an ambient temperature of 78 to 80 degrees. The ambient temperature should not fall below 75 degrees. It is vitally important to know the temperatures at which you are keeping your snake(s). Do not guess A great way to monitor temperatures is to use a digital indooroutdoor thermometer with a probe. Stick the thermometer to the inside of the cage on the cool end and place the probe on the warm end, and you39ll have both sides covered at once. There are several ways to go about heating a ball python enclosure. Undercage heating pads and tapes, ceramic heat emitters, basking bulbs (both regular daytime and red night bulbs) are just a few. With heat emitters and basking bulbs, it is crucial to keep an eye on the humidity within the enclosure, especially if combined with a screen top, as both will dry the air quickly. Use thermostats, rheostats andor timers to control your heat source. Do not use hot rocks with snakes as they can heat unevenly over too small of a surface area and can cause serious burns. Supplemental lighting is not necessary for ball pythons, but if used should run on a 1212 cycle, meaning 12 hours on and 12 hours off. Continuous bright, overhead lighting is stressful to snakes, especially a nocturnal species such as the ball python. Ball pythons seem to prefer humidity levels of 50 to 60 percent. Maintaining proper humidity will allow your ball python to shed properly. Photo credit: Kevin McCurley Desert Ghost Lemon Pastel Ball Python. Ball Python Substrate Newspapers and paper towels are the cheapest and easiest substrates for ball pythons with regards to cleaning and disinfecting ndash out with the old, in with the new. Cypress mulch and orchid bark are great substrates for controlling humidity, but remember that too much humidity can be as detrimental (if not more) as too little. Never use any substrate containing cedar, as it contains oils that can be deadly to reptiles Avoid sand, shavings and peat bedding. What Food to Feed a Ball Python Feed your ball python an appropriately sized rodent weekly. quotAppropriately sizedquot means prey items that are no bigger in circumference than the ball python at its largest circumference. Ball pythons can eat rats from the time they are young ndash starting off with rat pups or quotcrawlersquot at first and moving up in size as they grow. Do not handle your ball python for at least a day after feeding, as this can lead to regurgitation. Ball pythons can be fed frozenthawed or pre-killed rodents. Never leave a live rodent unattended with any snake, as they can injure the snake. Ball pythons are well-known for not eating at certain times throughout the year, particularly in the winter months. Be prepared for the possibility of your ball python going off feed, and keep an observant eye on the snake39s overall condition and body weight. This is typically nothing to worry about with healthy, well-established pythons, although it can be extremely frustrating to the snakekeeper. If your ball python is healthy, continue your husbandry routine as usual, but keep the amount of handling to a minimum. Offer your ball python food every 10 to 14 days until it is interested in eating again, as the snake will eventually resume feeding normally. Feed adult ball pythons every 1 to 2 weeks and younger ball pythons weekly as they need this energy to grow. Do not be alarmed if a well-started ball python goes off feed during the cooler, drier times of the year, as this is common in captivity. Snakes generally do not eat while they are in the shed cycle. Photo credit: Kevin McCurley Coral Glow Woma Granite Ball Python. Ball Python Water Always have fresh, clean water available for your ball python. Check the water daily. The size of the water dish is up to you. If it is large enough for the ball python to crawl in to and soak, sooner or later your snake will make the most of the opportunity ndash ball pythons seem to enjoy a nice soak from time to time. Ensure that the water bowl is not too deep for juvenile animals ndash 1 inch or so will suffice. Snakes of many species will defecate in their water bowls from time to time, so be prepared to clean and disinfect the water bowl. The water bowl should be cleaned and disinfected on a weekly basis. Having a spare water bowl for such occasions can be handy, so that one may be used while the other is being cleaned. Ball Python Handling and Temperament Ball pythons are generally shy and will spend much of their time hiding. Your ball python may initially see you as a threat and it must learn who you are. The goal is to establish trust between you and your snake. Always support your ball pythonrsquos body and avoid fast movements. Once a ball python realizes that you will not hurt it they often seem to enjoy being handled. Some ball pythons may try to hide when handled and occasionally there are ones that may even bite due to excessive fear. These ball pythons may require a bit more time to settle in and establish trust. A ball pythonrsquos bite is a superficial wound. If a snake looks like it is going to strike, it is best to not handle it. Relax when holding your animal ndash sit down and give the animal a chance to settle. Some snakes may not eat for several hours or longer after being handled, so avoid handling if you plan to feed. After a snake has eaten it may be a good idea to limit the handling because it may be uncomfortable for the animal. Avoid putting your snakersquos cage in a heavy traffic area, excessive movement, and other pets should be avoided. Kevin McCurley is the source for Ball Python care and information. Visit his website at NewEnglandReptile . Articles Liés
No comments:
Post a Comment