Chengwei LEI, Ph.D.    Associate Professor

Department of Computer and Electrical Engineering and Computer Science
California State University, Bakersfield

 

3 Lines Programming


 

In the modern programming landscape, particularly in the field of machine learning and data science, development has become significantly more efficient and accessible thanks to the rich ecosystem of Python libraries.

Instead of implementing complex algorithms from scratch, developers and researchers can simply import pre-built packages and apply powerful techniques with just a few lines of code.

Tasks that once required deep mathematical knowledge and extensive manual coding can now be accomplished quickly, accurately, and with far less effort.

  


In my simple words, this is called "3 Lines Programming":

 

Line 0: import xxxxx
Line 1: Data loading
Line 2: myModel = magic.TrainFun(inputData1)
Line 3: result = magic.PredictFun(myModel, inputData2)

Here is an example from ChatGPT, you can "learn" 6 algorithms within 6 mins.

 

 

 

 

or, you can do something "advanced"~~ "5 Lines Programming":

Line 0: import xxxxx
Line 1: Data loading
Line 2: Training a model
Line 3: Predicting
Line 4: Evaluating performance
Line 5: Visualization

  


Limitations and Disadvantages

While modern Python packages make machine learning highly accessible and efficient, this abstraction comes with certain limitations:

  1. Lack of Deep Understanding
    Many users rely on high-level functions without understanding the underlying math or logic. This can lead to a superficial grasp of machine learning, where users can apply algorithms but not truly explain or justify them.

  2. Inability to Modify Algorithms
    Pre-built functions are convenient but not easily customizable. If a unique problem requires a modified version of an algorithm, users may struggle without deep algorithmic knowledge or experience working with low-level implementations.

  3. Difficulty in Algorithm Selection
    When faced with complex or non-standard problems, it’s often unclear which algorithm is best suited. Without foundational knowledge, users may default to trial-and-error rather than informed decision-making.

  4. Overfitting to Tools Rather Than Problem-Solving
    There's a tendency to apply whatever is easiest with the available tools, rather than deeply analyzing the nature of the problem and designing a solution accordingly.

  5. False Confidence and Misuse
    Since the output is easy to generate, there's a risk of misinterpreting results or using models incorrectly — especially without understanding assumptions, limitations, or proper evaluation metrics.