• Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
Tuesday, May 13, 2025
newsaiworld
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
Morning News
No Result
View All Result
Home Artificial Intelligence

Journey to Full-Stack Information Scientist: Mannequin Deployment | by Alex Davis | Jan, 2025

Admin by Admin
January 5, 2025
in Artificial Intelligence
0
14umvrom7f2ybkxfp3bmjma.png
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


First, for our instance, we have to develop a mannequin. Since this text focuses on mannequin deployment, we won’t fear in regards to the efficiency of the mannequin. As an alternative, we are going to construct a easy mannequin with restricted options to give attention to studying mannequin deployment.

On this instance, we are going to predict a knowledge skilled’s wage based mostly on just a few options, equivalent to expertise, job title, firm measurement, and many others.

See information right here: https://www.kaggle.com/datasets/ruchi798/data-science-job-salaries (CC0: Public Area). I barely modified the info to cut back the variety of choices for sure options.

#import packages for information manipulation
import pandas as pd
import numpy as np

#import packages for machine studying
from sklearn import linear_model
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder
from sklearn.metrics import mean_squared_error, r2_score

#import packages for information administration
import joblib

First, let’s check out the info.

Picture by Creator

Since all of our options are categorical, we are going to use encoding to remodel our information to numerical. Under, we use ordinal encoders to encode expertise degree and firm measurement. These are ordinal as a result of they characterize some type of development (1 = entry degree, 2 = mid-level, and many others.).

For job title and employment sort, we are going to create a dummy variables for every choice (observe we drop the primary to keep away from multicollinearity).

#use ordinal encoder to encode expertise degree
encoder = OrdinalEncoder(classes=[['EN', 'MI', 'SE', 'EX']])
salary_data['experience_level_encoded'] = encoder.fit_transform(salary_data[['experience_level']])

#use ordinal encoder to encode firm measurement
encoder = OrdinalEncoder(classes=[['S', 'M', 'L']])
salary_data['company_size_encoded'] = encoder.fit_transform(salary_data[['company_size']])

#encode employmeny sort and job title utilizing dummy columns
salary_data = pd.get_dummies(salary_data, columns = ['employment_type', 'job_title'], drop_first = True, dtype = int)

#drop unique columns
salary_data = salary_data.drop(columns = ['experience_level', 'company_size'])

Now that we now have reworked our mannequin inputs, we are able to create our coaching and take a look at units. We’ll enter these options right into a easy linear regression mannequin to foretell the worker’s wage.

#outline unbiased and dependent options
X = salary_data.drop(columns = 'salary_in_usd')
y = salary_data['salary_in_usd']

#break up between coaching and testing units
X_train, X_test, y_train, y_test = train_test_split(
X, y, random_state = 104, test_size = 0.2, shuffle = True)

#match linear regression mannequin
regr = linear_model.LinearRegression()
regr.match(X_train, y_train)

#make predictions
y_pred = regr.predict(X_test)

#print the coefficients
print("Coefficients: n", regr.coef_)

#print the MSE
print("Imply squared error: %.2f" % mean_squared_error(y_test, y_pred))

#print the adjusted R2 worth
print("R2: %.2f" % r2_score(y_test, y_pred))

Let’s see how our mannequin did.

READ ALSO

How I Lastly Understood MCP — and Bought It Working in Actual Life

Working Python Applications in Your Browser

Picture by Creator

Seems like our R-squared is 0.27, yikes. Much more work would must be finished with this mannequin. We might possible want extra information and extra info on the observations. However for the sake of this text, we are going to transfer ahead and save our mannequin.

#save mannequin utilizing joblib
joblib.dump(regr, 'lin_regress.sav')
Tags: AlexDataDavisDeploymentFullStackJanJourneymodelScientist

Related Posts

Image 81.png
Artificial Intelligence

How I Lastly Understood MCP — and Bought It Working in Actual Life

May 13, 2025
Chatgpt Image May 10 2025 08 59 39 Am.png
Artificial Intelligence

Working Python Applications in Your Browser

May 12, 2025
Model Compression 2 1024x683.png
Artificial Intelligence

Mannequin Compression: Make Your Machine Studying Fashions Lighter and Sooner

May 12, 2025
Doppleware Ai Robot Facepalming Ar 169 V 6.1 Ffc36bad C0b8 41d7 Be9e 66484ca8c4f4 1 1.png
Artificial Intelligence

How To not Write an MCP Server

May 11, 2025
1 Qjtq1 O S4xkznvjbbefhg.png
Artificial Intelligence

A Evaluate of AccentFold: One of many Most Vital Papers on African ASR

May 10, 2025
Holdinghands.png
Artificial Intelligence

What My GPT Stylist Taught Me About Prompting Higher

May 10, 2025
Next Post
1sqjlfy5x2wpacz8v57juba.gif

Predicting a Ball Trajectory. Polynomial Slot in Python with NumPy | by Florian Trautweiler | Jan, 2025

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

POPULAR NEWS

Gemini 2.0 Fash Vs Gpt 4o.webp.webp

Gemini 2.0 Flash vs GPT 4o: Which is Higher?

January 19, 2025
0 3.png

College endowments be a part of crypto rush, boosting meme cash like Meme Index

February 10, 2025
How To Maintain Data Quality In The Supply Chain Feature.jpg

Find out how to Preserve Knowledge High quality within the Provide Chain

September 8, 2024
0khns0 Djocjfzxyr.jpeg

Constructing Data Graphs with LLM Graph Transformer | by Tomaz Bratanic | Nov, 2024

November 5, 2024
1vrlur6bbhf72bupq69n6rq.png

The Artwork of Chunking: Boosting AI Efficiency in RAG Architectures | by Han HELOIR, Ph.D. ☕️ | Aug, 2024

August 19, 2024

EDITOR'S PICK

Image Fx 24.png

How AI Startups Can Spend money on Carbon Discount Methods

February 18, 2025
Rise Of Artificial Intelligence.jpg

How AI and Massive Information are Serving to Startups and Companies

September 5, 2024
0qwebi3hx7syukwr9.jpeg

Knowledge Empowers Enterprise. Exploiting the complete potential of… | by Bernd Wessely | Sep, 2024

September 23, 2024
Pavel Durov Telegram.jpg

Telegram defends report on crime as CEO returns to Dubai after arrest

March 17, 2025

About Us

Welcome to News AI World, your go-to source for the latest in artificial intelligence news and developments. Our mission is to deliver comprehensive and insightful coverage of the rapidly evolving AI landscape, keeping you informed about breakthroughs, trends, and the transformative impact of AI technologies across industries.

Categories

  • Artificial Intelligence
  • ChatGPT
  • Crypto Coins
  • Data Science
  • Machine Learning

Recent Posts

  • How I Lastly Understood MCP — and Bought It Working in Actual Life
  • Empowering LLMs to Assume Deeper by Erasing Ideas
  • Tether Gold enters Thailand with itemizing on Maxbit trade
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy

© 2024 Newsaiworld.com. All rights reserved.

No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us

© 2024 Newsaiworld.com. All rights reserved.

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?