1
votes

I am just starting on with mahout and is thinking of building a recommendation engine from my existing data. The data in my current tables is stored in the format like

userId  From      TO        Meal    Carrier            Travel type

MT001   London    Abu Dhabi Non-Veg Lufthansa          International
MT001   Abu Dhabi Beijing   Veg     Lufthansa          International
MT001   New York  Chicago   Non-Veg American Airlines  Domestic
MT002   New York  Texas     Veg     American Airlines  Domestic

Now I want to convert this data set to the data model which is accepted by mahout. I know that format for mahout data model is like

userId(int),itemId(int),preference value(float)

Can anyone please suggest how can I convert my travel data set above( which includes much more column and different datatypes than mohout data model) to the data model supported by mahout. Any help will be appreciated.

1

1 Answers

1
votes

I guess you have to rewrite you Data model class, try extending and rewriting the AbstractDataModel class,you can also try using IDMigrator control which is provided in the framework to convert your string to integer value.

Go through this topic- Mahout : To read a custom input file