<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Balakumaravel K S 24MCR009</title>
    <description>The latest articles on DEV Community by Balakumaravel K S 24MCR009 (@balakumaravel_ks24mcr00).</description>
    <link>https://dev.to/balakumaravel_ks24mcr00</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3080363%2F0143906f-1cd5-40fa-8b8a-528e5d05b8f7.png</url>
      <title>DEV Community: Balakumaravel K S 24MCR009</title>
      <link>https://dev.to/balakumaravel_ks24mcr00</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/balakumaravel_ks24mcr00"/>
    <language>en</language>
    <item>
      <title>ml day 2</title>
      <dc:creator>Balakumaravel K S 24MCR009</dc:creator>
      <pubDate>Fri, 25 Apr 2025 16:55:28 +0000</pubDate>
      <link>https://dev.to/balakumaravel_ks24mcr00/ml-day-2-5eep</link>
      <guid>https://dev.to/balakumaravel_ks24mcr00/ml-day-2-5eep</guid>
      <description>&lt;p&gt;FROM python:3.12-slim&lt;/p&gt;

&lt;p&gt;WORKDIR /app&lt;/p&gt;

&lt;p&gt;RUN cd /app&lt;/p&gt;

&lt;p&gt;COPY . .&lt;/p&gt;

&lt;p&gt;RUN pip install pandas scikit-learn matplotlib&lt;/p&gt;

&lt;p&gt;CMD ["python", "ml-model.py"]&lt;/p&gt;

&lt;h1&gt;
  
  
  Build the Docker image using the following command in the terminal:
&lt;/h1&gt;

&lt;h1&gt;
  
  
  docker build -t balakumaravel/24mcr009-hello_world:latest .
&lt;/h1&gt;

&lt;p&gt;from pandas import read_csv&lt;br&gt;
from matplotlib import pyplot&lt;br&gt;
from sklearn.linear_model import LogisticRegression&lt;br&gt;
from sklearn.model_selection import train_test_split&lt;br&gt;
import joblib&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 1: Load dataset
&lt;/h1&gt;

&lt;p&gt;filename = "Iris.csv"&lt;br&gt;
data = read_csv(filename)&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 2: Display data shape and preview
&lt;/h1&gt;

&lt;p&gt;print("Shape of the dataset:", data.shape)&lt;br&gt;
print("First 20 rows:\n", data.head(20))&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: Plot and save histograms silently
&lt;/h1&gt;

&lt;p&gt;data.hist()&lt;br&gt;
pyplot.savefig("histograms.png")&lt;br&gt;
pyplot.close()  # Close the plot so it doesn't show up in prompt&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 4: Plot and save density plots silently
&lt;/h1&gt;

&lt;p&gt;data.plot(kind='density', subplots=True, layout=(3,3), sharex=False)&lt;br&gt;
pyplot.savefig("density_plots.png")&lt;br&gt;
pyplot.close()&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 5: Convert to NumPy array and extract features/labels
&lt;/h1&gt;

&lt;p&gt;array = data.values&lt;br&gt;
X = array[:, 1:5]  # Features: Sepal/Petal measurements&lt;br&gt;
Y = array[:, 5]    # Target: Species&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 6: Split data into training (67%) and testing (33%)
&lt;/h1&gt;

&lt;p&gt;test_size = 0.33&lt;br&gt;
seed = 7&lt;br&gt;
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=test_size, random_state=seed)&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 7: Create and train logistic regression model
&lt;/h1&gt;

&lt;p&gt;model = LogisticRegression(max_iter=200)&lt;br&gt;
model.fit(X_train, Y_train)&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 8: Evaluate and display accuracy
&lt;/h1&gt;

&lt;p&gt;result = model.score(X_test, Y_test)&lt;br&gt;
print("Accuracy: {:.2f}%".format(result * 100))&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 9: Save the trained model to a file
&lt;/h1&gt;

&lt;p&gt;joblib.dump(model, "logistic_model.pkl")&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh63k9dkctdme3rhn7vjg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh63k9dkctdme3rhn7vjg.jpg" alt="Image description" width="800" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9869e9bdv2pvvxc85g0w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9869e9bdv2pvvxc85g0w.jpg" alt="Image description" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day 1 ML</title>
      <dc:creator>Balakumaravel K S 24MCR009</dc:creator>
      <pubDate>Wed, 23 Apr 2025 17:06:05 +0000</pubDate>
      <link>https://dev.to/balakumaravel_ks24mcr00/day-1-ml-okd</link>
      <guid>https://dev.to/balakumaravel_ks24mcr00/day-1-ml-okd</guid>
      <description>&lt;p&gt;by-Step Git Commands Execution:&lt;br&gt;
Initialize a Git repository:&lt;br&gt;
    git init&lt;br&gt;
Creates a new Git repository in the folder 24MCR009.&lt;/p&gt;

&lt;p&gt;Add a file to staging area:&lt;br&gt;
    git add 24MCR009.txt&lt;br&gt;
Adds 24MCR009.txt to the staging area.&lt;/p&gt;

&lt;p&gt;Commit the file:&lt;br&gt;
    git commit -m "Added Personal Details"&lt;br&gt;
Creates a commit with the message "Added Personal Details".&lt;/p&gt;

&lt;p&gt;Check Git status:&lt;br&gt;
     git status&lt;br&gt;
Shows that 24MCR009.txt has been modified but not staged.&lt;/p&gt;

&lt;p&gt;View commit log:&lt;br&gt;
     git log&lt;br&gt;
Displays the commit history (one commit at this point).&lt;/p&gt;

&lt;p&gt;Add remote GitHub repository:&lt;br&gt;
     git remote add origin &lt;a href="https://github.com/bala-2210/24MCR009.git" rel="noopener noreferrer"&gt;https://github.com/bala-2210/24MCR009.git&lt;/a&gt;&lt;br&gt;
Links the local repository to a remote GitHub repo.&lt;/p&gt;

&lt;p&gt;Check current branch:&lt;br&gt;
     git branch&lt;br&gt;
Shows the current branch is master.&lt;/p&gt;

&lt;p&gt;Rename branch from master to main:&lt;br&gt;
     git branch -M main&lt;br&gt;
Renames the current branch to main.&lt;/p&gt;

&lt;p&gt;Set Git global config for email and username:&lt;br&gt;
    git config --global user.email "&lt;a href="mailto:balakumaravel2210@gmail.com"&gt;balakumaravel2210@gmail.com&lt;/a&gt;"&lt;br&gt;
git config --global user.name "bala-2210"&lt;br&gt;
Sets your global Git identity.&lt;/p&gt;

&lt;p&gt;Push code to remote repo for the first time:&lt;br&gt;
     git push -u origin main&lt;br&gt;
Pushes the main branch to GitHub and sets upstream tracking.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8lunuon3bclv5k314yec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8lunuon3bclv5k314yec.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F28lqzcbooxieuo7d7mlt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F28lqzcbooxieuo7d7mlt.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyb96j4b1wss10gjlrn29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyb96j4b1wss10gjlrn29.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;Step-&lt;/p&gt;

&lt;p&gt;Then , Again We will Modify or add new file means we need to follow the same steps, like&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -m “message” 
git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
  </channel>
</rss>
