Machine learning methods on 1 feature dataset
Can I use any machine learning methods having only one feature?

Yes!

In fact, many NLP classifications tasks are in this format. Given 1 piece of text, classify something. For example:


Given 1 review, classify the sentiment
Given 1 news article, classify the topic
Given 1 chat message, classify the intent


And now you have:


Given 1 name, classify the Fullname


Can a better method be used?

Like you mentioned, you could just find the most common Fullname for a given name and every time you get a name you have a lookup table for the Fullname. However, what will happen when a name you have never seen before appears, how do you classify it? Are you also assuming that you already have the full list of Fullnames?

Assumption: you know all Names and Fullnames

In this case, do as you suggested. Create a dictionary mapping Name-Fullname by finding the most common Fullname for every Name.

Assumption: you know all Fullnames but not all Names

Let say you have the mappings:

Peter -&gt; Johnson
John  -&gt; Smith


Then, there is a name you have never seen before, Pete for example, which does not appear in your mapping table.

You could try two approaches:


The simple way - find which name in the mapping is closest to Pete using some word distance measure, like Levenshtein.
The more robust way - forget the notion of mapping table and use a machine learning model. You will need the following things:


A text vectorizer to transform your text into a numerical vector. I would suggest a character level n-gram TF-IDF.
A classifier. If you use the vectorizer I suggested, then you will need a linear classifier, like an SVM.



If you go to with approach two, when you encounter the name Pete, it will be spit into n-grams (e.g. [pe, et, te, pet, ete]) and vectorized.

Assumption: you don't know all Fullnames and you don't know all Names

This gets more interesting because you could be working with Fullname generation.

It could be used when you move to names from other countries as well.

For example, you already have the mapping:

Peter -&gt; Johnson
John  -&gt; Smith


Then you start dealing with Dutch names and encounter Pieter and Jan.
Then you might want to get the following results where even the Fullnames are different:

Pieter -&gt; Janssen
Jan    -&gt; Smeets


For this, you could use a seq-to-seq Recurrent Neural Network. The architecture can be similar to ones used for neural language translation.

However, all embeddings you create have to be character level. Instead of learning an embedding for every word, you learn for every character. You also feed your network one character at a time. This way, you will be less likely to find "out of vocabulary" tokens (except for when you find character from another alphabet).