# How can I use a string as input in a neural network?

I'm making a program that can determine if a user will like a car from different auctions based on the cars that he/she has bought in the past. Therefore, I want to use the make and model (which are represented as strings) as well as the year, mileage etc... but I'm having trouble to decide on how I'll pass them to the neural network

I've been thinking of using a vector of different makes as such:

 car_make = [[10000]  # Nissan
[01000]  # Toyota
[00100]  # Ford
[00010]  # Dodge
[00001]] # Mazda


I could pass those numerical values as input but making this is limited as there are tons of different makes, since I'm looking for cars in many different auctions. I have no idea how I can represent the models too as they also change in every auction.

You have any ideas on how I can pass the strings onto the neural network?

p.s I'm using python to build the neural network.

## 1 Answer

there is no other way i guess. since each one is of different type(Categorical varaible) you can only one hot encode them.

• I'll try to narrow done the makes to a sample of maybe 10 or something and do the same for their most popular model of car and hopefully that can work. Aug 6, 2018 at 0:17
• yeah, that could be better Aug 6, 2018 at 0:27