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 700 subscribers, ranking 6 678 in the Technologies & Applications category and 33 376 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 19 700 subscribers.
According to the latest data from 30 October, 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 -7 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 7.92%. Within the first 24 hours after publication, content typically collects 4.70% reactions from the total number of subscribers.
- Post reach: On average, each post receives 1 561 views. Within the first day, a publication typically gains 925 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 31 October, 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}
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
# Пример: диагностические данные пациента
df = pd.DataFrame({
'age': [25, 40, 60, 35],
'blood_pressure': [120, 130, 150, 110],
'has_disease': [0, 1, 1, 0],
'diagnosis_code': [0, 1, 1, 0] # случайно совпадает с целевой переменной
})
X = df.drop('has_disease', axis=1)
y = df['has_disease']
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
model = LogisticRegression()
model.fit(X_train, y_train)
print("Train accuracy:", model.score(X_train, y_train))
🗣️ В этом примере diagnosis_code напрямую связан с целевой переменной has_disease. Модель «угадывает» ответы на тренировке, но это не работает в реальности. Такое скрытое совпадение — типичный пример data leakage
highly_correlated_features(data, threshold), которая вернёт список пар индексов признаков, корреляция между которыми по модулю превышает указанный threshold (от 0 до 1, не включительно).
Использовать можно только корреляцию Пирсона. Повторы пар и зеркальные дубли учитывать не нужно ((1, 2) и (2, 1) — одно и то же).
Цель:
Выявить признаки, которые слишком сильно "повторяют" друг друга и могут вызвать мультиколлинеарность в моделях.Решение задачи🔽
import numpy as np from itertools import combinations def pearson_corr(x, y): x = np.array(x) y = np.array(y) return np.corrcoef(x, y)[0, 1] def highly_correlated_features(data, threshold=0.9): arr = np.array(data) n_features = arr.shape[1] result = [] for i, j in combinations(range(n_features), 2): corr = pearson_corr(arr[:, i], arr[:, j]) if abs(corr) > threshold: result.append((i, j)) return result # Пример использования X = [ [1, 2, 10], [2, 4, 20], [3, 6, 30], [4, 8, 40], [5, 10, 50] ] print(highly_correlated_features(X, threshold=0.95)) # Ожидаемый результат: [(0, 1), (0, 2), (1, 2)]
Стабильный признак — это признак, у которого стандартное отклонение по всем объектам меньше заданного порога threshold.Реализуйте функцию
find_stable_features(matrix, threshold), которая возвращает список индексов признаков (столбцов), удовлетворяющих этому условию.
Решение задачи🔽
import numpy as np def find_stable_features(matrix, threshold=0.1): data = np.array(matrix) stds = np.std(data, axis=0) stable_indices = [i for i, std in enumerate(stds) if std < threshold] return stable_indices # Пример входных данных X = [ [1.0, 0.5, 3.2], [1.0, 0.49, 3.1], [1.0, 0.52, 3.0], [1.0, 0.5, 3.3], ] print(find_stable_features(X, threshold=0.05)) # Ожидаемый результат: [0, 1]
