How to load real time data in octave - machine-learning

How can I load real time data in octave?
Here's an example of the data I'm trying to load in octave for analyzing:
hpi_type hpi_flavor frequency level place_name place_id yr period index_nsa index_sa
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 1 100 100
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 2 101.04 101.12
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 3 101.4 101.07
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 4 101.8 101.12
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 5 102.43 101.5
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 6 102.85 101.6
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 7 103.07 102.01
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 8 103.23 102.22
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 9 102.92 102.12
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 10 103.17 102.51
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 11 104.05 103.44
traditional purchase-only monthly USA or Census Division East North Central Division DV_ENC 1991 12 103.81 103.54

Related

Forecasting sales per item in Azure ML algorithm choice

I have almost 10 years of sales data, let's assume in below format:
DateKey Product Count Price Type
20140701 Shoe 10 $100 X
20140701 Shoe 5 $40 Y
20140702 Shirt 50 $80 Z
20140703 Shoe 10 $105 A
.
.
20180630 . ......
Now I want to predict this financial Year (2018-19) sales breakdown.
I have sales data for July 2018 which I can use to score my model, But I am not sure which algorithm to use. I am using Azure ML Studio
There are plenty of sample experiments in Cortana Gallery. This one for example may provide you a brief overview of time series forecasting using Azure ML Studio

Unit of digital numbers?

what is the unit of digital numbers https://en.wikipedia.org/wiki/Numerical_digit. For example what is the unit of the difference of two ADC values:
10 - 2 = 8 digits
10 - 2 = 8 units
10 - 2 = 8 symbols
10 - 2 = 8 ???
Or for example I want to describe a slope:
Temperature example: 2 °C per second = 2 °C/sec
ADC example: 2 ??? per second = 2 ???/sec
What is correct?
Best regards
Zlatan
Numbers don't have units by default. Units are simply a multiplied symbol that represents the "nature" of the quantity.
First of all figure out the LSB (least significant bit) of the ADC.
Example: The ADC uses a vref of 1.2V and has 8bit => LSB=1.2V/(2^8-1)=4.7mV
A typical temperature sensor using a bipolar junction has about -2mV/K. The example ADC with LSB=4.7mV will respond with a change of 1LSB per 2.35K temperature decrease.
A change of 1LSB/second means you have a change of -2.35K/per second.
If this isn't accurate enough for your application you can use an ADC with more bits or stack several diodes acting as temperature sensors.
If you use something else than a bipolar junction the sensitivity of the temperature sensor can be different. Just check the spec of the sensor and the ADC (and it's reference to calculate the LSB)
Parameters you need:
Reference voltage of the ADC
Number of bits of the ADC (to calculate LSB)
Temperature coefficient of the sensor

Classify users based on demographics

I am working on a personal project just for fun. Basically I have collected the data which has demographic information about each country like :
Germany 74% male 26% female 10% married 16% Age_30-35 40% etc
Now what I want to do is when I get a new user, I see that user's country and try to predict information about the user ie if the user is a male who is married and of age 30-35 (just an example).
My question is how can I make such prediction , I can't just make a rule which says if a country has more than 50% male, the new user from this country is also male. Basically I want to know how can I decide on the value which would help me predict the users demographics with certainty.
This is not really a prediction but rather a probability question since you can just calculate all probabilities if you have values as described.
Here's an example:
Male population = 74%
People married = 16%
People between 30-35 = 40%
To get the probability for a new German user to be male, married and between 30-35 years old you do the following:
P(Male|Married|30-35) = p(Male) * p(Married) * p(30-35)
P(Male|Married|30-35) = 0,74 * 0,16 * 0,40 = 0,04736 ~ 4,7%
You don't need more to calculate this. If you however want to classify all users automatically I suggest you take a look at Naive Bayes Classification.

Which machine learning classifiers to use for boolean, count and ratio features together?

Say I have names, geographic and gender information. And I want to create name and geographic features to predict the gender of a person.
The name features will be as follows:
2-letter, 3-letter and 4-letter substrings, ie: Susan into 'su', 'us', 'sa', 'an', 'sus', 'usa'...
Entire name entities, ie: Susan Hay into 'susan' and 'hay'
Total name length, ie: Susan Hay into '8'
Non-ASCII character, ie: Susan Hay into '0'
Vowel-to-total length ratio, ie: Susan Hay into '3/8'
Location of residency, ie: Susan Hay into 'New York, U.S.'
I would like to use Naive Bayes classifiers to incorporate features 1-6 altogether as a feature set, but should I use the Multinomial or Bernoulli Naive Bayes?

pyephem equinox producing unexpected sunrise/set azimuth

This is less of a python/pyephem question and more of an orbital mechanics question but here goes:
Pyephem reports that the vernal equinox will occur Thu 2014-03-20 12:57 EST. This is the day when sunrise occurs closest to true east (90º) and sunset closest to true (270º), pretty much worldwide.
Calculating time and azimuth sunrise/set on that day for lon -78:30, lat 35:30 elevation 124m, using a horizon of '-0:34' and pressure of 0 (to get numbers as close to the US Naval Observatory) I get (adjusted for localtime, EST):
Date Sunrise SlrNoon Sunset sunrise az sunset az
Thu 2014-03-20 07:19:57 13:20:55 19:22:27 89:55:28.0 270:19:08.5
With solar noon occurring slightly after the equinox, I would expect sunset to be closer to 270:00:00.0 than sunrise be closer to 90:00:00.0 but the opposite is true. Sunrise is about 4.5 arminutes off true east and sunset is about 19 arcminutes off true west. Why?
At the equinox I would expect the Sun to be at roughly due-east and due-west when it intersects the true horizon itself, rather than when it reaches a depth of 34 arcminutes below the horizon on each side of the sky. To reach that point of depression below the horizon, the center of the Sun will have to travel farther — which means in both cases that you are asking about a point father north and farther below the horizon than the actual points that are due east and due west.
Since we do not have access to your code itself, could you try re-running it with horizon set to zero and see if you get points closer to east and west?

Resources