Data Science & Machine Learning
Join this channel to learn data science, artificial intelligence and machine learning with funny quizzes, interesting projects and amazing resources for free For collaborations: @love_data
Больше📈 Аналитический обзор Telegram-канала Data Science & Machine Learning
Канал Data Science & Machine Learning (@datasciencefun) языкового сегмента Английский является активным участником. Сейчас сообщество объединяет 75 818 подписчиков, занимая 2 113 место в категории Образование и 4 286 место в регионе Индия.
📊 Показатели аудитории и динамика
С момента создания невідомо проект демонстрирует стремительный рост, собрав аудиторию из 75 818 подписчиков.
Согласно последним данным от 18 июня, 2026, канал показывает стабильную активность. За последние 30 дней изменение числа участников составило 884, а за последние 24 часа — 6, при этом общий охват остаётся высоким.
- Статус верификации: Не верифицирован
- Уровень вовлечённости (ER): Средний показатель вовлечённости аудитории составляет 3.25%. В первые 24 часа после публикации контент обычно набирает 1.38% реакций от общего числа подписчиков.
- Охват публикаций: В среднем каждый пост получает 2 462 просмотров. В течение первых суток публикация набирает 1 043 просмотров.
- Реакции и взаимодействия: Аудитория активно поддерживает контент: среднее количество реакций на один пост — 4.
- Тематические интересы: Контент сосредоточен на ключевых темах, таких как learning, accuracy, distribution, panda, dataset.
📝 Описание и контентная политика
Автор описывает ресурс как площадку для выражения субъективного мнения:
“Join this channel to learn data science, artificial intelligence and machine learning with funny quizzes, interesting projects and amazing resources for free
For collaborations: @love_data”
Благодаря высокой частоте обновлений (последние данные получены 19 июня, 2026) канал поддерживает актуальность и высокий уровень охвата публикаций. Аналитика показывает, что аудитория активно взаимодействует с контентом, что делает его важной точкой влияния в категории Образование.
import numpy as np
import tensorflow as tf
from tensorflow.keras.applications import VGG16
from tensorflow.keras.datasets import cifar10
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten, Dropout
from tensorflow.keras.optimizers import Adam
# Load CIFAR-10 dataset
(X_train, y_train), (X_test, y_test) = cifar10.load_data()
# Preprocess the data
X_train = X_train.astype('float32') / 255.0
X_test = X_test.astype('float32') / 255.0
# Load pre-trained VGG16 model (excluding top layers)
base_model = VGG16(weights='imagenet', include_top=False, input_shape=(32, 32, 3))
# Freeze the layers in base model
for layer in base_model.layers:
layer.trainable = False
# Create a new model on top of the pre-trained base model
model = Sequential([
base_model,
Flatten(),
Dense(512, activation='relu'),
Dropout(0.5),
Dense(10, activation='softmax')
])
# Compile the model
model.compile(optimizer=Adam(learning_rate=0.0001),
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
# Train the model
history = model.fit(X_train, y_train, epochs=10, batch_size=128,
validation_data=(X_test, y_test))
# Evaluate the model
test_loss, test_acc = model.evaluate(X_test, y_test)
print(f'Test accuracy: {test_acc}')
# Fine-tuning the model
for layer in base_model.layers[-4:]:
layer.trainable = True
model.compile(optimizer=Adam(learning_rate=0.00001),
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
history = model.fit(X_train, y_train, epochs=5, batch_size=128,
validation_data=(X_test, y_test))
# Evaluate the fine-tuned model
test_loss, test_acc = model.evaluate(X_test, y_test)
print(f'Fine-tuned test accuracy: {test_acc}')# Import necessary libraries
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import Dense, Flatten, Reshape
from tensorflow.keras.layers import LeakyReLU, BatchNormalization
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import Adam
# Load the MNIST dataset
(X_train, _), (_, _) = mnist.load_data()
# Normalize the data
X_train = (X_train.astype(np.float32) - 127.5) / 127.5
X_train = X_train.reshape(X_train.shape[0], 784)
# Define the generator model
generator = Sequential([
Dense(256, input_dim=100),
LeakyReLU(alpha=0.2),
BatchNormalization(),
Dense(512),
LeakyReLU(alpha=0.2),
BatchNormalization(),
Dense(1024),
LeakyReLU(alpha=0.2),
BatchNormalization(),
Dense(784, activation='tanh'),
Reshape((28, 28))
])
# Define the discriminator model
discriminator = Sequential([
Flatten(input_shape=(28, 28)),
Dense(1024),
LeakyReLU(alpha=0.2),
Dense(512),
LeakyReLU(alpha=0.2),
Dense(256),
LeakyReLU(alpha=0.2),
Dense(1, activation='sigmoid')
])
# Compile the discriminator
discriminator.compile(optimizer=Adam(learning_rate=0.0002, beta_1=0.5),
loss='binary_crossentropy', metrics=['accuracy'])
# Compile the GAN model
discriminator.trainable = False
gan_input = Input(shape=(100,))
x = generator(gan_input)
gan_output = discriminator(x)
gan = Model(gan_input, gan_output)
gan.compile(optimizer=Adam(learning_rate=0.0002, beta_1=0.5),
loss='binary_crossentropy')
# Function to train the GAN
def train_gan(epochs=1, batch_size=128):
# Calculate the number of batches per epoch
batch_count = X_train.shape[0] // batch_size
for e in range(epochs):
for _ in range(batch_count):
# Generate random noise as input for the generator
noise = np.random.normal(0, 1, size=[batch_size, 100])
# Generate fake images using the generator
generated_images = generator.predict(noise)
# Get a random batch of real images from the dataset
batch_idx = np.random.randint(0, X_train.shape[0], batch_size)
real_images = X_train[batch_idx]
# Concatenate real and fake images
X = np.concatenate([real_images, generated_images])
# Labels for generated and real data
y_dis = np.zeros(2 * batch_size)
y_dis[:batch_size] = 0.9 # One-sided label smoothing
# Train the discriminator
discriminator.trainable = True
d_loss = discriminator.train_on_batch(X, y_dis)
# Train the generator (via the GAN model)
noise = np.random.normal(0, 1, size=[batch_size, 100])
y_gen = np.ones(batch_size)
discriminator.trainable = False
g_loss = gan.train_on_batch(noise, y_gen)
# Print the progress and save the generated images
print(f"Epoch {e+1}, Discriminator Loss: {d_loss[0]}, Generator Loss: {g_loss}")
if e % 10 == 0:
plot_generated_images(e, generator)
# Function to plot generated images
def plot_generated_images(epoch, generator, examples=10, dim=(1, 10), figsize=(10, 1)):
noise = np.random.normal(0, 1, size=[examples, 100])
generated_images = generator.predict(noise)
generated_images = generated_images.reshape(examples, 28, 28)
plt.figure(figsize=figsize)
for i in range(examples):
plt.subplot(dim[0], dim[1], i+1)
plt.imshow(generated_images[i], interpolation='nearest', cmap='gray')
plt.axis('off')
plt.tight_layout()
plt.savefig(f'gan_generated_image_epoch_{epoch}.png')
plt.show()
# Train the GAN
train_gan(epochs=100, batch_size=128)
#### Explanation of the Code# Import necessary libraries
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.keras.layers import Input, Dense
from tensorflow.keras.models import Model
from tensorflow.keras.datasets import mnist
# Load the MNIST dataset
(x_train, _), (x_test, _) = mnist.load_data()
x_train = x_train.astype('float32') / 255.
x_test = x_test.astype('float32') / 255.
x_train = x_train.reshape((len(x_train), np.prod(x_train.shape[1:])))
x_test = x_test.reshape((len(x_test), np.prod(x_test.shape[1:])))
# Define the autoencoder architecture
input_dim = x_train.shape[1]
encoding_dim = 32
# Encoder
input_img = Input(shape=(input_dim,))
encoded = Dense(encoding_dim, activation='relu')(input_img)
# Decoder
decoded = Dense(input_dim, activation='sigmoid')(encoded)
# Autoencoder model
autoencoder = Model(input_img, decoded)
# Compile the model
autoencoder.compile(optimizer='adam', loss='binary_crossentropy')
# Train the model
autoencoder.fit(x_train, x_train,
epochs=50,
batch_size=256,
shuffle=True,
validation_data=(x_test, x_test))
# Encoder model to extract the latent representation
encoder = Model(input_img, encoded)
# Decoder model to reconstruct the input from the latent representation
encoded_input = Input(shape=(encoding_dim,))
decoder_layer = autoencoder.layers[-1]
decoder = Model(encoded_input, decoder_layer(encoded_input))
# Encode and decode some digits
encoded_imgs = encoder.predict(x_test)
decoded_imgs = decoder.predict(encoded_imgs)
# Plot the original and reconstructed images
n = 10
plt.figure(figsize=(20, 4))
for i in range(n):
# Display original
ax = plt.subplot(2, n, i + 1)
plt.imshow(x_test[i].reshape(28, 28))
plt.gray()
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
# Display reconstruction
ax = plt.subplot(2, n, i + 1 + n)
plt.imshow(decoded_imgs[i].reshape(28, 28))
plt.gray()
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
plt.show()# Example with Stacked GRU and Dropout
from tensorflow.keras.layers import Dropout
# Create the stacked GRU model
model = Sequential([
GRU(50, return_sequences=True, input_shape=(time_step, 1)),
Dropout(0.2),
GRU(50),
Dense(1)
])
# Compile, train, and evaluate the model (same as before)
model.compile(optimizer='adam', loss='mean_squared_error')
model.fit(X_train, y_train, epochs=50, batch_size=1, verbose=1)
loss = model.evaluate(X_test, y_test, verbose=0)
print(f"Test Loss: {loss}")
#### Applications
GRUs are widely used in various fields such as:
- Natural Language Processing (NLP): Language modeling, machine translation, text generation.
- Time Series Analysis: Stock price prediction, weather forecasting, anomaly detection.
- Speech Recognition: Transcribing spoken language into text.
- Video Analysis: Activity recognition, video captioning.
- Music Generation: Composing music by predicting sequences of notes.
GRUs' ability to capture long-term dependencies while being computationally efficient makes them a popular choice for sequential data tasks.
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
ENJOY LEARNING 👍👍# Import necessary libraries
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import GRU, Dense
from sklearn.preprocessing import MinMaxScaler
# Generate synthetic sequential data
data = np.sin(np.linspace(0, 100, 1000))
# Prepare the dataset
def create_dataset(data, time_step=1):
X, y = [], []
for i in range(len(data) - time_step - 1):
a = data[i:(i + time_step)]
X.append(a)
y.append(data[i + time_step])
return np.array(X), np.array(y)
# Scale the data
scaler = MinMaxScaler(feature_range=(0, 1))
data = scaler.fit_transform(data.reshape(-1, 1))
# Create the dataset with time steps
time_step = 10
X, y = create_dataset(data, time_step)
X = X.reshape(X.shape[0], X.shape[1], 1)
# Split the data into train and test sets
train_size = int(len(X) * 0.8)
X_train, X_test = X[:train_size], X[train_size:]
y_train, y_test = y[:train_size], y[train_size:]
# Create the GRU model
model = Sequential([
GRU(50, input_shape=(time_step, 1)),
Dense(1)
])
# Compile the model
model.compile(optimizer='adam', loss='mean_squared_error')
# Train the model
model.fit(X_train, y_train, epochs=50, batch_size=1, verbose=1)
# Evaluate the model
loss = model.evaluate(X_test, y_test, verbose=0)
print(f"Test Loss: {loss}")
# Predict the next value in the sequence
last_sequence = X_test[-1].reshape(1, time_step, 1)
predicted_value = model.predict(last_sequence)
predicted_value = scaler.inverse_transform(predicted_value)
print(f"Predicted Value: {predicted_value[0][0]}")
#### Explanation of the Code
1. Data Generation: We generate synthetic sequential data using a sine function.
2. Dataset Preparation: We create sequences of 10 time steps to predict the next value.
3. Data Scaling: Normalize the data to the range [0, 1] using MinMaxScaler.
4. Dataset Creation: Create the dataset with input sequences and corresponding labels.
5. Train-Test Split: Split the data into training and test sets.
6. Model Creation:
- GRU Layer: A GRU layer with 50 units.
- Dense Layer: A fully connected layer with a single output neuron for regression.
7. Model Compilation: We compile the model with the Adam optimizer and mean squared error loss function.
8. Model Training: Train the model for 50 epochs with a batch size of 1.
9. Model Evaluation: Evaluate the model on the test set and print the loss.
10. Prediction: Predict the next value in the sequence using the last sequence from the test set.# Example with Stacked LSTM and Dropout
from tensorflow.keras.layers import Dropout
# Create the stacked LSTM model
model = Sequential([
LSTM(50, return_sequences=True, input_shape=(time_step, 1)),
Dropout(0.2),
LSTM(50),
Dense(1)
])
# Compile, train, and evaluate the model (same as before)
model.compile(optimizer='adam', loss='mean_squared_error')
model.fit(X_train, y_train, epochs=50, batch_size=1, verbose=1)
loss = model.evaluate(X_test, y_test, verbose=0)
print(f"Test Loss: {loss}")
#### Applications
LSTMs are widely used in various fields such as:
- Natural Language Processing (NLP): Language modeling, machine translation, text generation.
- Time Series Analysis: Stock price prediction, weather forecasting, anomaly detection.
- Speech Recognition: Transcribing spoken language into text.
- Video Analysis: Activity recognition, video captioning.
- Music Generation: Composing music by predicting sequences of notes.
LSTMs' ability to capture long-term dependencies makes them highly effective for sequential data tasks.
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
ENJOY LEARNING 👍👍# Import necessary libraries
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense
from sklearn.preprocessing import MinMaxScaler
# Generate synthetic sequential data
data = np.sin(np.linspace(0, 100, 1000))
# Prepare the dataset
def create_dataset(data, time_step=1):
X, y = [], []
for i in range(len(data) - time_step - 1):
a = data[i:(i + time_step)]
X.append(a)
y.append(data[i + time_step])
return np.array(X), np.array(y)
# Scale the data
scaler = MinMaxScaler(feature_range=(0, 1))
data = scaler.fit_transform(data.reshape(-1, 1))
# Create the dataset with time steps
time_step = 10
X, y = create_dataset(data, time_step)
X = X.reshape(X.shape[0], X.shape[1], 1)
# Split the data into train and test sets
train_size = int(len(X) * 0.8)
X_train, X_test = X[:train_size], X[train_size:]
y_train, y_test = y[:train_size], y[train_size:]
# Create the LSTM model
model = Sequential([
LSTM(50, input_shape=(time_step, 1)),
Dense(1)
])
# Compile the model
model.compile(optimizer='adam', loss='mean_squared_error')
# Train the model
model.fit(X_train, y_train, epochs=50, batch_size=1, verbose=1)
# Evaluate the model
loss = model.evaluate(X_test, y_test, verbose=0)
print(f"Test Loss: {loss}")
# Predict the next value in the sequence
last_sequence = X_test[-1].reshape(1, time_step, 1)
predicted_value = model.predict(last_sequence)
predicted_value = scaler.inverse_transform(predicted_value)
print(f"Predicted Value: {predicted_value[0][0]}")
#### Explanation of the Code
1. Data Generation: We generate synthetic sequential data using a sine function.
2. Dataset Preparation: We create sequences of 10 time steps to predict the next value.
3. Data Scaling: Normalize the data to the range [0, 1] using MinMaxScaler.
4. Dataset Creation: Create the dataset with input sequences and corresponding labels.
5. Train-Test Split: Split the data into training and test sets.
6. Model Creation:
- LSTM Layer: An LSTM layer with 50 units.
- Dense Layer: A fully connected layer with a single output neuron for regression.
7. Model Compilation: We compile the model with the Adam optimizer and mean squared error loss function.
8. Model Training: Train the model for 50 epochs with a batch size of 1.
9. Model Evaluation: Evaluate the model on the test set and print the loss.
10. Prediction: Predict the next value in the sequence using the last sequence from the test set.
print(f"Predicted Value: {predicted_value[0][0]}")# Example with LSTM
from tensorflow.keras.layers import LSTM
# Create the LSTM model
model = Sequential([
LSTM(50, input_shape=(time_step, 1)),
Dense(1)
])
# Compile, train, and evaluate the model (same as before)
model.compile(optimizer='adam', loss='mean_squared_error')
model.fit(X_train, y_train, epochs=50, batch_size=1, verbose=1)
loss = model.evaluate(X_test, y_test, verbose=0)
print(f"Test Loss: {loss}")
#### Applications
RNNs are widely used in various fields such as:
- Natural Language Processing (NLP): Language modeling, machine translation, text generation.
- Time Series Analysis: Stock price prediction, weather forecasting, anomaly detection.
- Speech Recognition: Transcribing spoken language into text.
- Video Analysis: Activity recognition, video captioning.
- Music Generation: Composing music by predicting sequences of notes.
RNNs' ability to capture temporal dependencies makes them highly effective for sequential data tasks.
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
ENJOY LEARNING 👍👍# Import necessary libraries
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import SimpleRNN, Dense
from sklearn.preprocessing import MinMaxScaler
# Generate synthetic sequential data
data = np.sin(np.linspace(0, 100, 1000))
# Prepare the dataset
def create_dataset(data, time_step=1):
X, y = [], []
for i in range(len(data) - time_step - 1):
a = data[i:(i + time_step)]
X.append(a)
y.append(data[i + time_step])
return np.array(X), np.array(y)
# Scale the data
scaler = MinMaxScaler(feature_range=(0, 1))
data = scaler.fit_transform(data.reshape(-1, 1))
# Create the dataset with time steps
time_step = 10
X, y = create_dataset(data, time_step)
X = X.reshape(X.shape[0], X.shape[1], 1)
# Split the data into train and test sets
train_size = int(len(X) * 0.8)
X_train, X_test = X[:train_size], X[train_size:]
y_train, y_test = y[:train_size], y[train_size:]
# Create the RNN model
model = Sequential([
SimpleRNN(50, input_shape=(time_step, 1)),
Dense(1)
])
# Compile the model
model.compile(optimizer='adam', loss='mean_squared_error')
# Train the model
model.fit(X_train, y_train, epochs=50, batch_size=1, verbose=1)
# Evaluate the model
loss = model.evaluate(X_test, y_test, verbose=0)
print(f"Test Loss: {loss}")
# Predict the next value in the sequence
last_sequence = X_test[-1].reshape(1, time_step, 1)
predicted_value = model.predict(last_sequence)
predicted_value = scaler.inverse_transform(predicted_value)
print(f"Predicted Value: {predicted_value[0][0]}")
#### Explanation of the Code
1. Data Generation: We generate synthetic sequential data using a sine function.
2. Dataset Preparation: We create sequences of 10 time steps to predict the next value.
3. Data Scaling: Normalize the data to the range [0, 1] using MinMaxScaler.
4. Dataset Creation: Create the dataset with input sequences and corresponding labels.
5. Train-Test Split: Split the data into training and test sets.
6. Model Creation:
- SimpleRNN Layer: A recurrent layer with 50 units.
- Dense Layer: A fully connected layer with a single output neuron for regression.
7. Model Compilation: We compile the model with the Adam optimizer and mean squared error loss function.
8. Model Training: Train the model for 50 epochs with a batch size of 1.
9. Model Evaluation: Evaluate the model on the test set and print the loss.
10. Prediction: Predict the next value in the sequence using the last sequence from the test set.
print(f"Predicted Value: {predicted_value[0][0]}")# Example with LSTM
from tensorflow.keras.layers import LSTM
# Create the LSTM model
model = Sequential([
LSTM(50, input_shape=(time_step, 1)),
Dense(1)
])
# Compile, train, and evaluate the model (same as before)
model.compile(optimizer='adam', loss='mean_squared_error')
model.fit(X_train, y_train, epochs=50, batch_size=1, verbose=1)
loss = model.evaluate(X_test, y_test, verbose=0)
print(f"Test Loss: {loss}")
#### Applications
RNNs are widely used in various fields such as:
- Natural Language Processing (NLP): Language modeling, machine translation, text generation.
- Time Series Analysis: Stock price prediction, weather forecasting, anomaly detection.
- Speech Recognition: Transcribing spoken language into text.
- Video Analysis: Activity recognition, video captioning.
- Music Generation: Composing music by predicting sequences of notes.
RNNs' ability to capture temporal dependencies makes them highly effective for sequential data tasks.
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
ENJOY LEARNING 👍👍numpy and tensorflow.keras.
2. Data Loading: We load the MNIST dataset with images of handwritten digits.
3. Data Preprocessing:
- Reshape the images to include a single channel (grayscale).
- Normalize pixel values to the range [0, 1].
- Convert the labels to one-hot encoded format.
4. Model Creation:
- Conv2D Layers: Apply 32 and 64 filters with a kernel size of (3, 3) for feature extraction.
- MaxPooling2D Layers: Reduce the spatial dimensions of the feature maps.
- Flatten Layer: Convert 2D feature maps to a 1D vector.
- Dense Layers: Perform classification with 128 neurons in the hidden layer and 10 neurons in the output layer (one for each digit class).
5. Model Compilation: We compile the model with the Adam optimizer and categorical cross-entropy loss function.
6. Model Training: We train the model for 10 epochs with a batch size of 200 and validate on 20% of the training data.
7. Model Evaluation: We evaluate the model on the test set and print the accuracy.
print(f"Test Accuracy: {accuracy}")
#### Advanced Features of CNNs
1. Deeper Architectures: Increase the number of convolutional and pooling layers for better feature extraction.
2. Data Augmentation: Enhance the training set by applying transformations like rotation, flipping, and scaling.
3. Transfer Learning: Use pre-trained models (e.g., VGG, ResNet) and fine-tune them on specific tasks.
4. Regularization Techniques:
- Dropout: Randomly drop neurons during training to prevent overfitting.
- Batch Normalization: Normalize inputs of each layer to stabilize and accelerate training.
# Example with Data Augmentation and Dropout
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.layers import Dropout
# Data Augmentation
datagen = ImageDataGenerator(
rotation_range=10,
zoom_range=0.1,
width_shift_range=0.1,
height_shift_range=0.1
)
# Creating the CNN model with Dropout
model = Sequential([
Conv2D(32, kernel_size=(3, 3), activation='relu', input_shape=(28, 28, 1)),
MaxPooling2D(pool_size=(2, 2)),
Dropout(0.25),
Conv2D(64, kernel_size=(3, 3), activation='relu'),
MaxPooling2D(pool_size=(2, 2)),
Dropout(0.25),
Flatten(),
Dense(128, activation='relu'),
Dropout(0.5),
Dense(10, activation='softmax')
])
# Compiling and training remain the same as before
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(datagen.flow(X_train, y_train, batch_size=200), epochs=10, validation_data=(X_test, y_test), verbose=1)
#### Applications
CNNs are widely used in various fields such as:
- Computer Vision: Image classification, object detection, facial recognition.
- Medical Imaging: Tumor detection, medical image segmentation.
- Autonomous Driving: Road sign recognition, obstacle detection.
- Augmented Reality: Gesture recognition, object tracking.
- Security: Surveillance, biometric authentication.
CNNs' ability to automatically learn hierarchical feature representations makes them highly effective for image-related tasks.
Уже доступно! Исследование Telegram 2025 — ключевые инсайты года 
