I am extremely new to this data science world so bear with me if my question is not very clear, I'd be glad to clarify. What I am looking for is simple: train a program with a set of values (5 ordered integer inputs, 1 boolean output). Then I would give it 5 inputs where the outcome is not known, and it has to tell me the outcome.
It is a basic classification model. Our focus is to train the model using training dataset and evaluate its performance with the test set.
In your case, assume you have 10 numbers as input and a binary output. Consider random 8 entries as your training data and train it with any classification algorithm using R/Python. Then test it on the remaining entries which acts as a test data.
Since it is associated with classification we need to consider performance metrics like accuracy, precision and recall based on the labeled feature.
For more details on classification try here
scikit-learn is a powerful and a very very simple ML library for Python.
Your doubt is about a Classification Problem, where you're going to predict a class (True or False) given some input data.
There are many classifiers that you can use.
In this example I've used Logistic Regression
from sklearn.linear_model import LogisticRegression # Input data data = [[1.0, 2.0, 3.0, 4.0, 5.0], [6.0, 7.0, 8.0, 9.0, 10.0]] # Target values for input data target = [True, False] # Define the model (default parameters) model = LogisticRegression(C=1.0, penalty='l1', tol=1e-6) # Train the model model.fit(data, target) # Once the model is trained, we make a prediction model.predict([[1.0, 2.0, 3.0, 4.0, 5.0]])
If you execute this code, the prediction for that data is
It seems overkill, but I gonna tell you how to get strict math dependency from your data:
- same sets of inputs should be converted to single set and rate instead of bool, where true increments rate and false decrements the rate for same sets of values.
- input vars set should be converted to system of equations: $v_1=a, v_2=b ... $ where $a,b,c,d,e$ are particular inputs set. And one more var for rate.
- simultaneous equations may be converted to single equation formed by summing it squares: $(v1-a)^2+(v2-b)^2+(v3-c)^2...=0$
- the equation may be used if you insert new set of vars values in equation and see which rate will outcome.
- find the equation that gives best fit to your set of data.
If you have aggressive calculation abilities then you may want to proceed to next level of precision:
- Do steps 1-3 of the previous sequence.
- Different sets are non-simultaneous equation of the system you need. Non-simulteneous system may be converted to single equation using multiplication. You'l have big product of all your data like $((v1-a1)^2+(v2-b1)^2+(v3-c1)^2...)((v1-a2)^2+(v2-b2)^2+(v3-c2)^2...)((v1-a3)^2+(v2-b3)^2+(v3-c3)^2...)...=0$
- Use the system and OpenCL or IBM XL C++ compiler OpenMP extension offload to Nvidia GPUs feature to simulteneously calculate members of the product that have all information of flight results.
Similar approach is used in this extrapolator implementation and its math framework.