• Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
Friday, July 11, 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

Lowering Time to Worth for Knowledge Science Tasks: Half 3

Work Information Is the Subsequent Frontier for GenAI

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

Intro image 683x1024.png
Artificial Intelligence

Lowering Time to Worth for Knowledge Science Tasks: Half 3

July 10, 2025
Drawing 22 scaled 1.png
Artificial Intelligence

Work Information Is the Subsequent Frontier for GenAI

July 10, 2025
Grpo4.png
Artificial Intelligence

How one can Superb-Tune Small Language Fashions to Suppose with Reinforcement Studying

July 9, 2025
Gradio.jpg
Artificial Intelligence

Construct Interactive Machine Studying Apps with Gradio

July 8, 2025
1dv5wrccnuvdzg6fvwvtnuq@2x.jpg
Artificial Intelligence

The 5-Second Fingerprint: Inside Shazam’s Prompt Tune ID

July 8, 2025
0 dq7oeogcaqjjio62.jpg
Artificial Intelligence

STOP Constructing Ineffective ML Initiatives – What Really Works

July 7, 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

0 3.png

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

February 10, 2025
Gemini 2.0 Fash Vs Gpt 4o.webp.webp

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

January 19, 2025
1da3lz S3h Cujupuolbtvw.png

Scaling Statistics: Incremental Customary Deviation in SQL with dbt | by Yuval Gorchover | Jan, 2025

January 2, 2025
0khns0 Djocjfzxyr.jpeg

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

November 5, 2024
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

EDITOR'S PICK

759e2ad6 9bb9 44f3 88a6 6a7946832917 800x420.jpg

Coinbase scores uncommon authorized victory as court docket grants interlocutory enchantment in SEC case

January 7, 2025
Image 109.png

Parquet File Format – All the pieces You Must Know!

May 14, 2025
Blog No Disclaimer.png

New Collateral Choices & Up to date Haircuts for Derivatives buying and selling

March 1, 2025
Blockdag Bdag Shiba Shootout Shibashoot Leads Top 5 Promising Crypto Presales Of 2024 1.jpg

Uncover the Main Altcoins for 2024: BlockDAG, Tron, Cosmos

December 9, 2024

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 Information Analytics Improves Lead Administration and Gross sales Outcomes
  • SUI Chart Sample Affirmation Units $3.89 Worth Goal
  • Constructing a Сustom MCP Chatbot | In the direction of Knowledge Science
  • 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?