Python Data Science Machine Learning
Kanalga Telegramβda oβtish
Admin: @hussein_sheikho Only English New Group to talk about Python and Data Science topics. Join and Share ππππππ Ad & Earn money form your channel: https://telega.io/?r=nikapsOH
Ko'proq ko'rsatishIroqToif belgilanmagan
8 754
Obunachilar
Ma'lumot yo'q24 soatlar
Ma'lumot yo'q7 kun
Ma'lumot yo'q30 kun
Postlar arxiv
This book has the most views and downloads
20 Iyun 2022, 02:35
Certainly! Here's how you might approach each of the General EDA Questions and Machine Learning Model Building tasks in Python, using pandas for data manipulation, matplotlib and seaborn for visualization, and scikit-learn for machine learning.
### General EDA Questions:
1. Proportion of rides by member vs. casual users:
member_ride_count = df[df['user_type'] == 'Member'].shape[0]
casual_ride_count = df[df['user_type'] == 'Casual'].shape[0]
total_rides = df.shape[0]
member_ride_proportion = member_ride_count / total_rides
casual_ride_proportion = casual_ride_count / total_rides
2. Change in proportions of free and paying rides:
# Assuming 'ride_type' column indicates if a ride is free or paid
free_rides = df[df['ride_type'] == 'Free']
paid_rides = df[df['ride_type'] == 'Paid']
# Group by day of the week and calculate proportions
free_rides['day_of_week'] = free_rides['started_at'].dt.day_name()
paid_rides['day_of_week'] = paid_rides['started_at'].dt.day_name()
free_ride_proportions = free_rides['day_of_week'].value_counts(normalize=True)
paid_ride_proportions = paid_rides['day_of_week'].value_counts(normalize=True)
3. Distribution of ride durations between electric bikes and classic bikes:
import seaborn as sns
import matplotlib.pyplot as plt
sns.boxplot(x='bike_type', y='duration', data=df)
plt.show()
### Building Machine Learning Models:
- Feature Selection and Preprocessing:
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
# Selecting features and target
X = df[['start_station', 'end_station', 'start_time', 'end_time']] # example features
y = df['user_type'].apply(lambda x: 1 if x == 'Member' else 0) # binary encoding of the target
# Encoding categorical variables and scaling
X_encoded = pd.get_dummies(X, drop_first=True)
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X_encoded)
# Split the dataset
X_train, X_test, y_train, y_test = train_test_split(X_scaled, y, test_size=0.2, random_state=42)
- Model Training and Evaluation:
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report, confusion_matrix
# Initialize the classifier
rf_clf = RandomForestClassifier(random_state=42)
# Train the model
rf_clf.fit(X_train, y_train)
# Predictions
y_pred = rf_clf.predict(X_test)
# Evaluate the model
print(confusion_matrix(y_test, y_pred))
print(classification_report(y_test, y_pred))
- Model Optimization:
from sklearn.model_selection import GridSearchCV
# Define the parameter grid
param_grid = {
'n_estimators': [100, 200, 300],
'max_depth': [5, 10, 15],
'min_samples_split': [2, 5, 10]
}
# Initialize the grid search
grid_search = GridSearchCV(estimator=rf_clf, param_grid=param_grid, cv=5, scoring='accuracy')
# Perform grid search
grid_search.fit(X_train, y_train)
# Best parameters
print(grid_search.best_params_)
Remember to install the required libraries using pip if you haven't already:
pip install pandas scikit-learn matplotlib seaborn
Each snippet of code above is a simplified example and will need to be adapted to the specifics of your dataset, such as the correct column names and the appropriate preprocessing steps for your particular features and target variable.03 Dek 2023, 15:18
Repost from Data Science Books
good news
We have opened the door to subscribe to the Premium channel, the available number is 6 new members
The one-time subscription price is $7
The paid channel is characterized by the fact that books are published in the form of files and without links or ads, in addition to publishing free programming and artificial intelligence courses
Contact me: @Hussein_Sheikho
20 Noy 2022, 16:00
πPython For Beginners Course In-Depth | Udemyπ
ββββββββββββββββ
Rating: 4.1
Language : English
Original Price : $89.99
Instructor : Horizon Tech
πDescription :
This course is a depth introduction to both fundamental python programming concepts and the Python programming language.
βββββββββββββββββ
Enrollment link:
https://www.udemy.com/course/python-for-beginners-course-in-depth/?join:@Udemy_Blaster&couponCode=DISCUDEMY.COM5
ββββββββββββββββ
β»οΈ Share Link: https://t.me/joinchat/9ieZjAc0X3EyYzg8
08 Okt 2021, 03:30
Repost from Data Science Books
12 Mar 2023, 07:44
Repost from Data Science Books
Python Natural Language Processing Cookbook (2021)
π Download Link: https://filewebster.com/files/download/MTY1NjU3NDA0Nl80MDE0
πβ€οΈ Like and share πβ€οΈ
1β£ @DataScience_Books
2β£ @CodeProgrammer
3β£ @datascience_projects
30 Iyun 2022, 05:29
Really thanks for all the good books you share!
21 Fev 2023, 07:42
Offline & Online Udemy Courses (Telegram)
π₯ Course: Apache Spark with Scala useful for Databricks Certification
π Enroll Link: https://cuty.io/g6MBf3l6t98
β
@Udemy13
16 Yan 2023, 02:26
Yeah but if the book has got too many pages then there's a chance I'm paying more amount than actual cost of book πΈ
13 Avg 2021, 22:22
Offline & Online Udemy Courses (Telegram)
π₯ Course: PHP with MySQL 2022: Build 5 PHP and MySQL Projects
π Enroll Link: https://karyawan.co.id/prtfoammV
π How to download or enroll to the course
β
By: @Udemy13 || @Codeprogrammer
27 Noy 2022, 09:44
It's really not that difficult to work out, "As long as you can access the webpage, you just need to click the "I'm not a robot" captcha box, then click on the Generate Link button, wait for the countdown to finish then click the "File Ready To Download" button."
09 Sen 2022, 20:23

