Machine Learning with Python
Learn Machine Learning with hands-on Python tutorials, real-world code examples, and clear explanations for researchers and developers. Admin: @HusseinSheikho || @Hussein_Sheikho
Show moreπ Analytical overview of Telegram channel Machine Learning with Python
Channel Machine Learning with Python (@codeprogrammer) in the English language segment is an active participant. Currently, the community unites 67 820 subscribers, ranking 2 411 in the Education category and 5 035 in the India region.
π Audience metrics and dynamics
Since its creation on Π½Π΅Π²ΡΠ΄ΠΎΠΌΠΎ, the project has demonstrated rapid growth, gathering an audience of 67 820 subscribers.
According to the latest data from 06 June, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by 55 over the last 30 days and by -2 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 2.54%. Within the first 24 hours after publication, content typically collects 2.53% reactions from the total number of subscribers.
- Post reach: On average, each post receives 1 720 views. Within the first day, a publication typically gains 1 714 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 6.
- Thematic interests: Content is focused on key topics such as insidead, learning, degree, evaluation, algorithm.
π Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
βLearn Machine Learning with hands-on Python tutorials, real-world code examples, and clear explanations for researchers and developers.
Admin: @HusseinSheikho || @Hussein_Sheikhoβ
Thanks to the high frequency of updates (latest data received on 08 June, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Education category.
from PIL import ImageFilter
blurred_img = img.filter(ImageFilter.BLUR)
β’ Apply a box blur with a given radius.
box_blur = img.filter(ImageFilter.BoxBlur(5))
β’ Apply a Gaussian blur.
gaussian_blur = img.filter(ImageFilter.GaussianBlur(radius=2))
β’ Sharpen the image.
sharpened = img.filter(ImageFilter.SHARPEN)β’ Find edges.
edges = img.filter(ImageFilter.FIND_EDGES)
β’ Enhance edges.
edge_enhanced = img.filter(ImageFilter.EDGE_ENHANCE)
β’ Emboss the image.
embossed = img.filter(ImageFilter.EMBOSS)
β’ Find contours.
contours = img.filter(ImageFilter.CONTOUR)
VII. Image Enhancement (ImageEnhance)
β’ Adjust color saturation.
from PIL import ImageEnhance
enhancer = ImageEnhance.Color(img)
vibrant_img = enhancer.enhance(2.0)
β’ Adjust brightness.
enhancer = ImageEnhance.Brightness(img)
bright_img = enhancer.enhance(1.5)
β’ Adjust contrast.
enhancer = ImageEnhance.Contrast(img)
contrast_img = enhancer.enhance(1.5)
β’ Adjust sharpness.
enhancer = ImageEnhance.Sharpness(img)
sharp_img = enhancer.enhance(2.0)
VIII. Drawing (ImageDraw & ImageFont)
β’ Draw text on an image.
from PIL import ImageDraw, ImageFont
draw = ImageDraw.Draw(img)
font = ImageFont.truetype("arial.ttf", 36)
draw.text((10, 10), "Hello", font=font, fill="red")
β’ Draw a line.
draw.line((0, 0, 100, 200), fill="blue", width=3)β’ Draw a rectangle (outline).
draw.rectangle([10, 10, 90, 60], outline="green", width=2)
β’ Draw a filled ellipse.
draw.ellipse([100, 100, 180, 150], fill="yellow")
β’ Draw a polygon.
draw.polygon([(10,10), (20,50), (60,10)], fill="purple")#Python #Pillow #ImageProcessing #PIL #CheatSheet βββββββββββββββ By: @CodeProgrammer β¨
from PIL import Image
img = Image.open("image.jpg")
β’ Save an image.
img.save("new_image.png")
β’ Display an image (opens in default viewer).
img.show()β’ Create a new blank image.
new_img = Image.new("RGB", (200, 100), "blue")
β’ Get image format (e.g., 'JPEG').
print(img.format)
β’ Get image dimensions as a (width, height) tuple.
width, height = img.sizeβ’ Get pixel format (e.g., 'RGB', 'L' for grayscale).
print(img.mode)
β’ Convert image mode.
grayscale_img = img.convert("L")
β’ Get a pixel's color value at (x, y).
r, g, b = img.getpixel((10, 20))
β’ Set a pixel's color value at (x, y).
img.putpixel((10, 20), (255, 0, 0))II. Cropping, Resizing & Pasting β’ Crop a rectangular region.
box = (100, 100, 400, 400)
cropped_img = img.crop(box)
β’ Resize an image to an exact size.
resized_img = img.resize((200, 200))
β’ Create a thumbnail (maintains aspect ratio).
img.thumbnail((128, 128))β’ Paste one image onto another.
img.paste(another_img, (50, 50))III. Rotation & Transformation β’ Rotate an image (counter-clockwise).
rotated_img = img.rotate(45, expand=True)
β’ Flip an image horizontally.
flipped_img = img.transpose(Image.FLIP_LEFT_RIGHT)
β’ Flip an image vertically.
flipped_img = img.transpose(Image.FLIP_TOP_BOTTOM)
β’ Rotate by 90, 180, or 270 degrees.
img_90 = img.transpose(Image.ROTATE_90)β’ Apply an affine transformation.
transformed = img.transform(img.size, Image.AFFINE, (1, 0.5, 0, 0, 1, 0))
IV. ImageOps Module Helpers
β’ Invert image colors.
from PIL import ImageOps
inverted_img = ImageOps.invert(img)
β’ Flip an image horizontally (mirror).
mirrored_img = ImageOps.mirror(img)
β’ Flip an image vertically.
flipped_v_img = ImageOps.flip(img)
β’ Convert to grayscale.
grayscale = ImageOps.grayscale(img)β’ Colorize a grayscale image.
colorized = ImageOps.colorize(grayscale, black="blue", white="yellow")β’ Reduce the number of bits for each color channel.
posterized = ImageOps.posterize(img, 4)β’ Auto-adjust image contrast.
adjusted_img = ImageOps.autocontrast(img)
β’ Equalize the image histogram.
equalized_img = ImageOps.equalize(img)
β’ Add a border to an image.
bordered = ImageOps.expand(img, border=10, fill='black')
V. Color & Pixel Operations
β’ Split image into individual bands (e.g., R, G, B).
r, g, b = img.split()
β’ Merge bands back into an image.
merged_img = Image.merge("RGB", (r, g, b))
β’ Apply a function to each pixel.
brighter_img = img.point(lambda i: i * 1.2)
β’ Get a list of colors used in the image.
colors = img.getcolors(maxcolors=256)
β’ Blend two images with alpha compositing.
# Both images must be in RGBA mode blended = Image.alpha_composite(img1_rgba, img2_rgba)VI. Filters (ImageFilter)
Coefficient: 1.0#97.
LogisticRegression()
Implements Logistic Regression for classification.
from sklearn.linear_model import LogisticRegression
X = [[-1], [0], [1], [2]]
y = [0, 0, 1, 1]
clf = LogisticRegression().fit(X, y)
print(f"Prediction for [[-2]]: {clf.predict([[-2]])}")
Prediction for [[-2]]: [0]#98.
KMeans()
K-Means clustering algorithm.
from sklearn.cluster import KMeans
X = [[1, 2], [1, 4], [1, 0], [10, 2], [10, 4], [10, 0]]
kmeans = KMeans(n_clusters=2, n_init='auto').fit(X)
print(kmeans.labels_)
[0 0 0 1 1 1] (Note: Cluster labels may be flipped, e.g., [1 1 1 0 0 0])#99.
accuracy_score()
Calculates the accuracy classification score.
from sklearn.metrics import accuracy_score
y_true = [0, 1, 1, 0]
y_pred = [0, 1, 0, 0]
print(accuracy_score(y_true, y_pred))
0.75#100.
confusion_matrix()
Computes a confusion matrix to evaluate the accuracy of a classification.
from sklearn.metrics import confusion_matrix
y_true = [0, 1, 0, 1]
y_pred = [1, 1, 0, 1]
print(confusion_matrix(y_true, y_pred))
[[1 1] [0 2]]βββββββββββββββ By: @CodeProgrammer β¨
Available now! Telegram Research 2025 β the year's key insights 
