From 9b9e2a485760ce512945f6ff909f7dd58e40fab5 Mon Sep 17 00:00:00 2001
From: harsha8688 <80832626+harsha8688@users.noreply.github.com>
Date: Thu, 20 Jun 2024 07:42:51 +0530
Subject: [PATCH 1/5] Task-1

---
 Harsha Vardhan Chalapati/Task-1 | 36 +++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 Harsha Vardhan Chalapati/Task-1

diff --git a/Harsha Vardhan Chalapati/Task-1 b/Harsha Vardhan Chalapati/Task-1
new file mode 100644
index 0000000..ebe144b
--- /dev/null
+++ b/Harsha Vardhan Chalapati/Task-1	
@@ -0,0 +1,36 @@
+from PIL import Image
+import os
+
+def convert_image(input_path, output_path, output_format):
+    try:
+        # Open the image
+        with Image.open(input_path) as img:
+            # Convert and save the image to the desired format
+            img.save(output_path, format=output_format)
+            print(f"Image converted successfully to {output_format} format.")
+    except Exception as e:
+        print(f"An error occurred: {e}")
+
+def main():
+    input_path = input("Enter the path to the input image: ")
+    output_format = input("Enter the desired output format (e.g., JPEG, PNG, BMP, GIF): ").upper()
+
+    # Validate output format
+    if output_format not in ['JPEG', 'PNG', 'BMP', 'GIF']:
+        print("Invalid output format. Please choose from JPEG, PNG, BMP, or GIF.")
+        return
+
+    # Extract the file name and extension
+    file_name, file_extension = os.path.splitext(input_path)
+
+    # If the input file already has an extension, remove it
+    file_name_without_ext = file_name.split('.')[0]
+
+    # Set the output path
+    output_path = f"{file_name_without_ext}_converted.{output_format.lower()}"
+    
+    # Convert the image
+    convert_image(input_path, output_path, output_format)
+
+if _name_ == "_main_":
+    main()

From c7c540d75f0b1c3e441f473f4bc357ee062173c4 Mon Sep 17 00:00:00 2001
From: harsha8688 <80832626+harsha8688@users.noreply.github.com>
Date: Thu, 20 Jun 2024 07:44:18 +0530
Subject: [PATCH 2/5] Task-2

---
 Harsha Vardhan Chalapati/Task-2 | 43 +++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 Harsha Vardhan Chalapati/Task-2

diff --git a/Harsha Vardhan Chalapati/Task-2 b/Harsha Vardhan Chalapati/Task-2
new file mode 100644
index 0000000..2fee7c7
--- /dev/null
+++ b/Harsha Vardhan Chalapati/Task-2	
@@ -0,0 +1,43 @@
+import seaborn as sns
+import pandas as pd
+import matplotlib.pyplot as plt
+
+# Load the Iris dataset from Seaborn
+iris = sns.load_dataset("iris")
+numeric_iris = iris.drop(columns='species')
+
+# Display the first few rows of the dataset
+print("First few rows of the dataset:")
+print(iris.head())
+
+# Summary statistics
+print("\nSummary statistics:")
+print(iris.describe())
+
+# Checking for missing values
+print("\nMissing values:")
+print(iris.isnull().sum())
+
+# Visualizations
+# Pairplot
+sns.pairplot(iris, hue="species")
+plt.title("Pairplot of Iris Dataset")
+plt.show()
+
+# Boxplot
+plt.figure(figsize=(10, 6))
+sns.boxplot(data=iris, orient="h")
+plt.title("Boxplot of Iris Dataset")
+plt.show()
+
+# Histograms
+plt.figure(figsize=(10, 6))
+iris.hist()
+plt.suptitle("Histograms of Iris Dataset")
+plt.show()
+
+# Correlation heatmap
+plt.figure(figsize=(8, 6))
+sns.heatmap(numeric_iris.corr(), annot=True, cmap="coolwarm")
+plt.title("Correlation Heatmap of Iris Dataset")
+plt.show()

From b4602fd1f035a2419cf81a9b31af045629e003ee Mon Sep 17 00:00:00 2001
From: harsha8688 <80832626+harsha8688@users.noreply.github.com>
Date: Thu, 20 Jun 2024 07:44:52 +0530
Subject: [PATCH 3/5] Task-3

---
 Harsha Vardhan Chalapati/Task-3 | 43 +++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 Harsha Vardhan Chalapati/Task-3

diff --git a/Harsha Vardhan Chalapati/Task-3 b/Harsha Vardhan Chalapati/Task-3
new file mode 100644
index 0000000..2fee7c7
--- /dev/null
+++ b/Harsha Vardhan Chalapati/Task-3	
@@ -0,0 +1,43 @@
+import seaborn as sns
+import pandas as pd
+import matplotlib.pyplot as plt
+
+# Load the Iris dataset from Seaborn
+iris = sns.load_dataset("iris")
+numeric_iris = iris.drop(columns='species')
+
+# Display the first few rows of the dataset
+print("First few rows of the dataset:")
+print(iris.head())
+
+# Summary statistics
+print("\nSummary statistics:")
+print(iris.describe())
+
+# Checking for missing values
+print("\nMissing values:")
+print(iris.isnull().sum())
+
+# Visualizations
+# Pairplot
+sns.pairplot(iris, hue="species")
+plt.title("Pairplot of Iris Dataset")
+plt.show()
+
+# Boxplot
+plt.figure(figsize=(10, 6))
+sns.boxplot(data=iris, orient="h")
+plt.title("Boxplot of Iris Dataset")
+plt.show()
+
+# Histograms
+plt.figure(figsize=(10, 6))
+iris.hist()
+plt.suptitle("Histograms of Iris Dataset")
+plt.show()
+
+# Correlation heatmap
+plt.figure(figsize=(8, 6))
+sns.heatmap(numeric_iris.corr(), annot=True, cmap="coolwarm")
+plt.title("Correlation Heatmap of Iris Dataset")
+plt.show()

From d422b7ef998e8b9499ba7c17c614f899384aaade Mon Sep 17 00:00:00 2001
From: harsha8688 <80832626+harsha8688@users.noreply.github.com>
Date: Thu, 20 Jun 2024 07:45:37 +0530
Subject: [PATCH 4/5] Task-4

---
 Harsha Vardhan Chalapati/Task-4 | 45 +++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Harsha Vardhan Chalapati/Task-4

diff --git a/Harsha Vardhan Chalapati/Task-4 b/Harsha Vardhan Chalapati/Task-4
new file mode 100644
index 0000000..5bb8616
--- /dev/null
+++ b/Harsha Vardhan Chalapati/Task-4	
@@ -0,0 +1,45 @@
+import numpy as np
+import matplotlib.pyplot as plt
+from sklearn.model_selection import train_test_split
+from sklearn.linear_model import LinearRegression
+from sklearn.metrics import mean_squared_error
+import pandas as pd
+data_url = "http://lib.stat.cmu.edu/datasets/boston"
+raw_df = pd.read_csv(data_url, sep="\s+", skiprows=22, header=None)
+data = np.hstack([raw_df.values[::2, :], raw_df.values[1::2, :2]])
+target = raw_df.values[1::2, 2]
+
+# Load the Boston housing dataset
+ 
+X = data
+y = target
+
+# Split the data into training and testing sets
+X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
+
+# Initialize the linear regression model
+model = LinearRegression()
+
+# Fit the model on the training data
+model.fit(X_train, y_train)
+
+# Predict on the training and testing data
+y_train_pred = model.predict(X_train)
+y_test_pred = model.predict(X_test)
+
+# Calculate the scores
+train_score = model.score(X_train, y_train)
+test_score = model.score(X_test, y_test)
+
+print("Training score:", train_score)
+print("Testing score:", test_score)
+
+# Plot residuals
+plt.scatter(y_train_pred, y_train_pred - y_train, c='blue', marker='o', label='Training data')
+plt.scatter(y_test_pred, y_test_pred - y_test, c='lightgreen', marker='s', label='Testing data')
+plt.xlabel('Predicted values')
+plt.ylabel('Residuals')
+plt.legend(loc='upper left')
+plt.hlines(y=0, xmin=0, xmax=50, lw=2, color='red')
+plt.title('Residual plot')
+plt.show()

From 51f9c9933a236701ab81007250f873b9e5396594 Mon Sep 17 00:00:00 2001
From: harsha8688 <80832626+harsha8688@users.noreply.github.com>
Date: Thu, 20 Jun 2024 07:55:21 +0530
Subject: [PATCH 5/5] README.md

---
 Harsha Vardhan Chalapati/README.md | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 Harsha Vardhan Chalapati/README.md

diff --git a/Harsha Vardhan Chalapati/README.md b/Harsha Vardhan Chalapati/README.md
new file mode 100644
index 0000000..ea71e98
--- /dev/null
+++ b/Harsha Vardhan Chalapati/README.md	
@@ -0,0 +1,9 @@
+TASK-1:Image Converter
+    Write a program that accepts images in multiple formats (JPEG, PNG, BMP, GIF) and converts them into a desired format using Python Imaging Library (PIL).
+Task-2:Data Analysis with Pandas
+    Load the "Iris" dataset from Seaborn and analyze it using Pandas. Perform exploratory data analysis, cleaning, aggregation, visualizations, and correlation calculations.
+TASK-3:Linear Regression with Scikit-learn
+    Apply linear regression to predict house prices from the Boston housing dataset using scikit-learn. Compare train and test scores and plot residuals.
+Task-4:Image Compression
+    Develop a Python tool for compressing images while maintaining quality.Explore compression techniques like RLE and DCT.Allow users to adjust compression quality, support various image formats, and provide output options.
+    Optionally, include a user interface. Ensure code modularity, performance optimization, and test with diverse images, along with comprehensive documentation