Data Science | Machinelearning [ru]
Все о Data Science, машинном обучении и искусственном интеллекте: от базовой теории до cutting-edge исследований и LLM. Личный блог автора - @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 798 subscribers, ranking 6 512 in the Technologies & Applications category and 33 424 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 19 798 subscribers.
According to the latest data from 03 September, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -99 over the last 30 days and by -6 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 7.89%. Within the first 24 hours after publication, content typically collects 4.92% reactions from the total number of subscribers.
- Post reach: On average, each post receives 1 562 views. Within the first day, a publication typically gains 974 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.
Личный блог автора - @just_genych
По вопросам рекламы или разработки - @g_abashkin
РКН: https://vk.cc/cJPGXD”
Thanks to the high frequency of updates (latest data received on 04 September, 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.
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() форматирует дату в читаемый строковый формат.🖥 Подробнее тут
find_stable_patterns(data, min_support), которая находит наиболее часто встречающиеся бинарные шаблоны и возвращает их в виде списка кортежей (или списков).
Шаблон — это строка из 0 и 1, которая в точности совпадает с признаками у нескольких объектов. Если шаблон встречается не менее min_support раз, он считается стабильным.
Решение задачи🔽
from collections import Counter def find_stable_patterns(data, min_support=2): # Преобразуем каждую строку в кортеж (хешируемый тип) patterns = [tuple(row) for row in data] counter = Counter(patterns) # Фильтруем по min_support stable = [list(pattern) for pattern, count in counter.items() if count >= min_support] return stable # Пример использования binary_data = [ [1, 0, 1, 1], [0, 1, 0, 0], [1, 0, 1, 1], [1, 0, 1, 1], [0, 1, 0, 0], [1, 1, 1, 0] ] print(find_stable_patterns(binary_data, min_support=2)) # Ожидаемый результат: # [[1, 0, 1, 1], [0, 1, 0, 0]]
