<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8334644488876867179</id><updated>2026-03-24T06:31:27.334-07:00</updated><category term="Transformers"/><category term="Deep learning"/><category term="Azure Functions"/><category term="Azure"/><category term="machine learning"/><category term="python"/><category term="MySQL"/><category term="linear regression"/><category term="Backpropagation"/><category term="Security"/><category term="linq"/><category term="opencv"/><category term="Azure AD"/><category term="Cloud Security"/><category term="Function App"/><category term="RNN"/><category term="best practices"/><category term="c#"/><category term="cloud computing"/><category term="parthavi  atri"/><category term="scalability"/><category term=".net core"/><category term="Authentication"/><category term="Azure App Service"/><category term="Azure Blob Storage"/><category term="Azure Cosmos DB"/><category term="Azure Data Factory"/><category term="Azure Function"/><category term="Azure Service Bus"/><category term="CNN"/><category term="CNNs"/><category term="Conditional Access"/><category term="Forward Propagation"/><category term="Gradient descent"/><category term="ML Basic"/><category term="Multi-Factor Authentication"/><category term="PyTorch"/><category term="Storage Account"/><category term="Terraform"/><category term="angular"/><category term="asp.net mvc"/><category term="computed properties"/><category term="create"/><category term="custom triggers"/><category term="dropdown"/><category term="hosting plan"/><category term="identity and access management"/><category term="jquery"/><category term="mera parthu"/><category term="neural networks"/><category term="operating system"/><category term="resource group"/><category term="runtime stack"/><category term="scalable"/><category term="subscription"/><category term="testing"/><category term="$(&#39;#id&#39;).html()"/><category term="&#39;Where ever you go"/><category term="&#39;preview&#39; language version"/><category term=".NET 6"/><category term=".NET 6 minimal API"/><category term="ADF triggers"/><category term="AI"/><category term="AKS cluster"/><category term="ASP.NET Core"/><category term="Access Control"/><category term="Activate the Process"/><category term="Activator"/><category term="Active Directory"/><category term="All Column Count"/><category term="All column names in MySQL"/><category term="Anomaly Detection"/><category term="App Service plan"/><category term="Architecture"/><category term="Automated Workflow"/><category term="Azure AD Connect"/><category term="Azure AI search"/><category term="Azure Active Directory"/><category term="Azure Batch"/><category term="Azure Event Hubs"/><category term="Azure KeyVault Secret"/><category term="Azure Kubernetes Service (AKS)"/><category term="Azure Logic Apps"/><category term="Azure SQL"/><category term="Azure SignalR Service"/><category term="Azure Storage"/><category term="Azure VM"/><category term="Azure VMs"/><category term="Azure portal"/><category term="Azure portal."/><category term="Azure security"/><category term="Azure-cli"/><category term="AzureActivity table"/><category term="Blob Storage"/><category term="Blob Trigger"/><category term="Blogspot’s XML parser"/><category term="CDN"/><category term="CMS"/><category term="CRM Plugin"/><category term="CSV file"/><category term="CSV files"/><category term="ChatGPT"/><category term="Checkbox values comma separated"/><category term="Coding Monsters"/><category term="Cognitive Search"/><category term="Cold-start times"/><category term="Column count"/><category term="Computer Vision Tasks"/><category term="Considerations"/><category term="Consumption plan"/><category term="Copy Data Activity"/><category term="Cosmos DB Trigger"/><category term="Cost Optimization"/><category term="Custom Domain"/><category term="Custom Script Extension"/><category term="DALL·E"/><category term="Data Flow activity"/><category term="Data Flows"/><category term="Data integration"/><category term="Data orchestration"/><category term="Database"/><category term="DateTime"/><category term="Deciding When to Create an MVC Application"/><category term="Delete All Stored Procedures and Tables"/><category term="ETL processes"/><category term="Email templates in MS CRM 2013"/><category term="Entity Framework"/><category term="Event Grid Trigger"/><category term="Event Hub Trigger"/><category term="Exception Monsters"/><category term="Extract"/><category term="F1 score"/><category term="FIFO"/><category term="Falcon 7b &amp; 40b"/><category term="File Archiving"/><category term="GPT-3"/><category term="GPU vs CPU"/><category term="Get Checkbox values comma separated using jquery"/><category term="Global Search Feature of MS CRM 2015"/><category term="HOW TO USE SUB QUERY IN INNER JOIN"/><category term="HTTP Extension"/><category term="HTTP Trigger"/><category term="Handwritten Digit Recognition"/><category term="IComparable"/><category term="ITR"/><category term="Identity Governance"/><category term="Identity Management"/><category term="Image classification"/><category term="Intel vs Nvidia"/><category term="JDBC"/><category term="JWT"/><category term="Kubernetes"/><category term="Kusto Query Language"/><category term="LINQ methods As vs To"/><category term="LLM"/><category term="Laravel"/><category term="LightSaml"/><category term="Linux VM"/><category term="List&lt;T&gt;  Capacity vs Count"/><category term="Load"/><category term="Load (ETL)"/><category term="Log Analytics"/><category term="MS CRM 2013"/><category term="MS CRM 2015"/><category term="MS Dynamics CRM"/><category term="MS Dynamics CRM 2013"/><category term="MS Dynamics CRM 2015"/><category term="MS sql server 2005"/><category term="MVC Sample application"/><category term="Marshal.AllocHGlobal"/><category term="Marshal.FreeHGlobal"/><category term="Mean Squared Error"/><category term="Memory Leaks"/><category term="Micro Front-end"/><category term="Migrating Functions"/><category term="Mixed Mode (Windows Authentication and   SQL Server Authentication)"/><category term="Monitoring"/><category term="Monitoring and auditing."/><category term="Monsters for a developer"/><category term="Motion Detection"/><category term="New Feature of MS CRM 2015"/><category term="Object Detection"/><category term="Office 365"/><category term="OpenCV-Python"/><category term="OpenID Connect"/><category term="Optimization"/><category term="OrderBy"/><category term="PHP"/><category term="Package"/><category term="Parsing"/><category term="Partial"/><category term="Pay-as-you-go model"/><category term="Performance"/><category term="Pipeline creation"/><category term="PowerShell"/><category term="PowerShell script"/><category term="Private Endpoint"/><category term="Process"/><category term="Productivity"/><category term="Provisioners"/><category term="Query"/><category term="Quick Find MS CRM 2015"/><category term="RDLC report using xsd"/><category term="RDLC report using xsd  with  c#"/><category term="ROC curve"/><category term="Resource"/><category term="Resource Management"/><category term="Response"/><category term="Reversible Residual Layers"/><category term="SAML"/><category term="SAML Request"/><category term="SAML Response"/><category term="SEO"/><category term="SQL query"/><category term="SSH"/><category term="SUBQUERY IN INNER JOIN"/><category term="SameSite"/><category term="Scoring"/><category term="Search Score"/><category term="Select all dates between first day of month and current date without loop"/><category term="Server sent charset unknown to the client."/><category term="Serverless computing"/><category term="Service Bus Queue Trigger"/><category term="Service Bus Topic Trigger"/><category term="Single Sign-On"/><category term="Sink transformation"/><category term="Sitecore"/><category term="Source transformation"/><category term="SourceFields"/><category term="Sparse Transformers"/><category term="Spot VMs"/><category term="Static Website"/><category term="Stochastic gradient descent (SGD)"/><category term="Storage Queue"/><category term="Suggest API"/><category term="Suggester Definition"/><category term="System.Linq"/><category term="System.Security.Cryptography"/><category term="Table"/><category term="Test"/><category term="The specified service has been marked for deletion."/><category term="Time Series Forecasting"/><category term="Timer Trigger"/><category term="ToList() performance impacts"/><category term="Transform"/><category term="Transform (ELT) vs. Extract"/><category term="Transformer-based Image Generation"/><category term="URL"/><category term="USE SUBQUERY IN INNER JOIN"/><category term="Use string type comma separated in IN clause in sql"/><category term="User Input"/><category term="User Provisioning"/><category term="VMs in Azure"/><category term="VPN"/><category term="View Model with observable"/><category term="Vision Transformers (ViT)"/><category term="Visualizing Transformer Attention"/><category term="Vodafone  has the best coverage"/><category term="WPF"/><category term="Windows Authentication"/><category term="Windows Authentication Mode"/><category term="Women are never wrong. Apologizing is the man’s responsibility."/><category term="Workflow"/><category term="XLSX file"/><category term="[SC] DeleteService FAILED 1072"/><category term="activation functions"/><category term="active blogger"/><category term="additon using knockoutjs"/><category term="admin-access"/><category term="apache service not started"/><category term="app setting"/><category term="asp.net"/><category term="audience engagement"/><category term="auto-commit"/><category term="back-channel sign-out"/><category term="bash: apt-get: command not found"/><category term="batch processing"/><category term="beginners example of knockout.js"/><category term="bias-variance trade-off"/><category term="bulk insert"/><category term="bulk inserts"/><category term="cURL"/><category term="calculate age"/><category term="call center"/><category term="change number of columns run time in pivot"/><category term="change skype port"/><category term="checkbox list seleted items value comma separated"/><category term="checkboxlist"/><category term="code in blog"/><category term="collapsable region in js file"/><category term="collections"/><category term="comma separated values"/><category term="commit control"/><category term="compliance"/><category term="configuration"/><category term="connection string"/><category term="container"/><category term="containers"/><category term="content marketing"/><category term="cost savings"/><category term="cost-effective"/><category term="count selected item"/><category term="cross-request forgery"/><category term="curse of dimensionality"/><category term="data manipulation"/><category term="data pipeline"/><category term="data processing"/><category term="data protection"/><category term="data storage"/><category term="database publishing wizard"/><category term="date formats"/><category term="datetime default value"/><category term="decoupling"/><category term="default browser"/><category term="default datetime"/><category term="deployment"/><category term="docker image"/><category term="dynamic pivot"/><category term="dynamic sql"/><category term="e-commerce"/><category term="employee list"/><category term="empty line"/><category term="environment"/><category term="event-driven applications"/><category term="excel file data into datatable  in c#"/><category term="execute query shortcut"/><category term="external users"/><category term="fast game rendering"/><category term="file save open dialog box"/><category term="fine-tune"/><category term="flexibility"/><category term="float number"/><category term="front-channel sign-out"/><category term="function"/><category term="function code"/><category term="get selected option value using jquery"/><category term="govt. of india"/><category term="grouping in rdlc"/><category term="happy holi"/><category term="hash password"/><category term="hello world app of knockout js"/><category term="high availability"/><category term="holi"/><category term="how to get everytime new rows"/><category term="htm()"/><category term="html code in blog"/><category term="identity protection"/><category term="iframe"/><category term="image recognition"/><category term="implementation"/><category term="income tax return"/><category term="india"/><category term="input bindings"/><category term="insert  dataset into sql server 2005+"/><category term="insert multiple"/><category term="insert multiple rows"/><category term="insert multiple rows sql server 2008"/><category term="insert rows"/><category term="insert using xml"/><category term="installation of slq server 2005"/><category term="internet explorer"/><category term="java script in asp.net page"/><category term="java script in aspx page"/><category term="javascript code in blog"/><category term="javascript variable value server side"/><category term="join domain"/><category term="jquery val function"/><category term="key measures"/><category term="knockout.js"/><category term="knockoutjs"/><category term="lado rani badi syani piti dudh batati pani"/><category term="lead generation"/><category term="linear regression model"/><category term="linux ssh"/><category term="list item selected items text comma seprated"/><category term="load leveling"/><category term="logout"/><category term="mail"/><category term="make text as UPPERCASE  in knockoutjs"/><category term="management"/><category term="material tailwind"/><category term="maximum salary"/><category term="message filtering"/><category term="message passing"/><category term="message queueing"/><category term="messaging entities"/><category term="method signature"/><category term="method signature not  include return type. and a method can be not overloaded just by changing its return type ."/><category term="minimal API authentication"/><category term="minimize the window on cross button click event"/><category term="months and days"/><category term="mvc bundling"/><category term="my blog"/><category term="my sweet doll"/><category term="mysql and validate also each column and rows before import"/><category term="mysql rand() function"/><category term="mysql random rows selection"/><category term="nesting of computed properties"/><category term="network security"/><category term="new  login object explorer"/><category term="new rupees sign"/><category term="nice jquery message when data is saved."/><category term="nice jquery validation message"/><category term="node on window 10"/><category term="numpy"/><category term="observable  properties of knockout.js"/><category term="on-premises"/><category term="optimize"/><category term="or get the duration between two dates in years"/><category term="our network follows"/><category term="overfitting"/><category term="overloading"/><category term="parallel processing."/><category term="parthavi images"/><category term="parthavi pics"/><category term="pathu"/><category term="performance optimization"/><category term="personalized content"/><category term="pivot table"/><category term="pods"/><category term="point-to-point"/><category term="policies"/><category term="port  80 is busy"/><category term="precision"/><category term="print 1 to 10 usig common table expression"/><category term="priya"/><category term="programming language"/><category term="public properties in a class c#"/><category term="publish"/><category term="publish-subscribe"/><category term="queues"/><category term="rdlc  drill down report"/><category term="real-time"/><category term="real-time image processing"/><category term="recall"/><category term="region"/><category term="region."/><category term="remove background from images"/><category term="replace html of a div using jquery"/><category term="resources"/><category term="retry mechanism"/><category term="salt"/><category term="scaling"/><category term="screencast"/><category term="secure cloud environment"/><category term="select"/><category term="select  month name"/><category term="selected items in checkboxlist"/><category term="selected value"/><category term="serial number for group in rdlc"/><category term="serial number in rdlc"/><category term="serverless architecture"/><category term="serverless web app"/><category term="set hidden field using jquery"/><category term="set program access and defualts"/><category term="several programming languages"/><category term="sign-in activity"/><category term="sim"/><category term="simple common table expression example"/><category term="simple example of using observable"/><category term="simple knockoutjs"/><category term="single sign-out"/><category term="skype"/><category term="slection of dropdown jquery"/><category term="so that it can be use in IN statement in"/><category term="social media marketing"/><category term="speed limit error message"/><category term="sql"/><category term="sql common table expression example"/><category term="static pivot."/><category term="store in db"/><category term="stored procedures"/><category term="supports"/><category term="synchronization"/><category term="system.outofmemoryexception"/><category term="tables"/><category term="tempdata"/><category term="threat detection"/><category term="to use comma seprated values in to a table"/><category term="toggle anchor tag text on click of anchor"/><category term="topics"/><category term="transaction management"/><category term="transformation"/><category term="trigger type"/><category term="tutorial video"/><category term="typescript"/><category term="ulta-pulta"/><category term="update table from another table or same table using inner join"/><category term="uppercase in knockoutjs"/><category term="value .select dropdown text using jquery"/><category term="version"/><category term="viewbag"/><category term="viewdata"/><category term="viewmodel binding with html in knockout.js"/><category term="virtual machines"/><category term="visual studio"/><category term="vodafone"/><category term="vs code errors"/><category term="weight&amp;biases"/><category term="what is the difference between wcf service and web service?"/><category term="window settings"/><category term="windows powershell"/><category term="workbench. mysql"/><category term="youtube"/><category term="zoom"/><title type='text'>neural networks </title><subtitle type='html'>My 2 cents on neural networks </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>276</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-8264532958376233423</id><published>2025-07-26T21:05:00.000-07:00</published><updated>2025-07-26T21:05:22.286-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Azure"/><category scheme="http://www.blogger.com/atom/ns#" term="Azure AI search"/><title type='text'>How cache can be enabled for embeded text as well for search query results in Azure AI ? </title><content type='html'>&lt;p&gt;&amp;nbsp;Great question, Rahul! Caching in the context of Azure AI (especially when using **RAG pipelines with Azure OpenAI + Azure AI Search**) can **dramatically reduce latency and cost**, especially for frequently repeated or similar queries.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here’s how you can cache both:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;---&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;## ✅ 1. **Caching Embedded Text (Documents)**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Since embeddings are expensive to compute and documents rarely change often, caching them is **critical**.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;### 💡 Strategy: Use a persistent storage for document embeddings&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;### 🔧 How:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;* Use **Azure Blob Storage**, **Azure SQL**, or **Cosmos DB** to **store each document&#39;s embedding** with a content hash (MD5/SHA256) as the key.&lt;/p&gt;&lt;p&gt;* Before calling Azure OpenAI embedding API, **check if hash exists**.&lt;/p&gt;&lt;p&gt;* If yes → retrieve the cached embedding.&lt;/p&gt;&lt;p&gt;* If no → call API, then store.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;import hashlib&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;def get_or_generate_embedding(doc_text):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; content_hash = hashlib.sha256(doc_text.encode()).hexdigest()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; cached = db.get_embedding_by_hash(content_hash)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if cached:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return cached&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; else:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; embedding = call_openai_embedding(doc_text)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; db.save_embedding(content_hash, embedding)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return embedding&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;gt; 🔐 You can even pre-compute and persist embeddings as part of your Logic App ingestion pipeline.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;---&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;## ✅ 2. **Caching Query Embeddings and Search Results**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This is useful when:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;* Users repeat similar questions often.&lt;/p&gt;&lt;p&gt;* You want to avoid repeated vector searches.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;### 🔧 How:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **Hash the user query** → e.g., SHA256 of lowercase query string.&lt;/p&gt;&lt;p&gt;2. Store:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;* The **embedding** (for reuse)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;* The **top N search results** from Azure AI Search as JSON&lt;/p&gt;&lt;p&gt;3. Use **Redis**, Cosmos DB, or Blob as cache store with TTL (e.g., 6 hours).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;### Example:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;def search_with_cache(query_text):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; query_hash = hashlib.sha256(query_text.lower().encode()).hexdigest()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; cached = redis.get(f&quot;search:{query_hash}&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if cached:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return json.loads(cached)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Not in cache, do embedding + search&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; query_embedding = get_or_generate_embedding(query_text)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; results = azure_ai_vector_search(query_embedding)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Cache results for later&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; redis.setex(f&quot;search:{query_hash}&quot;, 6 * 3600, json.dumps(results))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; return results&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;---&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;## 🔄 TTL and Invalidation Strategy&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;| Data&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| TTL suggestion&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Invalidation case&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/p&gt;&lt;p&gt;| -------------------- | -------------------------- | ------------------------------- |&lt;/p&gt;&lt;p&gt;| Document embeddings&amp;nbsp; | No expiry (immutable docs) | On document update&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/p&gt;&lt;p&gt;| Search query results | 6–24 hours&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Rarely — maybe on index refresh |&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;---&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;## 📦 Where to Store Cached Data?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;| Option&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | Use for&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Notes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/p&gt;&lt;p&gt;| --------------- | --------------------------- | ----------------------- |&lt;/p&gt;&lt;p&gt;| Azure Redis&amp;nbsp; &amp;nbsp; &amp;nbsp;| Fastest real-time caching&amp;nbsp; &amp;nbsp;| Supports TTL, in-memory |&lt;/p&gt;&lt;p&gt;| Azure Cosmos DB | Persistent embedding store&amp;nbsp; | For doc-level cache&amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/p&gt;&lt;p&gt;| Azure Blob&amp;nbsp; &amp;nbsp; &amp;nbsp; | Embeddings + metadata files | Low-cost for bulk data&amp;nbsp; |&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;---&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;## 🧠 Bonus: Use Cache for Grounded Response&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;If you&#39;re using a frontend agent (e.g., chatbot or API app), you can even cache the final GPT response based on prompt hash.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;---&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;## 🚀 Result&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;By caching:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;* 🧠 **Embeddings** — you avoid duplicate calls to Azure OpenAI&lt;/p&gt;&lt;p&gt;* 🔍 **Search results** — you reduce load on Azure AI Search&lt;/p&gt;&lt;p&gt;* 💬 **Responses** — you accelerate latency and reduce token cost&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;---&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Let me know if you want to integrate this into your existing **Logic App + Azure Function** pipeline, or if you want to see a Redis + Python codebase sample!&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/8264532958376233423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2025/07/how-cache-can-be-enabled-for-embeded.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/8264532958376233423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/8264532958376233423'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2025/07/how-cache-can-be-enabled-for-embeded.html' title='How cache can be enabled for embeded text as well for search query results in Azure AI ? '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-7214020305027492707</id><published>2025-07-03T23:12:00.000-07:00</published><updated>2025-07-03T23:12:19.323-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="neural networks"/><title type='text'>can you please explain me Backpropagation &amp; Gradients in layman language as simple as possible </title><content type='html'>&lt;p&gt;&amp;nbsp;Absolutely! Let’s break down &lt;strong&gt;backpropagation&lt;/strong&gt; and &lt;strong&gt;gradients&lt;/strong&gt; in the &lt;strong&gt;simplest possible way&lt;/strong&gt;, like we’re teaching a curious 10-year-old.&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;🎯 The Goal of a Neural Network&lt;/h3&gt;
&lt;p&gt;Imagine a robot that’s learning to throw a basketball into a hoop. It guesses how to throw (speed, angle, etc.) and then checks how far it missed. It wants to adjust its throw to get better next time.&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;📦 Neural Network: A Smart Guessing Machine&lt;/h3&gt;
&lt;p&gt;A neural network is like that robot. It takes input (e.g., an image), makes a guess (e.g., &quot;this is a cat&quot;), and then checks how wrong it was.&lt;/p&gt;
&lt;p&gt;But how does it &lt;strong&gt;learn&lt;/strong&gt; and improve?&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;🚀 Step-by-Step Explanation&lt;/h2&gt;
&lt;h3&gt;1. &lt;strong&gt;Forward Pass&lt;/strong&gt;: Make a Guess&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You give the network some input (e.g., an image).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It passes this through layers of &quot;neurons&quot; and makes a guess (e.g., &quot;cat&quot;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;2. &lt;strong&gt;Loss Function&lt;/strong&gt;: Check How Bad the Guess Was&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The network compares its guess with the correct answer.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If it guessed wrong, it gets a &quot;loss&quot; (an error score).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Higher loss = worse guess.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;3. &lt;strong&gt;Backpropagation&lt;/strong&gt;: Learn From Mistakes&lt;/h3&gt;
&lt;p&gt;Here’s where the &lt;strong&gt;magic&lt;/strong&gt; happens.&lt;/p&gt;
&lt;p&gt;Let’s say the robot aimed too far left. Now it has to figure out &lt;strong&gt;what to adjust&lt;/strong&gt; and by &lt;strong&gt;how much&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Backpropagation works like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;It starts from the end (final output) and goes &lt;strong&gt;backward&lt;/strong&gt; through each layer.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It figures out &lt;strong&gt;which parts of the network caused the mistake&lt;/strong&gt; and &lt;strong&gt;how much&lt;/strong&gt; they contributed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It does this by calculating something called a &lt;strong&gt;gradient&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h3&gt;🌊 What is a Gradient?&lt;/h3&gt;
&lt;p&gt;Imagine you&#39;re standing on a hill in fog and want to reach the bottom.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A &lt;strong&gt;gradient&lt;/strong&gt; tells you which direction to walk and how steep the hill is.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In neural networks, it tells &lt;strong&gt;each part&lt;/strong&gt; of the model &lt;strong&gt;how to change a little&lt;/strong&gt; to reduce the error.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h3&gt;4. &lt;strong&gt;Update Weights&lt;/strong&gt;: Make Small Tweaks&lt;/h3&gt;
&lt;p&gt;Each neuron has weights (think of them like dials or knobs). Gradients tell us:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Which way to turn each knob.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How much to turn it to reduce the error.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We use these gradients to &lt;strong&gt;update the weights&lt;/strong&gt; so that next time, the guess is a little better.&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;🔁 Repeat&lt;/h3&gt;
&lt;p&gt;This process repeats over and over:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Make a guess.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Calculate how wrong it is.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use backpropagation and gradients to update.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Try again and get better.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr /&gt;
&lt;h2&gt;🧠 Summary (Super Simple)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Neural networks guess, make mistakes, and learn by fixing those mistakes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Backpropagation&lt;/strong&gt; is how they figure out what to fix.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Gradients&lt;/strong&gt; tell them exactly how to fix it (like instructions for improvement).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Over time, they become smarter and more accurate.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/7214020305027492707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2025/07/can-you-please-explain-me.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7214020305027492707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7214020305027492707'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2025/07/can-you-please-explain-me.html' title='can you please explain me Backpropagation &amp; Gradients in layman language as simple as possible '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-4557474162783088430</id><published>2024-03-29T02:03:00.000-07:00</published><updated>2024-03-29T02:03:33.630-07:00</updated><title type='text'>ASP.NET Core </title><content type='html'>&lt;p&gt;&amp;nbsp;Certainly! Here are 10 advanced .NET Core interview questions covering various topics:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **ASP.NET Core Middleware Pipeline**: Explain the concept of middleware in ASP.NET Core, and how does the middleware pipeline work? Can you provide an example of a custom middleware implementation?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. **Dependency Injection in .NET Core**: Discuss the importance of dependency injection in .NET Core. How is it implemented, and what are the benefits of using DI in modern application development?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. **Entity Framework Core Performance Optimization**: What are some strategies for optimizing performance when using Entity Framework Core? Discuss techniques such as batching, caching, and using raw SQL.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;4. **ASP.NET Core Authentication and Authorization**: Explain the difference between authentication and authorization in ASP.NET Core. How can you implement various authentication schemes (e.g., JWT, OAuth) and authorization policies in ASP.NET Core applications?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;5. **Microservices Architecture with .NET Core**: Discuss the principles of microservices architecture and how .NET Core supports building microservices-based applications. What are some challenges and best practices for designing and implementing microservices using .NET Core?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;6. **Docker and .NET Core**: How does Docker facilitate containerization of .NET Core applications? Discuss the benefits of using Docker for .NET Core development, deployment, and scalability.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;7. **Performance Tuning and Monitoring**: What are some tools and techniques for performance tuning and monitoring of .NET Core applications? How can you identify and address performance bottlenecks in a .NET Core application?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;8. **Asynchronous Programming in .NET Core**: Explain the importance of asynchronous programming in .NET Core for building scalable and responsive applications. Discuss best practices for using async/await, handling exceptions, and avoiding deadlocks.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;9. **ASP.NET Core WebSockets**: What are WebSockets, and how does ASP.NET Core support real-time communication using WebSockets? Can you provide an example of implementing a WebSocket server and client in an ASP.NET Core application?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;10. **ASP.NET Core SignalR**: Discuss the features and benefits of SignalR for building real-time web applications in ASP.NET Core. How does SignalR enable bi-directional communication between clients and servers, and what are some common use cases for SignalR?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;These questions cover a range of advanced topics in .NET Core development, including web development, performance optimization, microservices, containerization, and real-time communication. Understanding these topics demonstrates proficiency in building modern, scalable, and responsive applications using .NET Core.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/4557474162783088430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2024/03/aspnet-core.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/4557474162783088430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/4557474162783088430'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2024/03/aspnet-core.html' title='ASP.NET Core '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-3055911655635651012</id><published>2024-03-29T01:51:00.000-07:00</published><updated>2024-03-29T01:51:00.668-07:00</updated><title type='text'>.net core advance </title><content type='html'>&lt;p&gt;&amp;nbsp;Dependency Injection (DI) is a fundamental concept in .NET Core that facilitates loose coupling between components in an application by allowing dependencies to be injected into a class rather than created internally within the class itself. Here are some advanced interview questions related to Dependency Injection in .NET Core:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **Explain the concept of Dependency Injection and its benefits in .NET Core. How does it promote loose coupling and improve testability?**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. **What are the different lifetimes of services in .NET Core DI container? Explain each type (Transient, Scoped, Singleton) and provide examples of when to use each.**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. **How does .NET Core resolve dependencies when using constructor injection? Explain the process of service registration and resolution in the DI container.**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;4. **What are the drawbacks of using the built-in DI container in .NET Core? When might you consider using a third-party DI container like Autofac or Ninject instead?**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;5. **How can you customize the behavior of the built-in DI container in .NET Core? Provide examples of scenarios where you might need to customize service registration or resolution.**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;6. **Explain the concept of named and typed registrations in .NET Core DI container. When would you use named or typed registrations, and how do you implement them?**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;7. **Discuss the relationship between DI and inversion of control (IoC). How does DI enable IoC, and what are the benefits of applying IoC principles in software design?**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;8. **Explain how you can handle dependency resolution for classes with multiple constructors in .NET Core DI. What are the considerations for selecting the appropriate constructor?**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;9. **How can you resolve dependencies for classes that have dependencies on configuration settings or options in .NET Core? Discuss best practices for injecting configuration settings into classes.**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;10. **Discuss the impact of DI on unit testing in .NET Core. How does DI facilitate mocking and stubbing of dependencies, and what are some best practices for writing unit tests for classes with injected dependencies?**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;These questions cover various aspects of Dependency Injection in .NET Core, including its principles, implementation details, customization options, and its impact on software design, testing, and maintainability. Demonstrating a deep understanding of these concepts and their practical applications can be beneficial in advanced .NET Core interviews.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/3055911655635651012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2024/03/net-core-advance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/3055911655635651012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/3055911655635651012'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2024/03/net-core-advance.html' title='.net core advance '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-7326468660806508741</id><published>2024-03-26T23:18:00.000-07:00</published><updated>2024-03-26T23:18:16.737-07:00</updated><title type='text'>.net core </title><content type='html'>&lt;p&gt;&amp;nbsp;Sure, here are 50 .NET Core architect interview questions along with answers:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **What is .NET Core, and how does it differ from the traditional .NET Framework?**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- **Answer:** .NET Core is a cross-platform, open-source framework for building modern, cloud-native applications. It differs from the traditional .NET Framework in that it&#39;s modular, lightweight, and designed for cross-platform development.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. **Explain the concept of Dependency Injection (DI) in .NET Core.**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- **Answer:** Dependency Injection is a design pattern in which a class receives its dependencies from external sources rather than creating them itself. In .NET Core, DI is built into the framework, allowing developers to register services and inject dependencies into classes using built-in container libraries like Microsoft.Extensions.DependencyInjection.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. **What is ASP.NET Core, and how does it differ from ASP.NET Framework?**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- **Answer:** ASP.NET Core is a cross-platform, open-source web framework for building modern web applications and services. It differs from ASP.NET Framework in that it&#39;s modular, lightweight, and designed for cross-platform development. ASP.NET Core also provides better performance, scalability, and flexibility compared to ASP.NET Framework.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;4. **Explain Middleware in ASP.NET Core.**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- **Answer:** Middleware in ASP.NET Core is a component that handles requests and responses in the request pipeline. Middleware can perform operations such as authentication, authorization, logging, exception handling, and more. Middleware is configured in the Startup class using the `UseMiddleware` method.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;5. **What are the benefits of using Entity Framework Core over Entity Framework 6?**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- **Answer:** Entity Framework Core is a lightweight, cross-platform ORM framework that offers improved performance, better support for modern database features, and enhanced flexibility compared to Entity Framework 6. It also supports asynchronous query execution, simplified data modeling, and easier configuration.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;6. **Explain the concept of Razor Pages in ASP.NET Core.**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- **Answer:** Razor Pages is a lightweight web framework in ASP.NET Core that allows developers to build web pages with minimal ceremony. Razor Pages combine HTML markup with C# code using the Razor syntax, making it easy to create dynamic web applications without the complexities of traditional MVC architecture.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;7. **What is the difference between RESTful APIs and SOAP-based APIs?**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- **Answer:** RESTful APIs are lightweight, stateless, and based on the principles of Representational State Transfer (REST). They typically use HTTP methods like GET, POST, PUT, and DELETE for communication and exchange data in formats like JSON or XML. SOAP-based APIs, on the other hand, rely on the SOAP protocol for communication and use XML for data exchange. They are often more heavyweight and require more overhead compared to RESTful APIs.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;8. **Explain the SOLID principles in software design.**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- **Answer:** SOLID is an acronym for five principles of object-oriented design:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Single Responsibility Principle (SRP): A class should have only one reason to change.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Open/Closed Principle (OCP): Software entities should be open for extension but closed for modification.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Liskov Substitution Principle (LSP): Subtypes must be substitutable for their base types without altering the correctness of the program.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Interface Segregation Principle (ISP): Clients should not be forced to depend on interfaces they do not use.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Dependency Inversion Principle (DIP): High-level modules should not depend on low-level modules. Both should depend on abstractions.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;9. **How would you optimize the performance of a .NET Core application?**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- **Answer:** Performance optimization techniques for .NET Core applications include:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Implementing caching mechanisms.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Optimizing database queries.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Enabling server-side and client-side caching.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Using asynchronous programming techniques.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Profiling and identifying performance bottlenecks.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Leveraging concurrency and parallelism.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Utilizing efficient data structures and algorithms.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;- Implementing lazy loading and deferred execution.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;10. **Explain the concept of Microservices architecture and how .NET Core supports it.**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - **Answer:** Microservices architecture is an architectural style that structures an application as a collection of loosely coupled, independently deployable services. Each service is responsible for a specific business domain and communicates with other services through lightweight protocols like HTTP or messaging queues. .NET Core supports Microservices architecture by providing lightweight, cross-platform frameworks for building independent, scalable services. It offers built-in support for containers, Docker, Kubernetes, and service discovery, making it well-suited for Microservices development and deployment.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;11. **What is Docker, and how can it be used with .NET Core applications?**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - **Answer:** Docker is a platform for developing, shipping, and running applications in containers. Containers are lightweight, portable, and isolated environments that encapsulate an application and its dependencies. .NET Core applications can be packaged into Docker containers, allowing them to run consistently across different environments and platforms. Docker provides tools like Dockerfile and Docker Compose for building, managing, and orchestrating containers, making it easy to deploy .NET Core applications at scale.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;12. **Explain the concept of JWT (JSON Web Tokens) authentication in ASP.NET Core.**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - **Answer:** JWT authentication in ASP.NET Core is a popular mechanism for implementing stateless authentication and authorization in web applications. JWTs are compact, self-contained tokens that contain information about a user and their roles or permissions. In ASP.NET Core, JWT authentication involves generating a token upon successful authentication and including it in subsequent requests as an Authorization header. The server validates the token and grants access to protected resources based on its contents.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;13. **What are the benefits of using Azure DevOps for CI/CD pipelines in .NET Core projects?**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - **Answer:** Azure DevOps provides a comprehensive suite of tools for implementing continuous integration (CI) and continuous delivery (CD) pipelines in .NET Core projects. Some benefits include:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - Seamless integration with Azure services and .NET Core tooling.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - Automated build, test, and deployment processes.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - Built-in support for version control, work item tracking, and collaboration.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - Flexible deployment options, including Azure App Service, Kubernetes, and Docker containers.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; - Monitoring and analytics capabilities for tracking pipeline performance and application health.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;14. **What is SignalR, and how can it be used in .NET Core applications?**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - **Answer:** SignalR is a real-time web framework for building interactive, bi-directional communication between clients and servers. It allows server-side code to push content to connected clients instantly, enabling features like chat applications, real-time notifications, and live data updates. In .NET Core applications, SignalR can be used to create WebSocket-based communication channels, which provide low-latency, high-performance messaging capabilities.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;15. **Explain the concept of Blazor and its role in .NET Core web development.**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - **Answer:** Blazor is a framework for building interactive web applications using C# and HTML. It allows developers to write client-side web UI code in C# instead of JavaScript, leveraging the power of .NET Core on the client side. Blazor supports two hosting models: Blazor Server, where the application logic runs on the server and UI updates are pushed to the client via SignalR, and Blazor WebAssembly, where the entire application is executed on the client side in WebAssembly.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;16. **What are the different types of&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/7326468660806508741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2024/03/net-core.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7326468660806508741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7326468660806508741'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2024/03/net-core.html' title='.net core '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-1801043772064312416</id><published>2024-01-28T19:19:00.000-08:00</published><updated>2024-01-28T19:19:44.061-08:00</updated><title type='text'>Most complex use case for azure function for a ott palatorm with detail as much as possible </title><content type='html'>&lt;p&gt;&amp;nbsp;Designing a complex use case for an Azure Function in an Over-The-Top (OTT) platform involves addressing various components such as video processing, content delivery, user authentication, and scalability. Here&#39;s a detailed example of a complex use case for an Azure Function in an OTT platform:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;### Use Case: Dynamic Adaptive Streaming over HTTP (DASH) Video Processing&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;#### Objective:&lt;/p&gt;&lt;p&gt;Implement a serverless solution for processing and delivering adaptive streaming videos using Azure Functions within an OTT platform.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;#### Components Involved:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **Video Ingestion:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Users upload videos to a storage container (Azure Blob Storage).&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Azure Blob Storage triggers an Azure Function on new video uploads.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. **Video Encoding:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Upon trigger, the Azure Function initiates a video encoding process using Azure Media Services.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Different bitrate versions of the video are generated to support adaptive streaming.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. **Metadata Generation:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Extract metadata (duration, resolution, etc.) from the encoded videos.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Store metadata in a database (Azure Cosmos DB) for quick retrieval.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;4. **Authentication and Authorization:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Use Azure Functions to handle user authentication and authorization.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Securely validate user access to videos based on subscription plans or access rights.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;5. **Adaptive Streaming Manifests:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Generate Dynamic Adaptive Streaming over HTTP (DASH) manifests (MPD - Media Presentation Description) for each video.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Use Azure Function to dynamically create and update manifests based on available bitrates and resolutions.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;6. **Content Delivery:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Leverage Azure CDN (Content Delivery Network) to cache and deliver video content globally.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Azure Functions can be triggered to invalidate CDN cache when a new version of the video is available.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;7. **User Analytics:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Track user interactions and engagement with videos.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Utilize Azure Application Insights or a dedicated analytics solution for detailed insights.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;8. **Scalability:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Implement auto-scaling for Azure Functions to handle varying loads during peak usage.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Utilize Azure Queue Storage for decoupling processes and handling bursts of video processing requests.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;9. **Error Handling and Retry Mechanism:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Implement robust error handling within Azure Functions to manage potential failures during video processing.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Use Azure Storage Queues for retrying failed tasks and managing the processing pipeline.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;10. **Monitoring and Logging:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - Implement comprehensive monitoring using Azure Monitor and logging using Azure Log Analytics.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - Receive alerts for critical issues, and analyze logs for troubleshooting and optimization.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;11. **Cost Optimization:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - Utilize Azure Cost Management and Billing to optimize resource usage and costs.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - Explore serverless consumption plans for Azure Functions to scale based on demand.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;12. **Geographical Redundancy:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; - Deploy Azure Functions in multiple regions to ensure geographical redundancy and lower latency for global users.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;By integrating these components, you can create a robust, scalable, and efficient video processing pipeline within an OTT platform using Azure Functions. This use case leverages serverless computing, cloud services, and various Azure features to provide a seamless and high-quality streaming experience for users.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/1801043772064312416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2024/01/most-complex-use-case-for-azure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/1801043772064312416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/1801043772064312416'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2024/01/most-complex-use-case-for-azure.html' title='Most complex use case for azure function for a ott palatorm with detail as much as possible '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-1576904742004955758</id><published>2023-08-14T06:36:00.002-07:00</published><updated>2023-08-14T06:36:22.501-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linear regression"/><category scheme="http://www.blogger.com/atom/ns#" term="numpy"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>A program for prediction house prices using linear regression without using any library except numpy and python </title><content type='html'>&lt;p&gt;&amp;nbsp;Sure, I can help you with that! Here&#39;s a simple implementation of linear regression for predicting house prices using Python and NumPy. I&#39;ll provide line-by-line explanations for each part of the code:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;import numpy as np&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Generate some sample data for demonstration&lt;/p&gt;&lt;p&gt;# In a real-world scenario, you would load your dataset&lt;/p&gt;&lt;p&gt;# X represents the feature (e.g., house size)&lt;/p&gt;&lt;p&gt;# y represents the target variable (e.g., house price)&lt;/p&gt;&lt;p&gt;np.random.seed(42)&lt;/p&gt;&lt;p&gt;X = 2 * np.random.rand(100, 1)&lt;/p&gt;&lt;p&gt;y = 4 + 3 * X + np.random.randn(100, 1)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Add a column of ones to the feature matrix X for the bias term&lt;/p&gt;&lt;p&gt;X_b = np.c_[np.ones((100, 1)), X]&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Initialize random values for the slope (theta1) and intercept (theta0)&lt;/p&gt;&lt;p&gt;theta = np.random.randn(2, 1)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Set the learning rate and number of iterations&lt;/p&gt;&lt;p&gt;learning_rate = 0.1&lt;/p&gt;&lt;p&gt;num_iterations = 1000&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Perform gradient descent to update theta&lt;/p&gt;&lt;p&gt;for iteration in range(num_iterations):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Calculate the predicted values (y_pred) using the current theta values&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; y_pred = X_b.dot(theta)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Calculate the errors&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; errors = y_pred - y&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Calculate the gradients (partial derivatives) for theta0 and theta1&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; gradients = 2 / len(X) * X_b.T.dot(errors)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Update theta using gradient descent&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; theta -= learning_rate * gradients&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Print the final theta values (intercept and slope)&lt;/p&gt;&lt;p&gt;print(&quot;Intercept:&quot;, theta[0][0])&lt;/p&gt;&lt;p&gt;print(&quot;Slope:&quot;, theta[1][0])&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Explanation of the code:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. Import the required NumPy library.&lt;/p&gt;&lt;p&gt;2. Generate sample data for demonstration purposes. Replace this with your actual dataset.&lt;/p&gt;&lt;p&gt;3. Add a column of ones to the feature matrix X to account for the bias term in the linear equation.&lt;/p&gt;&lt;p&gt;4. Initialize random values for the slope (theta1) and intercept (theta0).&lt;/p&gt;&lt;p&gt;5. Set the learning rate and the number of iterations for gradient descent.&lt;/p&gt;&lt;p&gt;6. Perform gradient descent for the specified number of iterations.&lt;/p&gt;&lt;p&gt;7. Calculate the predicted house prices (y_pred) using the current theta values and the feature matrix X_b.&lt;/p&gt;&lt;p&gt;8. Calculate the errors by subtracting the actual house prices (y) from the predicted prices (y_pred).&lt;/p&gt;&lt;p&gt;9. Calculate the gradients (partial derivatives) for both theta0 and theta1 using the feature matrix X_b and the errors.&lt;/p&gt;&lt;p&gt;10. Update the theta values using the gradient descent update rule.&lt;/p&gt;&lt;p&gt;11. Print the final values of theta0 and theta1, which represent the intercept and slope of the linear regression model.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Remember, this is a simplified example. In practice, you might need to add more features, preprocess the data, split it into training and testing sets, and implement techniques to prevent issues like overfitting.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/1576904742004955758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/a-program-for-prediction-house-prices.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/1576904742004955758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/1576904742004955758'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/a-program-for-prediction-house-prices.html' title='A program for prediction house prices using linear regression without using any library except numpy and python '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-988167132607594675</id><published>2023-08-14T03:20:00.001-07:00</published><updated>2023-08-14T03:20:21.232-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Stochastic gradient descent (SGD)"/><title type='text'>Explain Stochastic gradient descent (SGD) ? </title><content type='html'>&lt;p&gt;&amp;nbsp;Stochastic Gradient Descent (SGD) is a variant of the gradient descent optimization algorithm that is commonly used in training machine learning models, especially when dealing with large datasets. Unlike standard gradient descent, which uses the entire dataset to compute the gradient at each iteration, SGD updates the model&#39;s parameters using only a single or a small random subset (batch) of the training data. This randomness in selecting data points introduces &quot;stochastic&quot; behavior.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The main idea behind SGD is to approximate the true gradient of the loss function by using a smaller sample from the dataset in each iteration. This approach has several advantages:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **Faster Convergence:** Computing the gradient using a subset of the data is computationally less expensive than using the entire dataset. This results in faster updates to the model&#39;s parameters, potentially leading to quicker convergence.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. **Regularization Effect:** The noise introduced by using random subsets of data points during each iteration can have a regularizing effect on the optimization process. This can help prevent the model from getting stuck in local minima and improve its generalization performance.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. **Adaptability:** SGD can handle data that arrives in an online or streaming fashion. It can be updated in real time as new data becomes available, making it suitable for scenarios where the dataset is constantly growing.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;However, there are some challenges associated with SGD:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **Noisier Updates:** Since each update is based on a random subset of data, the updates can be noisy and result in oscillations in the convergence path.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. **Learning Rate Tuning:** The learning rate, which determines the step size for parameter updates, needs careful tuning to balance the trade-off between rapid convergence and stability.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To mitigate the noise introduced by SGD, variations like Mini-Batch Gradient Descent are often used. In Mini-Batch Gradient Descent, the gradient is computed using a small batch of data points (larger than one data point but smaller than the entire dataset) in each iteration. This approach combines some benefits of both SGD and standard gradient descent.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Overall, Stochastic Gradient Descent is a powerful optimization technique that allows training machine learning models efficiently on large datasets, making it a cornerstone of modern deep learning algorithms.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/988167132607594675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/explain-stochastic-gradient-descent-sgd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/988167132607594675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/988167132607594675'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/explain-stochastic-gradient-descent-sgd.html' title='Explain Stochastic gradient descent (SGD) ? '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-8725607783874760350</id><published>2023-08-14T02:46:00.003-07:00</published><updated>2023-08-14T02:46:31.761-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Gradient descent"/><title type='text'>define Gradient Descent ?</title><content type='html'>&lt;p&gt;&amp;nbsp;Gradient descent is an optimization algorithm used in various fields, including machine learning and mathematical optimization, to minimize a function by iteratively adjusting its parameters. The goal of gradient descent is to find the values of the parameters that result in the lowest possible value of the function.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The key idea behind gradient descent is to update the parameters of a model or system in the direction that leads to a decrease in the function&#39;s value. This direction is determined by the negative gradient of the function at the current point. The gradient is a vector that points in the direction of the steepest increase of the function, and taking its negative gives the direction of steepest decrease.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here&#39;s a simplified step-by-step explanation of how gradient descent works:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. Initialize the parameters of the model or system with some initial values.&lt;/p&gt;&lt;p&gt;2. Compute the gradient of the function with respect to the parameters at the current parameter values.&lt;/p&gt;&lt;p&gt;3. Update the parameters by subtracting a scaled version of the gradient from the current parameter values. This scaling factor is called the learning rate, which determines the step size in each iteration.&lt;/p&gt;&lt;p&gt;4. Repeat steps 2 and 3 until convergence criteria are met (e.g., the change in the function&#39;s value or parameters becomes very small, or a predetermined number of iterations is reached).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;There are variations of gradient descent, such as stochastic gradient descent (SGD), mini-batch gradient descent, and more, which use subsets of the data to compute gradients, making the process more efficient for large datasets.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Gradient descent is crucial in training machine learning models, where the goal is often to find the optimal values of the model&#39;s parameters that minimize a loss function. By iteratively adjusting the parameters based on the negative gradient of the loss function, gradient descent helps models learn from data and improve their performance over time.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/8725607783874760350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/define-gradient-descent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/8725607783874760350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/8725607783874760350'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/define-gradient-descent.html' title='define Gradient Descent ?'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-5604448136175382249</id><published>2023-08-10T23:34:00.003-07:00</published><updated>2023-08-10T23:34:23.692-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>How to create python virtual env ? </title><content type='html'>&lt;p&gt;&amp;nbsp;python -m venv C:\llm&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/5604448136175382249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/how-to-create-python-virtual-env.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/5604448136175382249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/5604448136175382249'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/how-to-create-python-virtual-env.html' title='How to create python virtual env ? '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-4642845565065210441</id><published>2023-08-08T23:09:00.005-07:00</published><updated>2023-08-08T23:09:59.081-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="activation functions"/><category scheme="http://www.blogger.com/atom/ns#" term="neural networks"/><title type='text'>What are activation functions, and why are they essential in neural networks?</title><content type='html'>&lt;p&gt;&amp;nbsp;Activation functions are mathematical functions that determine the output of a neuron in a neural network based on its input. They introduce non-linearity to the neural network, enabling it to learn complex patterns and relationships in the data. Activation functions are essential in neural networks for several reasons:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **Introduction of Non-linearity:** Without non-linear activation functions, neural networks would behave like a linear model, no matter how many layers they have. Non-linearity allows neural networks to capture and represent intricate relationships in the data that might involve complex transformations.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. **Learning Complex Patterns:** Many real-world problems, such as image and speech recognition, involve complex and non-linear patterns. Activation functions enable neural networks to approximate these patterns and make accurate predictions or classifications.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. **Stacking Multiple Layers:** Neural networks often consist of multiple layers, each building upon the previous one. Activation functions enable these stacked layers to learn hierarchical representations of data, with each layer capturing increasingly abstract features.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;4. **Gradient Flow and Learning:** During training, neural networks use optimization algorithms like gradient descent to adjust their weights and biases. Activation functions ensure that the gradients (derivatives of the loss function with respect to the model&#39;s parameters) can flow backward through the network, facilitating the learning process. Non-linear activation functions prevent the &quot;vanishing gradient&quot; problem, where gradients become very small and hinder learning in deep networks.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;5. **Decision Boundaries:** In classification tasks, activation functions help the network define decision boundaries that separate different classes in the input space. Non-linear activation functions allow the network to create complex decision boundaries, leading to better classification performance.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;6. **Enhancing Expressiveness:** Different activation functions offer various properties, such as saturating or not saturating behavior, sparsity, or boundedness. This flexibility allows neural networks to adapt to different types of data and tasks.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Common Activation Functions:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **Sigmoid:** It produces outputs between 0 and 1, suitable for binary classification tasks. However, it suffers from the vanishing gradient problem.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. **ReLU (Rectified Linear Unit):** It is widely used due to its simplicity and efficient computation. It outputs the input directly if positive, and zero otherwise, which helps alleviate the vanishing gradient problem.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. **Leaky ReLU:** An improved version of ReLU that allows a small gradient for negative inputs, preventing dead neurons in the network.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;4. **Tanh (Hyperbolic Tangent):** Similar to the sigmoid function, but with outputs ranging from -1 to 1. It can handle negative inputs but still has some vanishing gradient issues.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;5. **Softmax:** Primarily used in the output layer of classification networks, it converts a vector of raw scores into a probability distribution, enabling multi-class classification.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Activation functions are a fundamental building block of neural networks, enabling them to model complex relationships in data and make accurate predictions. The choice of activation function depends on the specific problem and architecture of the network.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/4642845565065210441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/what-are-activation-functions-and-why.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/4642845565065210441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/4642845565065210441'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/what-are-activation-functions-and-why.html' title='What are activation functions, and why are they essential in neural networks?'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-2221661678135734422</id><published>2023-08-07T00:57:00.006-07:00</published><updated>2023-08-07T00:57:29.967-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="datetime default value"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><title type='text'>datetime default value mysql</title><content type='html'>&lt;p&gt;&amp;nbsp;mysql&amp;gt; desc test;&lt;/p&gt;&lt;p&gt;+-------+-------------+------+-----+-------------------+-------+&lt;/p&gt;&lt;p&gt;| Field | Type&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | Null | Key | Default&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Extra |&lt;/p&gt;&lt;p&gt;+-------+-------------+------+-----+-------------------+-------+&lt;/p&gt;&lt;p&gt;| str&amp;nbsp; &amp;nbsp;| varchar(32) | YES&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp;| NULL&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp;&lt;/p&gt;&lt;p&gt;| ts&amp;nbsp; &amp;nbsp; | timestamp&amp;nbsp; &amp;nbsp;| NO&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;| &lt;b&gt;CURRENT_TIMESTAMP &lt;/b&gt;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp;&lt;/p&gt;&lt;p&gt;+-------+-------------+------+-----+-------------------+-------+&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/2221661678135734422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/datetime-default-value-mysql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/2221661678135734422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/2221661678135734422'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/datetime-default-value-mysql.html' title='datetime default value mysql'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-5628453759188307554</id><published>2023-08-01T22:05:00.007-07:00</published><updated>2023-08-01T22:05:50.325-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bias-variance trade-off"/><category scheme="http://www.blogger.com/atom/ns#" term="machine learning"/><title type='text'>Describe the bias-variance trade-off</title><content type='html'>&lt;p&gt;&lt;b&gt;&amp;nbsp;The bias-variance trade-off is a fundamental concept in machine learning that deals with the balance between two sources of error that can affect the performance of a model: bias and variance. These errors arise due to the model&#39;s ability to generalize from the training data to unseen data points.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;1. Bias:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Bias refers to the error introduced by a model&#39;s assumptions about the underlying relationships in the data. A high bias indicates that the model is too simplistic and unable to capture the complexity of the true data distribution. Models with high bias tend to underfit the data, meaning they perform poorly on both the training and test data because they cannot represent the underlying patterns.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;2. Variance:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Variance, on the other hand, refers to the error introduced by a model&#39;s sensitivity to small fluctuations or noise in the training data. A high variance indicates that the model is too complex and captures noise rather than the underlying patterns. Models with high variance tend to overfit the data, meaning they perform very well on the training data but poorly on unseen test data because they memorize the training examples instead of generalizing.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The trade-off occurs because reducing one source of error typically increases the other. When a model is made more complex to reduce bias (e.g., by adding more parameters or increasing model capacity), it becomes more sensitive to the training data, increasing variance. Conversely, when a model is made simpler to reduce variance (e.g., by using fewer parameters or simpler algorithms), it may introduce more bias.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The goal in machine learning is to find the optimal balance between bias and variance to achieve good generalization on unseen data. This can be done through techniques such as model regularization, cross-validation, and ensemble methods. Regularization helps control model complexity and reduce variance, while cross-validation helps estimate the model&#39;s performance on unseen data. Ensemble methods, such as bagging and boosting, combine multiple models to reduce variance and improve overall performance.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In summary, the bias-variance trade-off is a crucial consideration in machine learning model selection and training to ensure that the model generalizes well on unseen data and avoids both underfitting and overfitting.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/5628453759188307554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/describe-bias-variance-trade-off.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/5628453759188307554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/5628453759188307554'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/describe-bias-variance-trade-off.html' title='Describe the bias-variance trade-off'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-2218086235486255564</id><published>2023-08-01T22:04:00.005-07:00</published><updated>2023-08-01T22:04:39.314-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="machine learning"/><category scheme="http://www.blogger.com/atom/ns#" term="ROC curve"/><title type='text'>What is the ROC curve, and how is it used in machine learning?</title><content type='html'>&lt;p&gt;&amp;nbsp;The ROC (Receiver Operating Characteristic) curve is a graphical representation commonly used in machine learning to evaluate the performance of classification models, especially binary classifiers. It illustrates the trade-off between the model&#39;s sensitivity (true positive rate) and specificity (true negative rate) across different classification thresholds.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To understand the ROC curve, let&#39;s first define a few terms:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. True Positive (TP): The number of positive instances correctly classified as positive by the model.&lt;/p&gt;&lt;p&gt;2. False Positive (FP): The number of negative instances incorrectly classified as positive by the model.&lt;/p&gt;&lt;p&gt;3. True Negative (TN): The number of negative instances correctly classified as negative by the model.&lt;/p&gt;&lt;p&gt;4. False Negative (FN): The number of positive instances incorrectly classified as negative by the model.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The ROC curve is created by plotting the true positive rate (TPR) on the y-axis and the false positive rate (FPR) on the x-axis at various classification thresholds. The TPR is also known as sensitivity or recall and is calculated as TP / (TP + FN), while the FPR is calculated as FP / (FP + TN).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here&#39;s how you can create an ROC curve:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. Train a binary classification model on your dataset.&lt;/p&gt;&lt;p&gt;2. Make predictions on the test set and obtain the predicted probabilities of the positive class.&lt;/p&gt;&lt;p&gt;3. Vary the classification threshold from 0 to 1 (or vice versa) and calculate the corresponding TPR and FPR at each threshold.&lt;/p&gt;&lt;p&gt;4. Plot the TPR on the y-axis against the FPR on the x-axis.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;An ideal classifier would have a ROC curve that hugs the top-left corner, indicating high sensitivity and low false positive rate at various thresholds. The area under the ROC curve (AUC-ROC) is a single metric used to summarize the classifier&#39;s performance across all possible thresholds. A perfect classifier would have an AUC-ROC of 1, while a completely random classifier would have an AUC-ROC of 0.5.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In summary, the ROC curve and AUC-ROC are valuable tools to compare and select models, especially when the class distribution is imbalanced. They provide a visual representation of the classifier&#39;s performance and help determine the appropriate classification threshold based on the specific requirements of the problem at hand.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/2218086235486255564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/what-is-roc-curve-and-how-is-it-used-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/2218086235486255564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/2218086235486255564'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/what-is-roc-curve-and-how-is-it-used-in.html' title='What is the ROC curve, and how is it used in machine learning?'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-9001658549646812606</id><published>2023-08-01T06:12:00.007-07:00</published><updated>2023-08-01T06:12:35.341-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="F1 score"/><category scheme="http://www.blogger.com/atom/ns#" term="precision"/><category scheme="http://www.blogger.com/atom/ns#" term="recall"/><title type='text'>Explain precision, recall, and F1 score</title><content type='html'>&lt;p&gt;&lt;b&gt;Precision, recall, and F1 score are commonly used performance metrics in binary classification tasks. They provide insights into different aspects of a model&#39;s performance, particularly when dealing with imbalanced datasets. To understand these metrics, let&#39;s first define some basic terms:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- True Positive (TP): The number of correctly predicted positive instances (correctly predicted as the positive class).&lt;/p&gt;&lt;p&gt;- False Positive (FP): The number of instances that are predicted as positive but are actually negative (incorrectly predicted as the positive class).&lt;/p&gt;&lt;p&gt;- True Negative (TN): The number of correctly predicted negative instances (correctly predicted as the negative class).&lt;/p&gt;&lt;p&gt;- False Negative (FN): The number of instances that are predicted as negative but are actually positive (incorrectly predicted as the negative class).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;1. Precision:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Precision is a metric that measures the accuracy of positive predictions made by the model. It answers the question: &quot;Of all the instances the model predicted as positive, how many are actually positive?&quot;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The precision is calculated as:&lt;/p&gt;&lt;p&gt;Precision = TP / (TP + FP)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;A high precision indicates that when the model predicts an instance as positive, it is likely to be correct. However, it does not consider the cases where positive instances are incorrectly predicted as negative (false negatives).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;2. Recall (Sensitivity or True Positive Rate):&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Recall is a metric that measures the ability of the model to correctly identify positive instances. It answers the question: &quot;Of all the actual positive instances, how many did the model correctly predict?&quot;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The recall is calculated as:&lt;/p&gt;&lt;p&gt;Recall = TP / (TP + FN)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;A high recall indicates that the model is sensitive to detecting positive instances. However, it does not consider the cases where negative instances are incorrectly predicted as positive (false positives).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;3. F1 Score:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;The F1 score is the harmonic mean of precision and recall. It is used to balance the trade-off between precision and recall and provide a single score that summarizes a model&#39;s performance.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The F1 score is calculated as:&lt;/p&gt;&lt;p&gt;F1 Score = 2 * (Precision * Recall) / (Precision + Recall)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The F1 score penalizes models that have a large difference between precision and recall, encouraging a balance between the two. It is particularly useful when dealing with imbalanced datasets, where one class is much more prevalent than the other. In such cases, optimizing for accuracy alone might not provide meaningful insights.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In summary:&lt;/p&gt;&lt;p&gt;- Precision measures the accuracy of positive predictions.&lt;/p&gt;&lt;p&gt;- Recall measures the ability to correctly identify positive instances.&lt;/p&gt;&lt;p&gt;- F1 score balances precision and recall to provide a single performance metric.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;When evaluating the performance of a binary classification model, it is essential to consider both precision and recall, along with the F1 score, to get a comprehensive understanding of the model&#39;s effectiveness.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/9001658549646812606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/explain-precision-recall-and-f1-score.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/9001658549646812606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/9001658549646812606'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/explain-precision-recall-and-f1-score.html' title='Explain precision, recall, and F1 score'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-7442505037405276970</id><published>2023-08-01T05:46:00.003-07:00</published><updated>2023-08-01T05:46:36.957-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="machine learning"/><category scheme="http://www.blogger.com/atom/ns#" term="overfitting"/><title type='text'>What is overfitting, and how can it be mitigated? </title><content type='html'>&lt;p&gt;&amp;nbsp;Overfitting is a common problem in machine learning and statistical modeling, where a model performs very well on the training data but fails to generalize well to unseen or new data. In other words, the model has learned the noise and specific patterns present in the training data instead of learning the underlying general patterns. As a result, when presented with new data, the overfitted model&#39;s performance deteriorates significantly.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Causes of Overfitting:&lt;/p&gt;&lt;p&gt;1. Insufficient data: When the training dataset is small, the model may memorize the data rather than learning generalizable patterns.&lt;/p&gt;&lt;p&gt;2. Complex model: Using a model that is too complex for the given dataset can lead to overfitting. A complex model has a high capacity to learn intricate details and noise in the data.&lt;/p&gt;&lt;p&gt;3. Too many features: Including too many irrelevant or redundant features can cause the model to overfit by picking up noise from those features.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Mitigation Techniques for Overfitting:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. Cross-validation: Use techniques like k-fold cross-validation to evaluate the model&#39;s performance on multiple subsets of the data. This helps to get a better estimate of the model&#39;s generalization ability.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. Train-test split: Split the dataset into a training set and a separate test set. Train the model on the training set and evaluate its performance on the test set. This approach helps assess how well the model generalizes to unseen data.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. Regularization: Regularization is a technique that introduces a penalty term to the model&#39;s loss function to discourage large parameter values. This prevents the model from fitting the noise too closely and helps control overfitting. L1 regularization (Lasso) and L2 regularization (Ridge) are common types of regularization.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;4. Feature selection: Carefully choose relevant features for the model. Removing irrelevant or redundant features can improve the model&#39;s generalization.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;5. Early stopping: Monitor the model&#39;s performance on a validation set during training and stop training when the performance starts to degrade. This helps avoid overfitting by preventing the model from continuing to learn noise in the later stages of training.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;6. Ensemble methods: Combine multiple models (e.g., bagging, boosting, or stacking) to reduce overfitting. Ensemble methods often improve generalization by averaging out the biases of individual models.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;7. Data augmentation: Increase the effective size of the training dataset by applying transformations to the existing data. Data augmentation introduces variations and helps the model learn more robust and generalizable features.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;8. Reduce model complexity: Use simpler models or reduce the number of hidden layers and units in neural networks. Simpler models are less likely to overfit, especially when the data is limited.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;By applying these techniques, you can effectively mitigate overfitting and build more robust and generalizable machine learning models.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/7442505037405276970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/what-is-overfitting-and-how-can-it-be.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7442505037405276970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7442505037405276970'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/08/what-is-overfitting-and-how-can-it-be.html' title='What is overfitting, and how can it be mitigated? '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-1709179938651752502</id><published>2023-07-30T09:49:00.002-07:00</published><updated>2023-07-30T09:49:32.916-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="curse of dimensionality"/><title type='text'>What is the curse of dimensionality?</title><content type='html'>&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 0px 0px 1.25em; white-space-collapse: preserve;&quot;&gt;The curse of dimensionality is a concept that arises in the field of data analysis, machine learning, and statistics when dealing with high-dimensional data. It refers to the challenges and difficulties encountered when working with data in spaces with a large number of dimensions. As the number of dimensions increases, the amount of data required to obtain meaningful insights grows exponentially, leading to various problems that can adversely affect data analysis and machine learning algorithms.&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;To understand the curse of dimensionality better, let&#39;s explore some of its key aspects and examples:&lt;/p&gt;&lt;ol style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; counter-reset: list-number 0; display: flex; flex-direction: column; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; list-style: none; margin: 1.25em 0px; padding: 0px; white-space-collapse: preserve;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Increased Sparsity&lt;/span&gt;: As the number of dimensions increases, the volume of the data space expands exponentially. Consequently, data points become sparser, and the available data points may not adequately represent the underlying distribution. Imagine a 1-dimensional line: to sample it comprehensively, you need a few data points. But if you move to a 2-dimensional plane, you need a grid of points to represent the area. With each additional dimension, the required number of points increases significantly.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Distance and Nearest Neighbors&lt;/span&gt;: In high-dimensional spaces, distances between data points become less meaningful. Most pairs of points end up being equidistant or nearly equidistant, which can lead to difficulties in distinguishing between data points. Consider a dataset with two features: height and weight of individuals. If you plot them in a 2D space and measure distances, you can easily see clusters. However, as you add more features, visualizing the data becomes challenging, and distances lose their significance.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Computational Complexity&lt;/span&gt;: High-dimensional data requires more computational resources and time for processing and analysis. Many algorithms have time complexities that depend on the number of dimensions, which can make them computationally infeasible or inefficient as the dimensionality grows. This issue is especially problematic in algorithms like k-nearest neighbors or clustering algorithms that rely on distance calculations.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Overfitting&lt;/span&gt;: In machine learning, overfitting occurs when a model becomes too complex and learns noise from the data instead of general patterns. As the number of features (dimensions) increases, the risk of overfitting also rises. The model may memorize the training data, leading to poor generalization on unseen data. This phenomenon is particularly relevant in small-sample, high-dimensional scenarios.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Feature Selection and Curse&lt;/span&gt;: In high-dimensional datasets, identifying relevant features becomes crucial. Selecting the right features is essential to avoid overfitting and improve model performance. However, as the number of features increases, the number of possible feature combinations grows exponentially, making feature selection a challenging task.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Data Collection&lt;/span&gt;: Acquiring and storing data in high-dimensional spaces can be resource-intensive and costly. In many real-world scenarios, gathering data for all relevant features may not be feasible. For instance, consider a sensor network monitoring various environmental parameters. As the number of monitored parameters increases, the cost of deploying and maintaining the sensors grows.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;To mitigate the curse of dimensionality, several techniques and strategies are employed:&lt;/p&gt;&lt;ul style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; display: flex; flex-direction: column; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; list-style-image: initial; list-style-position: initial; margin: 1.25em 0px; padding: 0px; white-space-collapse: preserve;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Dimensionality Reduction&lt;/span&gt;: Methods like Principal Component Analysis (PCA) and t-distributed Stochastic Neighbor Embedding (t-SNE) reduce the number of dimensions while preserving important information. This helps with visualization, computational efficiency, and can improve model performance.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Feature Selection&lt;/span&gt;: Careful selection of relevant features can help reduce noise and improve the model&#39;s generalization ability. Techniques like Recursive Feature Elimination (RFE) and LASSO (Least Absolute Shrinkage and Selection Operator) can be used for this purpose.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Regularization&lt;/span&gt;: Regularization techniques like L1 and L2 regularization can help prevent overfitting by penalizing complex models.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: block; margin: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;&lt;span style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-bold); font-weight: 600;&quot;&gt;Curse-Aware Algorithms&lt;/span&gt;: Some algorithms, such as locality-sensitive hashing (LSH) and approximate nearest neighbor methods, are designed to work effectively in high-dimensional spaces, efficiently tackling distance-related challenges.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px 0px; white-space-collapse: preserve;&quot;&gt;In conclusion, the curse of dimensionality is a critical challenge that data scientists, machine learning engineers, and statisticians face when working with high-dimensional data. Understanding its implications and employing appropriate techniques to handle it are essential to extract meaningful insights from complex datasets.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/1709179938651752502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/what-is-curse-of-dimensionality.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/1709179938651752502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/1709179938651752502'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/what-is-curse-of-dimensionality.html' title='What is the curse of dimensionality?'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-3763735254640166035</id><published>2023-07-28T03:40:00.006-07:00</published><updated>2023-07-28T03:40:58.846-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CNNs"/><category scheme="http://www.blogger.com/atom/ns#" term="Image classification"/><title type='text'>Image classification CNN using PyTorch for the given e-commerce product categorization task</title><content type='html'>&lt;p&gt;&amp;nbsp;Simplified example of how you can implement an image classification CNN using PyTorch for the given e-commerce product categorization task:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 1: Import the required libraries.&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;import torch&lt;/p&gt;&lt;p&gt;import torch.nn as nn&lt;/p&gt;&lt;p&gt;import torch.optim as optim&lt;/p&gt;&lt;p&gt;import torchvision.transforms as transforms&lt;/p&gt;&lt;p&gt;from torchvision.datasets import ImageFolder&lt;/p&gt;&lt;p&gt;from torch.utils.data import DataLoader&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 2: Preprocess the data and create data loaders.&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;# Define the data transformations&lt;/p&gt;&lt;p&gt;transform = transforms.Compose([&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; transforms.Resize((64, 64)),&amp;nbsp; &amp;nbsp;# Resize the images to a fixed size&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; transforms.ToTensor(),&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Convert images to tensors&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))&amp;nbsp; # Normalize image data&lt;/p&gt;&lt;p&gt;])&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Load the training dataset&lt;/p&gt;&lt;p&gt;train_dataset = ImageFolder(&#39;path_to_train_data_folder&#39;, transform=transform)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Create data loaders&lt;/p&gt;&lt;p&gt;batch_size = 64&lt;/p&gt;&lt;p&gt;train_loader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True)&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 3: Define the CNN architecture.&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;class CNNClassifier(nn.Module):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def __init__(self):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super(CNNClassifier, self).__init__()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.conv1 = nn.Conv2d(3, 32, kernel_size=3, stride=1, padding=1)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.conv2 = nn.Conv2d(32, 64, kernel_size=3, stride=1, padding=1)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.fc1 = nn.Linear(64 * 16 * 16, 128)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.fc2 = nn.Linear(128, 3)&amp;nbsp; # Assuming 3 categories: &quot;clothing,&quot; &quot;electronics,&quot; &quot;home appliances&quot;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def forward(self, x):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = nn.functional.relu(self.conv1(x))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = nn.functional.max_pool2d(x, 2)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = nn.functional.relu(self.conv2(x))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = nn.functional.max_pool2d(x, 2)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = x.view(-1, 64 * 16 * 16)&amp;nbsp; # Flatten the output&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = nn.functional.relu(self.fc1(x))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = self.fc2(x)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return x&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 4: Train the CNN.&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;# Instantiate the model&lt;/p&gt;&lt;p&gt;model = CNNClassifier()&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Define the loss function and optimizer&lt;/p&gt;&lt;p&gt;criterion = nn.CrossEntropyLoss()&lt;/p&gt;&lt;p&gt;optimizer = optim.Adam(model.parameters(), lr=0.001)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Training loop&lt;/p&gt;&lt;p&gt;num_epochs = 10&lt;/p&gt;&lt;p&gt;device = torch.device(&#39;cuda&#39; if torch.cuda.is_available() else &#39;cpu&#39;)&lt;/p&gt;&lt;p&gt;model.to(device)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;for epoch in range(num_epochs):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; for images, labels in train_loader:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; images, labels = images.to(device), labels.to(device)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; optimizer.zero_grad()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outputs = model(images)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; loss = criterion(outputs, labels)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; loss.backward()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; optimizer.step()&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; print(f&#39;Epoch [{epoch+1}/{num_epochs}], Loss: {loss.item():.4f}&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;print(&quot;Training completed.&quot;)&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 5: Deploy the model for inference (Assuming you have a separate test dataset).&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;# Load the test dataset&lt;/p&gt;&lt;p&gt;test_dataset = ImageFolder(&#39;path_to_test_data_folder&#39;, transform=transform)&lt;/p&gt;&lt;p&gt;test_loader = DataLoader(test_dataset, batch_size=batch_size, shuffle=False)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Evaluate the model on the test data&lt;/p&gt;&lt;p&gt;model.eval()&lt;/p&gt;&lt;p&gt;correct = 0&lt;/p&gt;&lt;p&gt;total = 0&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;with torch.no_grad():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; for images, labels in test_loader:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; images, labels = images.to(device), labels.to(device)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outputs = model(images)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _, predicted = torch.max(outputs.data, 1)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; total += labels.size(0)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; correct += (predicted == labels).sum().item()&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;accuracy = 100 * correct / total&lt;/p&gt;&lt;p&gt;print(f&#39;Test Accuracy: {accuracy:.2f}%&#39;)&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This is a basic example to demonstrate the process. In a real-world scenario, you would further fine-tune the model, perform hyperparameter tuning, and optimize the deployment process for production use. Additionally, you might need to implement data augmentation techniques and deal with class imbalances, depending on the characteristics of your dataset.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/3763735254640166035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/image-classification-cnn-using-pytorch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/3763735254640166035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/3763735254640166035'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/image-classification-cnn-using-pytorch.html' title='Image classification CNN using PyTorch for the given e-commerce product categorization task'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-944994909190574606</id><published>2023-07-28T03:07:00.002-07:00</published><updated>2023-07-28T03:07:41.824-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linear regression"/><category scheme="http://www.blogger.com/atom/ns#" term="PyTorch"/><title type='text'>linear regression using pytorch ? </title><content type='html'>&lt;p&gt;Linear regression using PyTorch. Linear regression is a simple machine learning algorithm used for predicting continuous values based on input features. In PyTorch, we can create a linear regression model using the `torch.nn` module. Let&#39;s go through the steps:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 1: Import the required libraries.&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;import torch&lt;/p&gt;&lt;p&gt;import torch.nn as nn&lt;/p&gt;&lt;p&gt;import torch.optim as optim&lt;/p&gt;&lt;p&gt;import numpy as np&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 2: Prepare the data.&lt;/p&gt;&lt;p&gt;For this example, let&#39;s create some random data points for demonstration purposes. In practice, you would use your actual dataset.&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;# Generate some random data for training&lt;/p&gt;&lt;p&gt;np.random.seed(42)&lt;/p&gt;&lt;p&gt;X_train = np.random.rand(100, 1)&lt;/p&gt;&lt;p&gt;y_train = 2 * X_train + 3 + 0.1 * np.random.randn(100, 1)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Convert data to PyTorch tensors&lt;/p&gt;&lt;p&gt;X_train = torch.tensor(X_train, dtype=torch.float32)&lt;/p&gt;&lt;p&gt;y_train = torch.tensor(y_train, dtype=torch.float32)&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 3: Define the linear regression model.&lt;/p&gt;&lt;p&gt;We will create a simple linear regression model that takes one input feature and produces one output.&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;class LinearRegressionModel(nn.Module):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def __init__(self, input_dim, output_dim):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super(LinearRegressionModel, self).__init__()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.linear = nn.Linear(input_dim, output_dim)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; def forward(self, x):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return self.linear(x)&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 4: Instantiate the model and define the loss function and optimizer.&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;# Define the model&lt;/p&gt;&lt;p&gt;input_dim = 1&lt;/p&gt;&lt;p&gt;output_dim = 1&lt;/p&gt;&lt;p&gt;model = LinearRegressionModel(input_dim, output_dim)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Define the loss function (mean squared error)&lt;/p&gt;&lt;p&gt;criterion = nn.MSELoss()&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Define the optimizer (stochastic gradient descent)&lt;/p&gt;&lt;p&gt;learning_rate = 0.01&lt;/p&gt;&lt;p&gt;optimizer = optim.SGD(model.parameters(), lr=learning_rate)&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 5: Train the model.&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;# Set the number of training epochs&lt;/p&gt;&lt;p&gt;num_epochs = 1000&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Training loop&lt;/p&gt;&lt;p&gt;for epoch in range(num_epochs):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Forward pass&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; outputs = model(X_train)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; loss = criterion(outputs, y_train)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Backward pass and optimization&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; optimizer.zero_grad()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; loss.backward()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; optimizer.step()&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if (epoch + 1) % 100 == 0:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f&#39;Epoch [{epoch+1}/{num_epochs}], Loss: {loss.item():.4f}&#39;)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Print the final model parameters&lt;/p&gt;&lt;p&gt;print(&quot;Final model parameters:&quot;)&lt;/p&gt;&lt;p&gt;for name, param in model.named_parameters():&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if param.requires_grad:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(name, param.data)&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In this example, we use Mean Squared Error (MSE) as the loss function and Stochastic Gradient Descent (SGD) as the optimizer. You can experiment with different loss functions and optimizers as needed.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;After training, the model parameters should approximate the true values of the underlying data generation process: weight=2 and bias=3.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;That&#39;s it! You&#39;ve now implemented a simple linear regression model using PyTorch.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/944994909190574606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/linear-regression-using-pytorch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/944994909190574606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/944994909190574606'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/linear-regression-using-pytorch.html' title='linear regression using pytorch ? '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-3023597756471210809</id><published>2023-07-28T03:06:00.001-07:00</published><updated>2023-07-28T03:06:13.909-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mean Squared Error"/><title type='text'>Mean Squared Error (MSE) ?</title><content type='html'>&lt;p&gt;&amp;nbsp;Mean Squared Error (MSE) is a commonly used loss function in regression problems. It measures the average squared difference between the predicted values and the actual target values. In other words, it quantifies how far off the model&#39;s predictions are from the ground truth.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;For a regression problem with `n` data points, let&#39;s denote the predicted values as `y_pred` and the actual target values as `y_true`. Then, the Mean Squared Error is calculated as follows:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;MSE = (1/n) * Σ(y_pred - y_true)^2&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In this equation:&lt;/p&gt;&lt;p&gt;- `Σ` represents the sum over all data points.&lt;/p&gt;&lt;p&gt;- `y_pred` is the predicted value for a given data point.&lt;/p&gt;&lt;p&gt;- `y_true` is the actual target value for the same data point.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The MSE is always a non-negative value. A smaller MSE indicates that the model&#39;s predictions are closer to the true values, while a larger MSE means the predictions have more significant errors.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;When training a machine learning model, the goal is to minimize the MSE during the optimization process. This means adjusting the model&#39;s parameters (weights and biases) to make the predictions as close as possible to the actual target values.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/3023597756471210809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/mean-squared-error-mse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/3023597756471210809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/3023597756471210809'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/mean-squared-error-mse.html' title='Mean Squared Error (MSE) ?'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-7771578013963857040</id><published>2023-07-28T03:05:00.003-07:00</published><updated>2023-07-28T03:05:24.451-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linear regression"/><category scheme="http://www.blogger.com/atom/ns#" term="weight&amp;biases"/><title type='text'>what is weight and what is biases in linear regression ? </title><content type='html'>&lt;p&gt;&amp;nbsp;In linear regression, the terms &quot;weight&quot; and &quot;bias&quot; refer to the model parameters that define the relationship between the input features and the output prediction.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. Weight:&lt;/p&gt;&lt;p&gt;In linear regression, the weight (also known as the coefficient) represents the slope of the linear relationship between the input features and the output prediction. For a simple linear regression with only one input feature, the model equation can be represented as:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;y_pred = weight * x + bias&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here, `y_pred` is the predicted output, `x` is the input feature, `weight` is the parameter that determines how the input feature influences the prediction, and `bias` is the intercept of the linear equation.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. Bias:&lt;/p&gt;&lt;p&gt;The bias (also known as the intercept) represents the value of the predicted output when the input feature is zero. It accounts for any constant offset or error in the prediction that is independent of the input features. In the model equation above, the bias `bias` is added to the product of `weight` and `x` to form the final prediction.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;When training a linear regression model, the goal is to find the optimal values for `weight` and `bias` such that the model&#39;s predictions fit the training data as closely as possible. The process of finding these optimal values involves minimizing the Mean Squared Error (MSE) or another suitable loss function, as discussed in the previous answer.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In summary, weight determines the influence of the input feature on the prediction, and bias adjusts the prediction independently of the input features. Together, they form the equation of a straight line (in the case of simple linear regression) that best fits the data points in the training set.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/7771578013963857040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/what-is-weight-and-what-is-biases-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7771578013963857040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7771578013963857040'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/what-is-weight-and-what-is-biases-in.html' title='what is weight and what is biases in linear regression ? '/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-196437426031641320</id><published>2023-07-27T07:01:00.002-07:00</published><updated>2023-07-27T07:01:07.709-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Backpropagation"/><category scheme="http://www.blogger.com/atom/ns#" term="Deep learning"/><title type='text'>Calculus in Backpropagation</title><content type='html'>&lt;p&gt;&lt;span style=&quot;background-color: #f7f7f8; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; white-space-collapse: preserve;&quot;&gt;Backpropagation is a fundamental algorithm in training artificial neural networks. It is used to adjust the weights of the neural network based on the errors it makes during training.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;A neural network is composed of layers of interconnected neurons, and each connection has an associated weight. During training, the network takes input data, makes predictions, compares those predictions to the actual target values, calculates the errors, and then updates the weights to minimize those errors. This process is repeated iteratively until the network&#39;s performance improves.&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;Backpropagation involves two main steps: the forward pass and the backward pass.&lt;/p&gt;&lt;ol style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; counter-reset: list-number 0; display: flex; flex-direction: column; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; list-style: none; margin: 1.25em 0px; padding: 0px; white-space-collapse: preserve;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Forward Pass:
In the forward pass, the input data is fed into the neural network, and the activations are computed layer by layer until the output layer is reached. This process involves a series of weighted sums and activation functions.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Backward Pass:
In the backward pass, the errors are propagated backward through the network, and the gradients of the error with respect to each weight are calculated. These gradients indicate how much the error would change if we made small adjustments to the corresponding weight. The goal is to find the direction in which each weight should be adjusted to reduce the overall error.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;Now, let&#39;s dive into the calculus used in backpropagation with a simple example of a single-layer neural network.&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;Example: Single-Layer Neural Network
Consider a neural network with a single neuron (perceptron) and one input. Let&#39;s denote the input as x, the weight of the connection between the input and the neuron as w, the output of the neuron as y, and the target output as t. The activation function of the neuron is represented by the function f.&lt;/p&gt;&lt;ol style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; counter-reset: list-number 0; display: flex; flex-direction: column; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; list-style: none; margin: 1.25em 0px; padding: 0px; white-space-collapse: preserve;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Forward Pass:
The forward pass involves calculating the output of the neuron based on the given input and weight:&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;y = f(wx)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Backward Pass:
In the backward pass, we calculate the gradient of the error with respect to the weight (dw). This gradient tells us how the error changes as we change the weight.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;The error (E) between the output y and the target t is typically defined using a loss function (e.g., mean squared error):&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;E = 0.5 * (t - y)^2&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;Now, we want to find dw, the derivative of the error with respect to the weight w:&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;dw = dE/dw&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;Using the chain rule of calculus, we can calculate dw step by step:&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;dw = dE/dy * dy/dw&lt;/p&gt;&lt;ol style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; counter-reset: list-number 0; display: flex; flex-direction: column; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; list-style: none; margin: 1.25em 0px; padding: 0px; white-space-collapse: preserve;&quot;&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Calculate dE/dy:
dE/dy = d(0.5 * (t - y)^2)/dy
= -(t - y)&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Calculate dy/dw:
dy/dw = d(f(wx))/dw&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Here, we need to consider the derivative of the activation function f with respect to its argument wx and the derivative of wx with respect to w.&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Let&#39;s assume f(wx) is a sigmoid activation function:
f(wx) = 1 / (1 + e^(-wx))&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Then, the derivative of f with respect to its argument is:
df/d(wx) = f(wx) * (1 - f(wx))&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Now, we have dy/dw:
dy/dw = df/d(wx) * d(wx)/dw
= f(wx) * (1 - f(wx)) * d(wx)/dw&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-increment: list-number 1; display: block; margin-bottom: 0px; margin-top: 0px; min-height: 28px; padding-left: 0.375em;&quot;&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px;&quot;&gt;Calculate d(wx)/dw:
wx = w * x
d(wx)/dw = x&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;Now, putting it all together:
dw = dE/dy * dy/dw
= -(t - y) * f(wx) * (1 - f(wx)) * x&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;With this gradient, we can update the weight w to minimize the error. The weight update is done using a learning rate (η):&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;w_new = w_old - η * dw&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px; white-space-collapse: preserve;&quot;&gt;The learning rate is a hyperparameter that controls the step size in the weight update.&lt;/p&gt;&lt;p style=&quot;--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(69,89,164,.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #f7f7f8; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #374151; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, &amp;quot;Helvetica Neue&amp;quot;, Arial, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; margin: 1.25em 0px 0px; white-space-collapse: preserve;&quot;&gt;This is the basic idea of backpropagation for a single-layer neural network. In practice, neural networks have multiple layers and more complex architectures, but the core calculus principles remain the same. The process of backpropagation is applied iteratively for each training sample to adjust the weights and improve the network&#39;s performance.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/196437426031641320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/calculus-in-backpropagation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/196437426031641320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/196437426031641320'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/calculus-in-backpropagation.html' title='Calculus in Backpropagation'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-7823153232590289992</id><published>2023-07-27T00:40:00.003-07:00</published><updated>2023-07-27T00:40:17.583-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="optimize"/><title type='text'>Table does not support optimize, doing recreate + analyze instead</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjwSOOx27Dq0j_rA5DZdn7LJsTV18Zu6BgGY9xQyYTIp-OA37vOS8XM3veXk_aumG5rJEOHBZpGRJ7bjg_jFYJvzm9JF7m1CNQB8hD0RjnlmSWEPK2ZO7z-65CiEsX0MNe3cthPuWXhUaes9hlfqsYDNW0lRrsGgyUi1EnjqLH47eFh7Yy-IU5CMPr4FqI&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;145&quot; data-original-width=&quot;981&quot; height=&quot;83&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjwSOOx27Dq0j_rA5DZdn7LJsTV18Zu6BgGY9xQyYTIp-OA37vOS8XM3veXk_aumG5rJEOHBZpGRJ7bjg_jFYJvzm9JF7m1CNQB8hD0RjnlmSWEPK2ZO7z-65CiEsX0MNe3cthPuWXhUaes9hlfqsYDNW0lRrsGgyUi1EnjqLH47eFh7Yy-IU5CMPr4FqI=w566-h83&quot; width=&quot;566&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The message you received after running `OPTIMIZE TABLE detail;` indicates that the `detail` table does not support the `OPTIMIZE` operation. Instead, MySQL will perform a `RECREATE` and `ANALYZE` operation.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The `OPTIMIZE TABLE` statement is used to reorganize and optimize the physical storage of a table, defragmenting its data and indexes. However, not all storage engines support this operation. The InnoDB storage engine, which is the default for modern MySQL installations, does not support the `OPTIMIZE TABLE` command.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;When `OPTIMIZE TABLE` is used on an InnoDB table, MySQL performs a recreate and analyze operation instead. This means the table is recreated from scratch, and the data is copied to a new tablespace. Afterward, the table&#39;s statistics are updated and analyzed to ensure the query optimizer has accurate information about the table&#39;s data distribution.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The status message you received, `OK`, indicates that the operation completed successfully.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Keep in mind that the `OPTIMIZE TABLE` or `RECREATE` operation can be resource-intensive and may require sufficient free disk space to create a temporary table. Therefore, it is essential to run this command during a maintenance window or when the server has enough resources to handle the operation without impacting ongoing production traffic.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Additionally, running `OPTIMIZE TABLE` or `RECREATE` frequently might not always be necessary, especially for InnoDB tables, as InnoDB handles data fragmentation and storage optimization more efficiently compared to older storage engines like MyISAM. It&#39;s often more beneficial to focus on other performance optimizations like proper indexing, query tuning, and server configuration.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/7823153232590289992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/table-does-not-support-optimize-doing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7823153232590289992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/7823153232590289992'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/table-does-not-support-optimize-doing.html' title='Table does not support optimize, doing recreate + analyze instead'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEjwSOOx27Dq0j_rA5DZdn7LJsTV18Zu6BgGY9xQyYTIp-OA37vOS8XM3veXk_aumG5rJEOHBZpGRJ7bjg_jFYJvzm9JF7m1CNQB8hD0RjnlmSWEPK2ZO7z-65CiEsX0MNe3cthPuWXhUaes9hlfqsYDNW0lRrsGgyUi1EnjqLH47eFh7Yy-IU5CMPr4FqI=s72-w566-h83-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-5719926605903184985</id><published>2023-07-26T23:39:00.000-07:00</published><updated>2023-07-26T23:39:00.816-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Optimization"/><title type='text'>How these are going to impact innodb_buffer_pool_size, innodb_log_file_size, and query_cache_size  ?</title><content type='html'>&lt;p&gt;&amp;nbsp;Let&#39;s discuss how each optimization can impact `innodb_buffer_pool_size`, `innodb_log_file_size`, and `query_cache_size`:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. **innodb_buffer_pool_size:**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;`innodb_buffer_pool_size` is a critical MySQL configuration parameter that determines the size of the buffer pool, which is a memory area where InnoDB caches data and indexes. The buffer pool is used to reduce disk I/O by keeping frequently accessed data in memory.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- **Impact of Optimizations:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Increasing the `innodb_buffer_pool_size` allows InnoDB to cache more data, which can significantly improve the performance of queries that require data reads. If your table is heavily used and your system has enough RAM, increasing this parameter can help reduce the need for disk I/O, resulting in faster query execution.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- If you have implemented partitioning, having a larger buffer pool can be particularly beneficial when querying frequently accessed partitions, as the relevant data can be cached in memory.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. **innodb_log_file_size:**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;`innodb_log_file_size` specifies the size of each InnoDB log file. These log files are used to store changes to data (transactions) before they are written to the actual data files. The size of the log files affects the amount of transactional data that can be stored in memory before it is flushed to disk.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- **Impact of Optimizations:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Increasing `innodb_log_file_size` can improve write performance, especially when you have high write-intensive workloads or large transactions. This can be helpful if you have frequent inserts or updates on the `detail` table.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- However, changing the log file size requires stopping the MySQL server, removing the old log files, and then starting the server with the new size. It is a complex process and should be done with caution.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. **query_cache_size:**&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;`query_cache_size` determines the amount of memory allocated for the query cache, which stores the results of queries for quick retrieval when the same queries are executed again.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- **Impact of Optimizations:**&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- Setting `query_cache_size` to an appropriate value can help improve query performance for frequently executed queries with identical parameters. The query cache eliminates the need to re-execute identical queries, reducing the CPU and execution time.&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;- However, the query cache can become less effective as the data changes frequently, as it needs to be continually invalidated and refreshed. If your table is write-intensive, the query cache might not provide a significant performance boost and might even consume unnecessary memory.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Note that the impact of these optimizations can vary depending on your specific workload and data characteristics. It&#39;s essential to measure the impact of each change and test them thoroughly in a non-production environment before applying them to your live system.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Additionally, tuning these parameters should be part of a holistic performance optimization approach that considers all aspects of your database configuration, hardware resources, query structure, and indexing strategy. Consider consulting with a database administrator or performance tuning expert to get insights specific to your setup and requirements.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/5719926605903184985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/how-these-are-going-to-impact.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/5719926605903184985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/5719926605903184985'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/how-these-are-going-to-impact.html' title='How these are going to impact innodb_buffer_pool_size, innodb_log_file_size, and query_cache_size  ?'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8334644488876867179.post-1421546644569246026</id><published>2023-07-26T02:50:00.005-07:00</published><updated>2023-07-26T02:50:48.531-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linear regression"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Linear regression purely in Python</title><content type='html'>&lt;p&gt;&amp;nbsp;Yes, we can implement a simple linear regression algorithm using only Python, without relying on any external libraries like scikit-learn. The key components of the algorithm involve calculating the slope (coefficients) and intercept of the line that best fits the data.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here&#39;s a pure Python implementation of linear regression using the method of least squares:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;```python&lt;/p&gt;&lt;p&gt;# Step 1: Load the data (Boston Housing dataset)&lt;/p&gt;&lt;p&gt;# For this example, let&#39;s use a simplified version of the dataset with one feature for simplicity.&lt;/p&gt;&lt;p&gt;# In a real-world scenario, you would load the data from a file or another source.&lt;/p&gt;&lt;p&gt;X = [2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]&amp;nbsp; # Input feature (e.g., number of rooms)&lt;/p&gt;&lt;p&gt;y = [3.0, 4.0, 2.5, 5.0, 6.0, 8.0, 7.5]&amp;nbsp; # Target variable (e.g., median house price)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Step 2: Implement linear regression&lt;/p&gt;&lt;p&gt;def linear_regression(X, y):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; n = len(X)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; sum_x = sum(X)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; sum_y = sum(y)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; sum_xy = sum(x * y for x, y in zip(X, y))&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; sum_x_squared = sum(x ** 2 for x in X)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; # Calculate the slope (coefficient) and intercept of the line&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; slope = (n * sum_xy - sum_x * sum_y) / (n * sum_x_squared - sum_x ** 2)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; intercept = (sum_y - slope * sum_x) / n&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; return slope, intercept&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Step 3: Fit the model and get the coefficients&lt;/p&gt;&lt;p&gt;slope, intercept = linear_regression(X, y)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Step 4: Make predictions on new data&lt;/p&gt;&lt;p&gt;def predict(X, slope, intercept):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; return [slope * x + intercept for x in X]&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Step 5: Evaluate the model&#39;s performance&lt;/p&gt;&lt;p&gt;# For simplicity, let&#39;s calculate the mean squared error (MSE).&lt;/p&gt;&lt;p&gt;def mean_squared_error(y_true, y_pred):&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; n = len(y_true)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; squared_errors = [(y_true[i] - y_pred[i]) ** 2 for i in range(n)]&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; return sum(squared_errors) / n&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Make predictions on the training data&lt;/p&gt;&lt;p&gt;y_pred_train = predict(X, slope, intercept)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;# Calculate the mean squared error of the predictions&lt;/p&gt;&lt;p&gt;mse_train = mean_squared_error(y, y_pred_train)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;print(f&quot;Slope (Coefficient): {slope:.4f}&quot;)&lt;/p&gt;&lt;p&gt;print(f&quot;Intercept: {intercept:.4f}&quot;)&lt;/p&gt;&lt;p&gt;print(f&quot;Mean Squared Error: {mse_train:.4f}&quot;)&lt;/p&gt;&lt;p&gt;```&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Note that this is a simplified example using a small dataset. In a real-world scenario, you would load a larger dataset and perform additional preprocessing steps to prepare the data for the linear regression model. Additionally, scikit-learn and other libraries offer more efficient and optimized implementations of linear regression, so using them is recommended for practical applications. However, this pure Python implementation illustrates the fundamental concepts behind linear regression.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ideaofinnovation.blogspot.com/feeds/1421546644569246026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/linear-regression-purely-in-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/1421546644569246026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8334644488876867179/posts/default/1421546644569246026'/><link rel='alternate' type='text/html' href='http://ideaofinnovation.blogspot.com/2023/07/linear-regression-purely-in-python.html' title='Linear regression purely in Python'/><author><name>rahularyansharma</name><uri>http://www.blogger.com/profile/08723349080240072273</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>