Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Can we implement Ludwig for time forecasting classification ? #20

#1

Can we implement Ludwig for time forecasting classification ?
I have a dataset, can I use Ludwig? My dataset has 622 columns. The last column is the output. The columns don't have any heading. How to create the yaml file for that ?

  • solved #2
  • replies 10
  • views 2.7K
  • likes 0
#2

Hi Sutirtha,
yes you can definitely do time series classification with Ludwig.
Assuming your 621 columns are numbers at different times, you'll have to combine them in a single column with space delimiters. Like three columns with values 4, 2, 1 will become "4 2 1".
Then you have to give a name to the this new column and the last output one, like "ts" and "class", by adding the headers.
Finally, train a model by specifying a model definition like "{input_features: [{name: ts, type: timeseries}], output_features: [{name: class, type: category}]}". Beware to specify the maximum length of the timeseries in the preprocessing parameters as the default value is 256 I believe, so your timesereis may be truncated if you don't do it.
You can find both the preprocessing and details on the encoders you can use in the User Guide.

SutirthaChakraborty accepted post #2 as the answer
#3
#4
#5

Hi Piero,
We use Arima to learn from the historical data based on its learning it can forecast for the future days/weeks/months. Can we do the same in Ludwig. Wont it required any features during the forecast(as in linear regression model).

Regards
Shyam Kumar

#6

Hi Shyam,
Ludwig is a toolbox for deep learning models. You can obtain something similar to arima using a specific combiner after a timeseries input feature with a passthrough encoder, but that's not really the intent of the library. If you want to use arima, there's plenty of packages that implement it, if you want to use a deep model, you have an easy time with Ludwig ;)
Cheers,
Piero

#8

Hi Sutirtha,
a couple things: you are getting a few erors when loading the data, so I'm not really sure in which order you are running the cells and what actually is the problem. if train is not none this should work without problems.
Also, the output seems to me like a numerical, not as a category, but maybe I'm misunderstanding your data, the names of the columns don't seem indicative to me.
Also, I'm not sure which version of ludwig you are using, but I suggest you to update to the newest release v0.3
Cheers,
Piero

SutirthaChakraborty unaccepted post #2 and accepted post #8 as the answer
#9
#10

My csv file contained 663 columns. Containing float values. The last (663 th) column is either classified as 1 if its a beat, otherwise 0.

  • I have created two
    columns 664- which has all the inputs concatenated with space named it 'ColumnA'.
    columns 665- which has all the output either 0 or 1 named it 'ColumnA'.
model_definition = {
    "input_features":
        [
           {"name": "ColumnA", "type": "timeseries"}
        ],
    "output_features":
        [
            {"name": "ColumnB", "type": "category"}
        ],
    "training":

            {"batch_size": 512, "epochs": 5}
}

I know the dataset is quite large still if you want to see it.

SutirthaChakraborty unaccepted post #8 and accepted post #2 as the answer
#11