Ascend

to Digital

Success

At the nexus of design and technology, we craft digital experiences, empowering our clients to envision tomorrow, now!

Innovative Solutions

Web & Mobile
Development

Digital
Marketing

Media &
Creative

Digetal.
Consulting

Resume animation on click

Digital Marketing
& Social Media

GROW YOUR
  • Reach
  • Impact
  • Leads

Unlock the full potential of your brand with our expert social media strategies. We help you engage with your audience, grow your reach, and drive impactful results

Web & Mobile Solutions

Scale With Your Business Growth

We plan every project with scalability and flexibility in mind to ensure our proposed solutions can service your needs for years to come and adapt to shifting business dynamics with minimal interruption, effort, and cost.

# Importing necessary libraries

import pandas as pd

import numpy as np

import matplotlib.pyplot as plt

import seaborn as sns

from sklearn.model_selection import train_test_split

from sklearn.preprocessing import StandardScaler

from sklearn.linear_model import LinearRegression

from sklearn.metrics import mean_squared_error, r2_score

 

# Load dataset

url = 'https://example.com/dataset.csv'

data = pd.read_csv(url)

 

# Display basic information about the dataset

print("Dataset Information:")

print(data.info())

 

# Display first few rows of the dataset

print("\nFirst 5 rows of the dataset:")

print(data.head())

 

# Check for missing values

print("\nMissing values in the dataset:")

print(data.isnull().sum())

 

# Handling missing values by filling them with the mean of the column

data.fillna(data.mean(), inplace=True)

 

# Exploratory Data Analysis (EDA)

plt.figure(figsize=(10, 6))

sns.heatmap(data.corr(), annot=True, cmap='coolwarm')

plt.title('Correlation Heatmap')

plt.show()

 

# Distribution of target variable

plt.figure(figsize=(10, 6))

sns.histplot(data['target_variable'], kde=True)

plt.title('Distribution of Target Variable')

plt.show()

 

# Splitting the dataset into features and target variable

X = data.drop('target_variable', axis=1)

y = data['target_variable']

 

# Splitting 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)

 

# Feature scaling

scaler = StandardScaler()

X_train = scaler.fit_transform(X_train)

X_test = scaler.transform(X_test)

 

# Training a Linear Regression model

model = LinearRegression()

model.fit(X_train, y_train)

 

# Making predictions

y_pred = model.predict(X_test)

 

# Evaluating the model

mse = mean_squared_error(y_test, y_pred)

r2 = r2_score(y_test, y_pred)

 

print(f"\nModel Performance:\nMean Squared Error: {mse}\nR-Squared: {r2}")

 

# Visualizing the actual vs predicted values

plt.figure(figsize=(10, 6))

plt.scatter(y_test, y_pred, color='blue')

plt.plot([y_test.min(), y_test.max()], [y_test.min(), y_test.max()], 'k--', lw=2)

plt.xlabel('Actual')

plt.ylabel('Predicted')

plt.title('Actual vs Predicted Values')

plt.show()

 

# Conclusion

print("\nConclusion:")

print("The Linear Regression model has been trained and evaluated on the sample dataset.")

print("Further improvements can be made by experimenting with different models and feature engineering techniques.")

Creative Solutions
With Your
  • Success
  • Business
  • Customers

at the Forefront

Contact Us

We’re just one click away to help you to craft the right digital solution for your business or brand. Fill in the form to share more details about your project.

Our goal is to help people in the best way possible. this is a basic principle in every case and cause for success. contact us today for a free consultation.