Data Science | Machinelearning [ru]
Все о Data Science, машинном обучении и искусственном интеллекте: от базовой теории до cutting-edge исследований и LLM. MAX - https://max.ru/devsp Личный блог - @just_genych По вопросам рекламы или разработки - @g_abashkin РКН: https://vk.cc/cJPGXD
Show more📈 Analytical overview of Telegram channel Data Science | Machinelearning [ru]
Channel Data Science | Machinelearning [ru] (@devsp) in the Russian language segment is an active participant. Currently, the community unites 19 696 subscribers, ranking 6 672 in the Technologies & Applications category and 33 379 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 19 696 subscribers.
According to the latest data from 31 October, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -102 over the last 30 days and by -1 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 7.84%. Within the first 24 hours after publication, content typically collects 4.63% reactions from the total number of subscribers.
- Post reach: On average, each post receives 1 544 views. Within the first day, a publication typically gains 913 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 4.
- Thematic interests: Content is focused on key topics such as llm, nvidia, контекст, openai, архитектура.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“Все о Data Science, машинном обучении и искусственном интеллекте: от базовой теории до cutting-edge исследований и LLM.
MAX - https://max.ru/devsp
Личный блог - @just_genych
По вопросам рекламы или разработки - @g_abashkin
РКН: https://vk.cc/cJPGXD”
Thanks to the high frequency of updates (latest data received on 01 November, 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 Technologies & Applications category.
import numpy as np
from sklearn.decomposition import PCA
from sklearn.datasets import load_iris
# Загрузка данных
data = load_iris()
X = data.data
# Применение PCA для снижения размерности до 2 компонент
pca = PCA(n_components=2)
X_pca = pca.fit_transform(X)
print(X_pca[:5]) # Преобразованные данные
🗣️ В этом примере PCA снижает размерность данных Iris с 4 до 2 компонент. Это позволяет визуализировать данные и ускорить работу моделей, сохраняя основную информацию.🖥 Подробнее тут
y (список из 0 и 1) и числовой признак x (такой же длины). Нужно реализовать функцию best_split(x, y), которая найдёт такое значение признака, при разделении по которому (меньше/больше) будет максимально уменьшена энтропия классов.
Иными словами, нужно найти лучший threshold, при котором данные делятся на две группы по x, и у этих групп наименьшая средняя энтропия. Это базовая операция в построении деревьев решений, например, в алгоритме ID3.
Цель:
Вернуть threshold, который даёт наилучшее (наименьшее) значение средневзвешенной энтропии.Решение задачи🔽
import numpy as np def entropy(labels): if len(labels) == 0: return 0 p = np.bincount(labels) / len(labels) return -np.sum([pi * np.log2(pi) for pi in p if pi > 0]) def best_split(x, y): x = np.array(x) y = np.array(y) thresholds = sorted(set(x)) best_entropy = float('inf') best_thresh = None for t in thresholds: left_mask = x <= t right_mask = x > t left_entropy = entropy(y[left_mask]) right_entropy = entropy(y[right_mask]) w_left = np.sum(left_mask) / len(x) w_right = 1 - w_left avg_entropy = w_left * left_entropy + w_right * right_entropy if avg_entropy < best_entropy: best_entropy = avg_entropy best_thresh = t return best_thresh # Пример использования x = [2, 4, 6, 8, 10, 12] y = [0, 0, 1, 1, 1, 1] print(best_split(x, y)) # Ожидаемый результат: значение между 4 и 6 (например, 6), так как оно лучше всего делит классы
text = "Hello, world! Hello Python world."
result = count_words(text)
print(result)
# Ожидаемый результат: {'hello': 2, 'world': 2, 'python': 1}
Решение задачи🔽
import re from collections import Counter def count_words(text): # Убираем знаки препинания и приводим к нижнему регистру words = re.findall(r'\b\w+\b', text.lower()) # Подсчитываем количество вхождений каждого слова return Counter(words) # Пример использования: text = "Hello, world! Hello Python world." result = count_words(text) print(result) # Ожидаемый результат: {'hello': 2, 'world': 2, 'python': 1}
# Содержимое файла example.txt:
# "Hello, world! This is a test. Hello again."
result = count_words_in_file("example.txt")
print(result)
# Ожидаемый результат:
# {'hello': 2, 'world': 1, 'this': 1, 'is': 1, 'a': 1, 'test': 1, 'again': 1}
Решение задачи🔽
import string from collections import Counter def count_words_in_file(file_path): with open(file_path, 'r', encoding='utf-8') as f: text = f.read().lower() text = text.translate(str.maketrans('', '', string.punctuation)) words = text.split() return dict(Counter(words)) # Пример использования result = count_words_in_file("example.txt") print(result)
datetime в Python и зачем он используется?
Модуль datetime позволяет работать с датами и временем, включая их создание, форматирование и вычисление разницы между ними. Это полезно для задач, связанных с обработкой временных данных.
➡️ Пример:
from datetime import datetime, timedelta
# Текущая дата и время
now = datetime.now()
print("Сейчас:", now)
# Добавляем 7 дней к текущей дате
future_date = now + timedelta(days=7)
print("Через неделю:", future_date.strftime("%Y-%m-%d"))
🗣️ В этом примере datetime.now() получает текущую дату и время, а timedelta позволяет прибавить 7 дней. Метод strftime() форматирует дату в читаемый строковый формат.🖥 Подробнее тут
