8 ms·
Machine Learning for Everyday Tasks
- linkregister 10y agoI got lost at the cluster analysis. Can someone explain that in more detail? (Maybe Sergey?)
- sergey-obukhov 10y agoWhat part? :)
- sergey-obukhov 10y agoThere are many approaches https://en.wikipedia.org/wiki/Cluster_analysis https://en.wikipedia.org/wiki/Cluster_analysis. In the research k-means clustering was used. It's probably not the best clustering algo for this task and a much better results would be achieved if a different one was used or if some data manipulation was applied prior to the clustering. Here's k-means clustering explanation if you're interested https://youtu.be/_aWzGGNrcic https://youtu.be/_aWzGGNrcic
- johngalt 10y agoThey are trying to predict what types of html pages cause parsing problems. They have a set of variables that describe an html page. They are trying to figure out which variable or combination of variables predict a bad parsing outcome. Think of cluster analysis as simply plotting those variables as points on a graph. Then drawing a circle around points that are close to each other.
- nacc 10y agoI might have missed something, but if they only have 2 features, simply plotting the data out will make any trend very clear.
- kehrlann 10y agoAgreed. Also, they don't discuss how they chose their features... It seems the problem was already solved before even applying ML to it. Maybe the example is too naive ?
- sergey-obukhov 10y agoHtml size and html tags count was a natural choice. If it didn't work out the next step would be to try something else. You're right that it's a very naive example and that in a way it was solved before any ml was applied. The surprising part for me was that both features turned out to be interchangeable i.e. any of them could be used. I would expect html tags count to be much more accurate / reliable, etc. Another interesting part for me was the threshold. It's somewhat clear that it should be somewhere between 20 and 1 sec probably but where exactly?
- stevetrewick 10y agoWould the person or persons down voting all the author of TFA's comments mind explaining why? Seems a bit off.
- blt 10y agoThe slowest part of any parser is the lexer - guessing whatever processing they do on the parse tree structure is insignificant by comparison.
- sergey-obukhov 10y agoRe-pasting my comment here where it belongs as a reply: It could be a great idea - to plot the data on 2 axes (x - html length or html size, y - processing time, if I understand this correctly). It's simple and elegant. I'll try that. It could be though that the chart will get messy with all this data points. One of the reasons I like the percentiles approach is that it makes it clear that there is a trade-off between message processing time and the number / percentage of messages we can process.
- minimaxir 10y ago> It's simple and elegant. The OP likely made that comment because plotting the data is often done before the fancy machine learning as a part of the exploratory data analysis. (especially with a low number of variables!)
- IanCal 10y agoSet a low alpha to the points on the chart of there are loads.
- gmfawcett 10y agoIanCal's comment about setting the alpha is a good one. Another easy option is to make a heatmap of 2D bin counts. Since you're using R already, you can use ggplot for this: http://docs.ggplot2.org/current/geom_bin2d.html http://docs.ggplot2.org/current/geom_bin2d.html
- prashnts 10y agoFor higher dimensions, a RadViz plot with lower alpha is really useful too. [0] http://docs.orange.biolab.si/2/widgets/rst/visualize/radviz.html#description http://docs.orange.biolab.si/2/widgets/rst/visualize/radviz....
- deleted 10y ago[deleted]
- Terr_ 10y agoI'm reminded of Anscombe's Quartet as an example of how a little visualization can reveal things that might be hidden behind summary statistics. https://en.wikipedia.org/wiki/Anscombe's_quartet https://en.wikipedia.org/wiki/Anscombe's_quartet
- Animats 10y agoNow this has potential. Put a tool in the mail reader which reads "transactional" emails and matches them up with actual transactions. Discard entire emails which have no match to a transaction, and discard advertising in transactional emails. This would improve spam filtering. It would also be useful for mail readers which understand conversations, converting them to message-like bubble format.
- bsbechtel 10y agoI'm waiting for a "Machine Learning Tools for the Non-technical" post. When we can make machine learning accessible to business owners and non-technical people, this is when machine learning will really have a big impact on society. Until then, it's accessibility is just too limited.
- tomelders 10y agoIm currently trying to crack it. What I've realised so far is that once you get past the scary mathematic notation, its really quite simple under the hood. Maybe that wont be the case as I learn more, but linear regression and gradient descent is really very simple and easy to grok. So far I've been cobblibg together a learning regimen by combing Coursera, Khan Academy, and a book called "Machine Learning for Programmers". Individually they all eventually brush over some key concepts that make it dofficult to get an intuition for what's happening. But when combined they fill in the gaps. Also, this repo has been like the rosetta stone for someone who doesn't have a single maths qualification, not even a GCSE. https://github.com/Jam3/math-as-code/blob/master/README.md https://github.com/Jam3/math-as-code/blob/master/README.md
- blitzd 10y agoI'm in a similar boat, and that repo looks very useful! Thanks. If you're at all into Python or R I'd suggest Jose Portilla's courses on Udemy as well, they're very good at covering the applied aspects.
- marssaxman 10y agoThis has generally been my experience with mathematic notation applied to CS topics; the notation itself is basically impenetrable, but once you can get the underlying ideas translated into readable form they turn out to be straightforward and easy to apply.
- stewbrew 10y agoI hope you are aware that those introductory courses give you a rather high level view of things and often hide any problematic points from you. It's like driving and only learning to know about the accelerator.
- sergey-obukhov 10y agoIt could be a great idea - to plot the data on 2 axes (x - html length or html size, y - processing time, if I understand this correctly). It's simple and elegant. I'll try that. It could be though that the chart will get messy with all this data points. One of the reasons I like the percentiles approach is that it makes it clear that there is a trade-off between message processing time and the number / percentage of messages we can process.
- tomelders 10y agoIm currently building a UI for an app that asks the user to input a ridiculous amount of info in exchange for an accurate trade in price on a vehicle. I mentioned to the client that this is a classic linear regression problem and that they could pribably get more accurate estimates with far fewer input variables. Also, their backend datastore is in a real mess and is going to be a constant source of problems going forward. But they simply weren't interested in even considering it. They just do not believe that machine learning can out perform their current process.
- tnecniv 10y agoMost people get scared by things they cant visualize. I have a friend at a large, popular tech company. He was tasked with solving a problem that a linear regression was exactly perfect for. The thing they were trying to model was even known to be linear! His boss wouldn't let him do it because he couldn't visualize a best plane. Instead, he had to do a series of best fit lines in the various possible 2D projections. At the end, he showed the boss that a linear regression provided the same result and the boss was still untrusting.
- busterarm 10y ago"Nobody ever gets fired for contracting IBM."
- nerfhammer 10y agoYour friend's boss doesn't sound like he should be managing data scientists or ML engineers
- nhf 10y agoOn a tangential note, "The robust beauty of improper linear models in decision making"[1] is probably one of my favorite papers on modeling and decision research. > Improper linear models are those in which the weights of the predictor variables are obtained by some nonoptimal method; for example, they may be obtained on the basis of intuition, derived from simulating a clinical judge's predictions, or set to be equal. This article presents evidence that even such improper linear models are superior to clinical intuition when predicting a numerical criterion from numerical predictors. [1] http://www.niaoren.info/pdf/Beauty/9.pdf http://www.niaoren.info/pdf/Beauty/9.pdf
- apathy 10y agothis is strange -- why is there a little bit of Python in the middle of an R implementation/prototyping?
- sergey-obukhov 10y agoWhile the research and prototyping were done in R the service itself is in python. The implementation is so simple that it doesn't require any specific ML libs. More complex tasks will probably require using scikit (if desired to stay on python ground) or plugging in R in one way or another, etc.
- apathy 10y agoso the whole thing was just an exercise in choosing a cut point? It would seem like you might want to revisit this sort of thing every now and then, what fer since both web "frameworks", your parsing code, and CPU hardware change over time.
- sergey-obukhov 10y agoyou're absolutely right!
- c06n 10y agoAre we now going to call every statistical technique "Machine Learning"?
- simonbyrne 10y agoOnly if done using a machine.
- imh 10y agoNope, we're switching to "AI" these days.
- thanatropism 10y agoNo, nene no. Statistical techniques start from hypotheses and are validated by tests and confidence intervals. Here we basically don't care what's our chances of getting it wrong. It's a marginal feature in some email client, not quality control in a brewery.
- sonabinu 10y agoCertainly Data Mining and applied statistics
- minimaxir 10y agoThis is a case where knowing the data and it's inherent structure is just as important, if not more important, then knowing how to apply machine learning. In this case, the formula was (time ~ content length + number of tags). Except, by construction, the content length is positively correlated with the number of tags! And since the parsing tags is the primary purpose of HTML scrapers, it's likely that content length is completely redundant or a poor predictor of time. (which was the conclusion). If you wanted to calculate the maginitude/significance of an explanatory variable, a linear regression is more than sufficient, and R has great tools for that. The quantile plot revealed there is a skew in time processed, presumably the number of tags has a similar skew.
- thanatropism 10y agoI keep telling people in my profession who didn't really learn important things in school: "regression" should really be called "iid regression". For example: time-series econometrics is a whole field dedicated to try to squeeze iid information from stuff that's not iid. So you can use regression. But they're receptive to my message because they were repetitively warned that curve fitting was not regression analysis. Somehow this is lost in our "data" culture.
- thijsvandien 10y agoi.i.d.: independent and identically distributed
- ekianjo 10y ago> to try to squeeze iid information from stuff that's not iid. So you can use regression. I'm not sure I understand your last sentence here - so you can, or you can't use regression for non iid stuff? It would seem that you cannot.
- pyromine 10y agoThere is more than certainly forms of regressions that can work on heteroskedastic errors, i.e. non-iid (can be clustering, autoregressive, or more), but part of the general ordinary least squares assumptions and interpretations is iid. errors. If you do not have iid. errors, any interpretations of the model will be skewed. There are however other heteroskedasticaly robust interpretations of regressions.
- nerfhammer 10y agoI once wrote a classifier to tell whether the metadata on a web page was any good. The best features? Look for classic html mistakes on the page. Still using font tags, do they use gifs instead of png, did they include a keywords meta tag, did they specify an encoding or are there windows-1252 characters present anywhere, etc. I came up with 20 or so signs of bad html elsewhere on the page, and collectively those features were much more predictive than any of the content itself.
- nether 10y ago"Everyday tasks," I was picturing making coffee, driving my car...
- tlarkworthy 10y agoAnd that's why you PCA before clustering (for normalization).
- YeGoblynQueenne 10y ago>> CART showed slightly better results for this task but its main advantage is that it gives you a decision tree that is easy to understand, explain and implement vs SVM or Random Forests that work like a black box and require using heavy ML libraries in production. I don't get that. Random Forests are ensembles of decision trees and can be used for regression. I've not used the R CART library, so I might be missing something, but the interpretability of Random Forests should be the same as that of, well, any other model built by a decision-tree learner (i.e. just as unreadable as any other classifier's model, once their parameters become sufficiently many).