Tag: python
44 articles
AI Research #134: Java 2025 - Will It Decline?
In 2025, Java remains the enterprise backend and critical industry workhorse. Key keywords: Java 25 LTS, Java 21 LTS, Spring Boot, MicroProfile, Kubernetes, Serverless, Project Loom, GraalVM Native...
AI Research #133: Java vs Kotlin/Go/Rust/Python/Node 2025
Comprehensive comparison of Java 21/23 (Virtual Threads/Loom) with Kotlin 2.x, Go 1.22/1.23, Rust 1.7x, Python (PyTorch 2.x/TensorFlow 2.x), Node.js 20/22. Covers ecosystem, performance, and applic...
AI Research #131: Java 17/21/25 Complete Comparison
Java 17 (2021), Java 21 (2023), Java 25 (2025) language and JVM changes, covering Virtual Threads (Project Loom), Records/Pattern Matching (Project Amber),...
sklearn KMeans Key Attributes & Evaluation: cluster_cente...
scikit-learn (sklearn) KMeans (2026) explains three most commonly used objects: cluster_centers_ (cluster centers), inertia_ (Within-Cluster Sum of Squares),...
KMeans n_clusters Selection: Silhouette Score Practice + ...
KMeans n_clusters selection method: calculate silhouette_score and silhouette_samples on candidate cluster numbers (e.g., 2/4/6/8), determine optimal k by...
Python Hand-Written K-Means Clustering on Iris Dataset: F...
Python K-Means clustering implementation: using NumPy broadcasting to compute squared Euclidean distance (distEclud), initializing centroids via uniform...
K-Means Clustering Practice: Self-Implemented Algorithm V...
K-Means clustering provides an engineering workflow that is 'verifiable, reproducible, and debuggable': first use 2D testSet dataset for algorithm verification...
Scikit-Learn Logistic Regression Implementation: max_iter...
When using Logistic Regression in Scikit-Learn, max_iter controls maximum iterations affecting model convergence speed and accuracy. If training doesn't...
K-Means Clustering Guide: From Unsupervised Concepts to I...
K-Means clustering algorithm, comparing supervised vs unsupervised learning (whether labels Y are needed), with engineering applications in customer...
Deep Understanding of Logistic Regression & Gradient Desc...
Logistic Regression (LR) is an important classification algorithm in machine learning, widely used in binary classification tasks like sentiment analysis,...
How to Handle Multicollinearity: Common Problems & Soluti...
When using scikit-learn for linear regression, how to handle multicollinearity in least squares method. Multicollinearity may cause instability in regression...
Linear Regression Machine Learning Perspective: Matrix Re...
Linear Regression core chain: unify prediction function y=Xw in matrix form, treat parameter vector w as only unknown; use loss function to characterize...
NumPy Matrix Multiplication Hand-written Multivariate Lin...
pandas DataFrame and NumPy matrix multiplication hand-written multivariate linear regression (linear regression implementation). Core idea is to form normal...
sklearn Decision Tree Pruning Parameters: max_depth/min_s...
Common parameters for decision tree pruning (pre-pruning) in engineering: max_depth, min_samples_leaf, min_samples_split, max_features, min_impurity_decrease...
Confusion Matrix to ROC: Complete Review of Imbalanced Bi...
Confusion matrix (TP, FP, FN, TN) with unified metrics: Accuracy, Precision, Recall (Sensitivity), F1 Measure, ROC curve, AUC value, and practical business interpretation for classification models.
Decision Tree from Split to Pruning: Information Gain/Gai...
Complete chain from 'split' to 'pruning', explain why usually uses greedy algorithm to form 'local optimum', and differences in splitting criteria between...
sklearn Decision Tree Practice: criterion, Graphviz Visua...
Complete flow of DecisionTreeClassifier on load_wine dataset from data splitting, model evaluation to decision tree visualization (2026 version). Focus on...
LangChain-26 Custom Agent Complete Tutorial Building a Cu...
This article demonstrates how to create a chat agent using the Langchain library and GPT-4 model in Python by defining tool functions and integrating them with LLM to achieve queries for informatio...
LangChain-24 AgentExecutor Comprehensive Guide
This article introduces how to use the Langchain library in Python for document retrieval, load web content, configure OpenAIEmbeddings, and integrate GPT-3.5-turbo model for Q&A. It demonstrates h...
LangChain-25 ReAct Framework Detailed Explanation Integra...
This article introduces ReAct, a framework that uses logical reasoning and action sequences to achieve goal-oriented tasks through LLM decision-making and operations. The core components include Th...
LangChain-22 Text Embedding and FAISS Practical Explanation
This article introduces the key role of TextEmbedding in NLP, how to convert text into real number vectors to represent semantic relationships, and how to combine OpenAIEmbeddings and FAISS for eff...
LangChain-23 Vector AI Semantic Search System Vector Data...
This article introduces how to use Chroma vector database to process and retrieve high-dimensional vector embeddings from documents, vectorize them using...
LangChain-20 Document Loaders TextLoader, CSVLoader, PyPD...
This article introduces various document loaders provided by the LangChain library, such as TextLoader, CSVLoader, DirectoryLoader, etc., demonstrating how to load and process data in various formats.
LangChain Text Splitter: Character, Word, HTML and Code-b...
This article introduces various TextSplitters in the LangChain library, including character-based, word-based, HTML tag-based, and programming language-based splitters, as well as their application...
LangChain Cache Mechanism: InMemoryCache and SQLiteCache ...
LangChain provides a comprehensive caching mechanism to significantly reduce LLM call latency and costs. Its core includes InMemoryCache (in-memory cache) and SQLiteCache (persistent cache).
LangChain-19 TokenUsage Callback Function Explained
Explains how to integrate OpenAI GPT-3 model in Python through LangChain library, demonstrating how to use the `get_openai_callback` function to obtain callbacks and execute requests.
LangChain-16 Using Tools: Mastering LLM Tool Calling
LangChain is currently one of the most popular LLM application development frameworks, specifically designed for building intelligent assistants, automation...
LangChain-17 Function Calling AI Function Calling Explained
Function Calling is a core technology for Large Language Models (like GPT-4, Claude, Gemini) to interact with external systems. It enables AI to not only understand language but also execute tasks,...
LangChain-14 OpenAI Content Moderation (Moderation) Expla...
Content moderation is a core component of modern internet platform safety and compliance, used to identify, filter, and manage user-generated content (UGC) to prevent the spread of illegal, low-qua...
LangChain-15 Intelligent Knowledge Retrieval: AgentExecut...
Build an intelligent knowledge retrieval system using Wikipedia search plugin, AgentExecutor, and LangChain tools. Covers agent initialization, tool binding, and multi-step reasoning workflows.
LangChain-12 Routing By Semantic Similarity
This article introduces a method using large models (like OpenAI) and Prompt templates to handle unexpected inputs in program design by calculating the similarity between queries and preset templates.
LangChain-13 Memory ConversationBufferMemory: Conversatio...
This article introduces how to use tools in the LangChain library to manage conversation context of large models in Python. Through components like...
LangChain-11 Code Writing FunctionCalling: Autoregressive...
This article introduces how to use the GPT-3.5-Turbo model to write Python code to solve users' abstract calculation problems, such as 2+2 and complex mathematical expressions, demonstrating the mo...
LangChain 09 - Query SQL DB with RUN GPT
This article introduces how to use Python libraries like langchain and ChatOpenAI (GPT-3.5-turbo) combined with SQLite database to create a program to execute SQL queries and return results in natu...
LangChain 10 - Agents Langchainhub Guide
This article introduces how to use LangChainHub's Hub mechanism through Python code to easily access and share Prompts. Although the project hasn't been...
LangChain 07 - Multiple Chains
How to use Runnable and Prompts in LangChain to create chainable conversation flows for multi-stage question answering, with practical examples of sequential and parallel chain composition.
LangChain 08 - Query SQL DB with GPT
This article introduces how to use LangChain framework to import Chinook SQLite database through Python script and use GPT model to execute SQL queries, such as calculating employee count.
LangChain 05 - RAG Enhanced Conversational Retrieval
This article introduces how to use tools in LangChain library, such as OpenAIEmbeddings and ChatModels, combined with document retrieval technology, to create a program that generates answers based...
LangChain 06 - RAG with Source Document
Retrieval-Augmented Generation (RAG) with Source Document is an AI technology framework that combines retrieval with large language model generation. Its core...
LangChain 03 - astream_events Streaming Output with FAISS...
This article introduces how to use DocArrayInMemorySearch to vectorize text data, combined with OpenAIEmbeddings and GPT-3.5 model, to implement relevant information retrieval and answer generation...
LangChain 04 - RAG Retrieval-Augmented Generation
This article explains in detail how to use RAG technology in LangChain, combined with OpenAI's GPT-3.5 model, to improve text generation quality through retrieval and generation. Provides installat...
LangChain 01 - Getting Started: Quick Hello World Guide
This article introduces how to use the LangChain library with OpenAI API and GPT-3.5-turbo model to create a template for generating jokes about specific topics (like cats). The author demonstrates...
LangChain 02 - JsonOutputParser and Streaming JSON Data P...
This article explains how to install and use LangChain and OpenAI API in Python, retrieve specified country and its population data through async functions, and demonstrates the process of progress...
Python Offline Deployment: pip Dependency Management With...
How to export Python packages in an online environment and install them in an air-gapped system using pip wheel, pip download, and requirements.txt for offline deployment.