Answers.Body: <p>This sounds like a great project, although this <em>exact</em> setup limits your options somewhat.  Supervised machine learning approaches are effectively ruled out because you don't have the necessary training data to develop a model (i.e. the dependent variable: whether it is raining or not).  You could look at accessing similar data (from what source depends on your geographical location) that includes precipitation information, and attempt to train a model based on that, before applying it to your own data to 'predict' the current conditions.</p>
  
  <p>If you want a model to determine whether it's raining or not (rather than attempting to define the type, rate or other characteristics of precipitation) then you need a binary classification model.  If you can get the data to train a supervised model, there are many such models available.  Which one to choose depends on a number of factors – enough factors that it is as much an art as a science (and often the best way to choose is just to try several and pick the best one).  XGBoost is a popular choice for a wide range of problems, including binary classification.  State Vector Classifiers (SVCs, a subtype of State Vector Machine, SVM) are also common.  Of course there are neural networks also.  Depending on how the dependent variable correlates with the independent ones, you may find a simpler model to be more effective.  If you choose to try a neural network, I suggest keeping it simple and starting with a Multi-Layer Perceptron (MLP).</p>
  
  <p>Alternatively, you could try an unsupervised approach, which commonly takes the form of clustering.  In this instance, you would look to try clustering algorithms, such as DBSCAN, to see if the independent variables naturally form groups (clusters) which differentiate between when it is raining or not.  Of course you can cluster the data using an unsupervised model, but you would still need to then correlate that with rainfall in order to make sense of the model.</p>
  
  <p>There are a number of challenges you may need overcome.  For example, depending on the frequency with which the data is sampled and stored, you may need to downsample it to a manageable size.  Presumably you also have the time at which the data was collected.  If not, you would also need to make use of the brightness sensor to differentiate between night and day, which may confound or over-power any cooling effect from rainfall.  (You could look at clustering the data, based on temperature and brightness, in order to create a new feature which indicates night and day.)</p>
  
  <p>To summarise, there are numerous approaches you could take, all of which will, at some point, require data on whether it is/was raining or not in order to train a model.  If you have suitably localised weather data available, you may be able to train a model using that, synchronised via time and/or the other data you'll be collecting.  The problem, as stated, is a binary classification one (as opposed to a time series prediction one, i.e. weather forecasting, for example).  So look into classification and clustering models for supervised and unsupervised machine learning respectively.  <a href="http://scikit-learn.org/stable/index.html" rel="nofollow noreferrer">Scikit Learn</a> for python or <a href="https://cran.r-project.org/web/packages/caret/index.html" rel="nofollow noreferrer">Caret</a> for R are commonly used packages for the types of models I've described.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-06T19:58:28.057Z
Answers.LastActivityDate: 2018-11-06T19:58:28.057Z
Answers.UserDisplayName: Chris
Body: <p>I'm building a weather station, where I'm sensing <em>temperature, humidity, air pressure, brightness, <span class="math-container">$CO_2$</span></em>, but I don't have a raindrop sensor. </p>
  
  <p>Is it possible to create an AI which can say if it's raining or not, with the help of the given data above and maybe analyzing the slope from the last hour or something? Which specific technology should I use and how can I train it?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-11-13T18:21:54.993Z
Comments.Text: I think this question would be better suited for https://stats.stackexchange.com/, even though, there, this question may sound too basic, given that this question is about "prediction"/"inference", in general. There you will find a lot more competent people that can answer this question. But, honestly, this is the type of questions that I would like to see more on this website, because they are actually useful.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-11-13T18:27:18.017Z
Comments.Text: Anyway, just to give you an idea. What you're sensing, e.g. the temperature, the humidity, are usually called, in the context of machine learning (and AI, in general), **features**. In statistics, these are called variables. These variables can be independent or confounding. Anyway, the idea is to combine these variables in certain way, so as to create an output which needs to correspond to the output of the raindrop sensor. Which model to use and how to deal with your variables, it's more technical, and sometimes the choice of model, etc., requires a little domain knowledge.
Comments.UserDisplayName: nbro
Tags: <training><prediction><models>
Title: How do I predict if it is rainy or not?
UserDisplayName: Ribisl
ThreadText: # How do I predict if it is rainy or not?
  
  (Asked by: username_0 on 2018-11-06)
  
  I'm building a weather station, where I'm sensing *temperature, humidity, air pressure, brightness, $CO\_2$*, but I don't have a raindrop sensor.
  
  Is it possible to create an AI which can say if it's raining or not, with the help of the given data above and maybe analyzing the slope from the last hour or something? Which specific technology should I use and how can I train it?
  
  **Tags:** training, prediction, models
  > **Comments:**
  > **username_1**: I think this question would be better suited for https://stats.stackexchange.com/, even though, there, this question may sound too basic, given that this question is about "prediction"/"inference", in general. There you will find a lot more competent people that can answer this question. But, honestly, this is the type of questions that I would like to see more on this website, because they are actually useful.  
  > **username_1**: Anyway, just to give you an idea. What you're sensing, e.g. the temperature, the humidity, are usually called, in the context of machine learning (and AI, in general), **features**. In statistics, these are called variables. These variables can be independent or confounding. Anyway, the idea is to combine these variables in certain way, so as to create an output which needs to correspond to the output of the raindrop sensor. Which model to use and how to deal with your variables, it's more technical, and sometimes the choice of model, etc., requires a little domain knowledge.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-11-06. Score: 2
  
  This sounds like a great project, although this *exact* setup limits your options somewhat. Supervised machine learning approaches are effectively ruled out because you don't have the necessary training data to develop a model (i.e. the dependent variable: whether it is raining or not). You could look at accessing similar data (from what source depends on your geographical location) that includes precipitation information, and attempt to train a model based on that, before applying it to your own data to 'predict' the current conditions.
  
  If you want a model to determine whether it's raining or not (rather than attempting to define the type, rate or other characteristics of precipitation) then you need a binary classification model. If you can get the data to train a supervised model, there are many such models available. Which one to choose depends on a number of factors – enough factors that it is as much an art as a science (and often the best way to choose is just to try several and pick the best one). XGBoost is a popular choice for a wide range of problems, including binary classification. State Vector Classifiers (SVCs, a subtype of State Vector Machine, SVM) are also common. Of course there are neural networks also. Depending on how the dependent variable correlates with the independent ones, you may find a simpler model to be more effective. If you choose to try a neural network, I suggest keeping it simple and starting with a Multi-Layer Perceptron (MLP).
  
  Alternatively, you could try an unsupervised approach, which commonly takes the form of clustering. In this instance, you would look to try clustering algorithms, such as DBSCAN, to see if the independent variables naturally form groups (clusters) which differentiate between when it is raining or not. Of course you can cluster the data using an unsupervised model, but you would still need to then correlate that with rainfall in order to make sense of the model.
  
  There are a number of challenges you may need overcome. For example, depending on the frequency with which the data is sampled and stored, you may need to downsample it to a manageable size. Presumably you also have the time at which the data was collected. If not, you would also need to make use of the brightness sensor to differentiate between night and day, which may confound or over-power any cooling effect from rainfall. (You could look at clustering the data, based on temperature and brightness, in order to create a new feature which indicates night and day.)
  
  To summarise, there are numerous approaches you could take, all of which will, at some point, require data on whether it is/was raining or not in order to train a model. If you have suitably localised weather data available, you may be able to train a model using that, synchronised via time and/or the other data you'll be collecting. The problem, as stated, is a binary classification one (as opposed to a time series prediction one, i.e. weather forecasting, for example). So look into classification and clustering models for supervised and unsupervised machine learning respectively. [Scikit Learn](http://scikit-learn.org/stable/index.html) for python or [Caret](https://cran.r-project.org/web/packages/caret/index.html) for R are commonly used packages for the types of models I've described.
  
  
  ---
  
  