<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by AkShit Singh on Medium]]></title>
        <description><![CDATA[Stories by AkShit Singh on Medium]]></description>
        <link>https://medium.com/@akshit-s7?source=rss-75dd15b8f0c7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6l7COXF9QvsewYHu</url>
            <title>Stories by AkShit Singh on Medium</title>
            <link>https://medium.com/@akshit-s7?source=rss-75dd15b8f0c7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 00:52:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akshit-s7/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Image Classification on Imbalanced Dataset #Python #MNIST_dataSet]]></title>
            <link>https://blog.devgenius.io/image-classification-on-unbalanced-dataset-python-mnist-dataset-ba3fc4360c7f?source=rss-75dd15b8f0c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba3fc4360c7f</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[AkShit Singh]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 15:18:02 GMT</pubDate>
            <atom:updated>2023-04-12T19:09:40.322Z</atom:updated>
            <content:encoded><![CDATA[<p>Image classification can be performed on an Imbalanced dataset, but it requires additional considerations when calculating performance metrics like accuracy, recall, F1 score, AUC, and ROC.</p><p>When the dataset is Imbalanced, meaning that one class has significantly more samples than the others, accuracy alone may not be a reliable metric for evaluating the performance of the model. Instead, we need to consider other metrics such as recall, precision, F1 score, AUC, and ROC.</p><p>Here is a step-by-step approach to evaluating an image classification model on an Imbalanced dataset:</p><ol><li>Split the dataset into training and test sets. It is important to use stratified sampling to ensure that each class is represented in both the training and test sets.</li><li>Train the image classification model on the training set.</li><li>Predict the classes of the test set.</li><li>Calculate the confusion matrix. The confusion matrix shows the number of true positives, true negatives, false positives, and false negatives for each class.</li><li>Calculate the accuracy, recall, precision, and F1 score for each class. These metrics can be calculated using the confusion matrix.</li></ol><ul><li>Accuracy: (TP+TN) / (TP+TN+FP+FN)</li><li>Recall: TP / (TP+FN)</li><li>Precision: TP / (TP+FP)</li><li>F1 Score: 2 * (precision * recall) / (precision + recall)</li></ul><p>6. Calculate the AUC and ROC. The AUC is a measure of how well the model can distinguish between the positive and negative classes. The ROC curve is a plot of the true positive rate (recall) versus the false positive rate (1-specificity) at different classification thresholds.</p><p>7. Calculate the RUC, which stands for “Receiver Operating Characteristics,” and is used to evaluate the performance of binary classification models.</p><p>In conclusion, it is possible to perform image classification on an unbalanced dataset, but it requires additional considerations when evaluating the performance of the model. We need to use metrics like recall, precision, F1 score, AUC, and ROC to ensure that the model is performing well on both the majority and minority classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jE6ZTcBEkynjL7hR" /><figcaption>Photo by <a href="https://unsplash.com/@artturijalli?utm_source=medium&amp;utm_medium=referral">Artturi Jalli</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Here’s the example on MNIST dataset.</p><pre>from sklearn.metrics import auc, precision_recall_fscore_support</pre><pre>import numpy as np<br>import tensorflow as tf<br>from sklearn.model_selection import train_test_split<br>from sklearn.metrics import confusion_matrix, accuracy_score, classification_report, roc_auc_score, roc_curve<br><br># Load the MNIST dataset<br>(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()<br><br># Reshape the input data to (num_samples, height, width, num_channels)<br>x_train = np.expand_dims(x_train, axis=-1)<br>x_test = np.expand_dims(x_test, axis=-1)<br><br># Split the dataset into training and test sets<br>x_train, x_val, y_train, y_val = train_test_split(x_train, y_train, test_size=0.2, stratify=y_train, random_state=42)</pre><pre>Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz<br>11490434/11490434 [==============================] - 0s 0us/step</pre><pre># Create a new unbalanced dataset by removing samples from classes 0 and 1<br>remove_idx = np.concatenate([np.where(y_train==0)[0][:int(len(y_train[y_train==0])*0.8)], <br>                              np.where(y_train==1)[0][:int(len(y_train[y_train==1])*0.8)]])<br>x_train = np.delete(x_train, remove_idx, axis=0)<br>y_train = np.delete(y_train, remove_idx, axis=0)</pre><pre># Define the CNN model<br>model = tf.keras.models.Sequential([<br>    tf.keras.layers.Conv2D(32, kernel_size=(3, 3), activation=&quot;relu&quot;, input_shape=x_train[0].shape),<br>    tf.keras.layers.MaxPooling2D(pool_size=(2, 2)),<br>    tf.keras.layers.Flatten(),<br>    tf.keras.layers.Dense(10, activation=&quot;softmax&quot;)<br>])<br><br># Compile the model<br>model.compile(loss=&quot;sparse_categorical_crossentropy&quot;, optimizer=&quot;adam&quot;, metrics=[&quot;accuracy&quot;])<br><br># Train the model on the unbalanced training dataset<br>history = model.fit(x_train, y_train, batch_size=32, epochs=10, validation_data=(x_val, y_val))</pre><pre>Epoch 1/10<br>1247/1247 [==============================] - 34s 26ms/step - loss: 0.6205 - accuracy: 0.9326 - val_loss: 0.1745 - val_accuracy: 0.9542<br>Epoch 2/10<br>1247/1247 [==============================] - 30s 24ms/step - loss: 0.0893 - accuracy: 0.9746 - val_loss: 0.1559 - val_accuracy: 0.9635<br>Epoch 3/10<br>1247/1247 [==============================] - 23s 18ms/step - loss: 0.0724 - accuracy: 0.9775 - val_loss: 0.1418 - val_accuracy: 0.9657<br>Epoch 4/10<br>1247/1247 [==============================] - 22s 18ms/step - loss: 0.0605 - accuracy: 0.9812 - val_loss: 0.1493 - val_accuracy: 0.9664<br>Epoch 5/10<br>1247/1247 [==============================] - 23s 18ms/step - loss: 0.0525 - accuracy: 0.9842 - val_loss: 0.1730 - val_accuracy: 0.9635<br>Epoch 6/10<br>1247/1247 [==============================] - 23s 18ms/step - loss: 0.0533 - accuracy: 0.9845 - val_loss: 0.1755 - val_accuracy: 0.9638<br>Epoch 7/10<br>1247/1247 [==============================] - 22s 18ms/step - loss: 0.0440 - accuracy: 0.9869 - val_loss: 0.2340 - val_accuracy: 0.9614<br>Epoch 8/10<br>1247/1247 [==============================] - 21s 17ms/step - loss: 0.0415 - accuracy: 0.9874 - val_loss: 0.2473 - val_accuracy: 0.9603<br>Epoch 9/10<br>1247/1247 [==============================] - 24s 19ms/step - loss: 0.0383 - accuracy: 0.9883 - val_loss: 0.2336 - val_accuracy: 0.9626<br>Epoch 10/10<br>1247/1247 [==============================] - 23s 19ms/step - loss: 0.0322 - accuracy: 0.9913 - val_loss: 0.2417 - val_accuracy: 0.9664</pre><pre># Predict the test set<br>y_pred = model.predict(x_test)<br><br># Convert the probabilities to class labels<br>y_pred = np.argmax(y_pred, axis=1)<br><br># Calculate the confusion matrix<br>conf_matrix = confusion_matrix(y_test, y_pred)<br><br># Calculate the accuracy, recall, precision, and F1 score for each class<br>accuracy = accuracy_score(y_test, y_pred)<br>report = classification_report(y_test, y_pred)<br><br>print(f&quot;Confusion Matrix:\n{conf_matrix}&quot;)<br>print(f&quot;Accuracy: {accuracy:.3f}&quot;)<br>print(f&quot;Classification Report:\n{report}&quot;)</pre><pre>313/313 [==============================] - 2s 6ms/step<br>Confusion Matrix:<br>[[ 940    0    3    0    3    1   16    1   12    4]<br> [   0 1100    7    2    1    1    8    1   14    1]<br> [   1    1 1001    2    4    0    4   10    4    5]<br> [   0    0    1  990    0    8    0    4    3    4]<br> [   0    1    0    0  939    0    7    4    6   25]<br> [   0    0    0   11    0  873    3    1    2    2]<br> [   4    1    0    2    5    4  939    0    3    0]<br> [   0    4   15    4    3    0    0  980    6   16]<br> [   3    2    6    5    3    6    4    4  934    7]<br> [   0    3    0    2    7    4    0    5    1  987]]<br>Accuracy: 0.968<br>Classification Report:<br>              precision    recall  f1-score   support<br><br>           0       0.99      0.96      0.98       980<br>           1       0.99      0.97      0.98      1135<br>           2       0.97      0.97      0.97      1032<br>           3       0.97      0.98      0.98      1010<br>           4       0.97      0.96      0.96       982<br>           5       0.97      0.98      0.98       892<br>           6       0.96      0.98      0.97       958<br>           7       0.97      0.95      0.96      1028<br>           8       0.95      0.96      0.95       974<br>           9       0.94      0.98      0.96      1009<br><br>    accuracy                           0.97     10000<br>   macro avg       0.97      0.97      0.97     10000<br>weighted avg       0.97      0.97      0.97     10000</pre><pre>import matplotlib.pyplot as plt<br>from sklearn.metrics import confusion_matrix, classification_report, roc_curve, auc, precision_recall_fscore_support<br><br># Get the predicted probabilities for each class<br>y_prob = model.predict(x_test)<br><br># Get the predicted class for each sample<br>y_pred = y_prob.argmax(axis=-1)<br><br># Generate a confusion matrix<br>conf_mat = confusion_matrix(y_test, y_pred)<br><br># Generate a classification report<br>class_report = classification_report(y_test, y_pred, digits=4)<br><br># Calculate the ROC curve for each class<br>fpr = dict()<br>tpr = dict()<br>roc_auc = dict()<br>for i in range(10):<br>    fpr[i], tpr[i], _ = roc_curve(y_test == i, y_prob[:, i])<br>    roc_auc[i] = auc(fpr[i], tpr[i])<br><br># Calculate the precision, recall, F1 score for each class<br>precision = dict()<br>recall = dict()<br>f1_score = dict()<br>for i in range(10):<br>    precision[i], recall[i], f1_score[i], _ = precision_recall_fscore_support(y_test == i, y_pred == i, average=&quot;binary&quot;)<br>    precision[i], recall[i], f1_score[i] = precision_recall_fscore_support(y_test == i, y_pred == i, average=&quot;binary&quot;)[:3]<br><br># Plot the metrics<br>plt.figure(figsize=(12, 4))<br>plt.subplot(1, 3, 1)<br>plt.bar(range(10), precision.values())<br>plt.title(&quot;Precision&quot;)<br>plt.xlabel(&quot;Class&quot;)<br>plt.ylabel(&quot;Score&quot;)<br>plt.xticks(range(10))<br>plt.ylim(0, 1)<br>plt.subplot(1, 3, 2)<br>plt.bar(range(10), recall.values())<br>plt.title(&quot;Recall&quot;)<br>plt.xlabel(&quot;Class&quot;)<br>plt.ylabel(&quot;Score&quot;)<br>plt.xticks(range(10))<br>plt.ylim(0, 1)<br>plt.subplot(1, 3, 3)<br>plt.bar(range(10), f1_score.values())<br>plt.title(&quot;F1 Score&quot;)<br>plt.xlabel(&quot;Class&quot;)<br>plt.ylabel(&quot;Score&quot;)<br>plt.xticks(range(10))<br>plt.ylim(0, 1)<br>plt.tight_layout()<br>plt.show()<br><br>plt.figure(figsize=(6, 6))<br>for i in range(10):<br>    plt.plot(fpr[i], tpr[i], label=f&quot;Class {i} (AUC = {roc_auc[i]:.2f})&quot;)<br>plt.title(&quot;ROC Curve&quot;)<br>plt.xlabel(&quot;False Positive Rate&quot;)<br>plt.ylabel(&quot;True Positive Rate&quot;)<br>plt.legend(loc=&quot;best&quot;)<br>plt.show()<br><br>print(&quot;Confusion Matrix:&quot;)<br>print(conf_mat)<br>print(&quot;Classification Report:&quot;)<br>print(class_report)</pre><pre>313/313 [==============================] - 2s 6ms/step</pre><pre>Confusion Matrix:<br>[[ 940    0    3    0    3    1   16    1   12    4]<br> [   0 1100    7    2    1    1    8    1   14    1]<br> [   1    1 1001    2    4    0    4   10    4    5]<br> [   0    0    1  990    0    8    0    4    3    4]<br> [   0    1    0    0  939    0    7    4    6   25]<br> [   0    0    0   11    0  873    3    1    2    2]<br> [   4    1    0    2    5    4  939    0    3    0]<br> [   0    4   15    4    3    0    0  980    6   16]<br> [   3    2    6    5    3    6    4    4  934    7]<br> [   0    3    0    2    7    4    0    5    1  987]]<br>Classification Report:<br>              precision    recall  f1-score   support<br><br>           0     0.9916    0.9592    0.9751       980<br>           1     0.9892    0.9692    0.9791      1135<br>           2     0.9690    0.9700    0.9695      1032<br>           3     0.9725    0.9802    0.9763      1010<br>           4     0.9731    0.9562    0.9646       982<br>           5     0.9732    0.9787    0.9760       892<br>           6     0.9572    0.9802    0.9685       958<br>           7     0.9703    0.9533    0.9617      1028<br>           8     0.9482    0.9589    0.9535       974<br>           9     0.9391    0.9782    0.9583      1009<br><br>    accuracy                         0.9683     10000<br>   macro avg     0.9683    0.9684    0.9683     10000<br>weighted avg     0.9686    0.9683    0.9683     10000</pre><pre>import matplotlib.pyplot as plt<br>from sklearn.metrics import confusion_matrix, classification_report, roc_curve, auc, precision_recall_fscore_support<br><br># Get the predicted probabilities for each class<br>y_prob = model.predict(x_test)<br><br># Get the predicted class for each sample<br>y_pred = y_prob.argmax(axis=-1)<br><br># Generate a confusion matrix<br>conf_mat = confusion_matrix(y_test, y_pred)<br><br># Generate a classification report<br>class_report = classification_report(y_test, y_pred, digits=4)<br><br># Calculate the ROC curve for each class<br>fpr = dict()<br>tpr = dict()<br>roc_auc = dict()<br>for i in range(10):<br>    fpr[i], tpr[i], _ = roc_curve(y_test == i, y_prob[:, i])<br>    roc_auc[i] = auc(fpr[i], tpr[i])<br><br># Calculate the precision, recall, F1 score for each class<br>precision = dict()<br>recall = dict()<br>f1_score = dict()<br>for i in range(10):<br>    precision[i], recall[i], f1_score[i], _ = precision_recall_fscore_support(y_test == i, y_pred == i, average=&quot;binary&quot;)<br>    precision[i], recall[i], f1_score[i] = precision_recall_fscore_support(y_test == i, y_pred == i, average=&quot;binary&quot;)[:3]<br><br># Plot the metrics<br>plt.figure(figsize=(12, 4))<br>plt.subplot(1, 3, 1)<br>plt.bar(range(10), precision.values())<br>plt.title(&quot;Precision&quot;)<br>plt.xlabel(&quot;Class&quot;)<br>plt.ylabel(&quot;Score&quot;)<br>plt.xticks(range(10))<br>plt.ylim(0, 1)<br>plt.subplot(1, 3, 2)<br>plt.bar(range(10), recall.values())<br>plt.title(&quot;Recall&quot;)<br>plt.xlabel(&quot;Class&quot;)<br>plt.ylabel(&quot;Score&quot;)<br>plt.xticks(range(10))<br>plt.ylim(0, 1)<br>plt.subplot(1, 3, 3)<br>plt.bar(range(10), f1_score.values())<br>plt.title(&quot;F1 Score&quot;)<br>plt.xlabel(&quot;Class&quot;)<br>plt.ylabel(&quot;Score&quot;)<br>plt.xticks(range(10))<br>plt.ylim(0, 1)<br>plt.tight_layout()<br>plt.show()<br><br>plt.figure(figsize=(6, 6))<br>for i in range(10):<br>    plt.plot(fpr[i], tpr[i], label=f&quot;Class {i} (AUC = {roc_auc[i]:.2f})&quot;)<br>plt.title(&quot;ROC Curve&quot;)<br>plt.xlabel(&quot;False Positive Rate&quot;)<br>plt.ylabel(&quot;True Positive Rate&quot;)<br>plt.legend(loc=&quot;best&quot;)<br>plt.show()<br><br>print(&quot;Confusion Matrix:&quot;)<br>print(conf_mat)<br>print(&quot;Classification Report:&quot;)<br>print(class_report)</pre><pre>313/313 [==============================] - 2s 6ms/step</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nK7IzotI_AWVLq6W0dcsGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*LuhRlF8o-gugxgCaetvxfg.png" /></figure><pre>Confusion Matrix:<br>[[ 940    0    3    0    3    1   16    1   12    4]<br> [   0 1100    7    2    1    1    8    1   14    1]<br> [   1    1 1001    2    4    0    4   10    4    5]<br> [   0    0    1  990    0    8    0    4    3    4]<br> [   0    1    0    0  939    0    7    4    6   25]<br> [   0    0    0   11    0  873    3    1    2    2]<br> [   4    1    0    2    5    4  939    0    3    0]<br> [   0    4   15    4    3    0    0  980    6   16]<br> [   3    2    6    5    3    6    4    4  934    7]<br> [   0    3    0    2    7    4    0    5    1  987]]<br>Classification Report:<br>              precision    recall  f1-score   support<br><br>           0     0.9916    0.9592    0.9751       980<br>           1     0.9892    0.9692    0.9791      1135<br>           2     0.9690    0.9700    0.9695      1032<br>           3     0.9725    0.9802    0.9763      1010<br>           4     0.9731    0.9562    0.9646       982<br>           5     0.9732    0.9787    0.9760       892<br>           6     0.9572    0.9802    0.9685       958<br>           7     0.9703    0.9533    0.9617      1028<br>           8     0.9482    0.9589    0.9535       974<br>           9     0.9391    0.9782    0.9583      1009<br><br>    accuracy                         0.9683     10000<br>   macro avg     0.9683    0.9684    0.9683     10000<br>weighted avg     0.9686    0.9683    0.9683     10000</pre><p>This will output two plots:</p><ul><li>A bar chart of precision, recall, and F1 score for each class</li><li>A ROC curve for each class, along with the AUC score</li></ul><p>Note that since we artificially made the MNIST dataset Imbalanced, the performance of the model on each class may vary widely. In practice, it is important to balance the dataset as much as possible to avoid biased results.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba3fc4360c7f" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/image-classification-on-unbalanced-dataset-python-mnist-dataset-ba3fc4360c7f">Image Classification on Imbalanced Dataset #Python #MNIST_dataSet</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How ChatGPT Works?]]></title>
            <link>https://akshit-s7.medium.com/how-chatgpt-works-b36fca8d659b?source=rss-75dd15b8f0c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b36fca8d659b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[chatgpt-chatbot]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[AkShit Singh]]></dc:creator>
            <pubDate>Wed, 05 Apr 2023 07:49:54 GMT</pubDate>
            <atom:updated>2023-04-05T07:49:54.580Z</atom:updated>
            <content:encoded><![CDATA[<p>ChatGPT is a large language model that uses a combination of deep learning, natural language processing (NLP), and machine learning algorithms to generate human-like responses to text-based prompts. Here’s a general overview of how ChatGPT works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e05kWoSvSIYyDOW8" /><figcaption>Photo by <a href="https://unsplash.com/ko/@jupp?utm_source=medium&amp;utm_medium=referral">Jonathan Kemper</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><ol><li>Training: ChatGPT was trained on a large dataset of text-based content using a technique called unsupervised learning. The training data includes a diverse range of content, including books, articles, and web pages, among others.</li><li>Understanding: When you input a prompt or question to ChatGPT, it uses NLP algorithms to analyze and understand the context and meaning of your input. It looks for patterns and similarities between your input and the patterns it learned during its training phase.</li><li>Generating: Once ChatGPT has analyzed and understood your input, it generates a response using machine learning algorithms. It uses a probability distribution to choose the most likely response based on its training data.</li><li>Iterating: If the response generated by ChatGPT isn’t satisfactory, it can use your feedback to improve its next response. This process of iterative learning helps to improve the accuracy and quality of ChatGPT’s responses over time.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A5Q1A8n-uUnP3WiV" /><figcaption>Photo by <a href="https://unsplash.com/ko/@jupp?utm_source=medium&amp;utm_medium=referral">Jonathan Kemper</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Overall, ChatGPT’s ability to understand and generate human-like responses is based on its ability to learn from vast amounts of text-based content and use that learning to generate responses that mimic human language patterns and behavior.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b36fca8d659b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Instagram Knows Our Interest in Reels]]></title>
            <link>https://akshit-s7.medium.com/how-instagram-knows-our-interest-in-reels-ba68884b799?source=rss-75dd15b8f0c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba68884b799</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[instagram]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[AkShit Singh]]></dc:creator>
            <pubDate>Sat, 01 Apr 2023 20:45:12 GMT</pubDate>
            <atom:updated>2023-04-01T20:45:12.937Z</atom:updated>
            <content:encoded><![CDATA[<p>Instagram Reels uses a combination of algorithms and user data to determine your interests and show you content that you may be interested in. Here are a few ways Instagram Reels may be determining your interests:</p><ol><li>Your Activity on Instagram: Instagram Reels analyzes your activity on Instagram, including the accounts you follow, the posts you like, and the hashtags you use, to determine your interests.</li><li>Engagement with Reels: Instagram Reels tracks your engagement with Reels, such as the Reels you watch, the Reels you like, and the Reels you share. Based on this engagement, Instagram Reels will recommend similar Reels to you.</li><li>Profile Information: Instagram Reels also takes into account the information you’ve provided on your Instagram profile, such as your age, gender, and location, to determine your interests.</li><li>Machine Learning Algorithms: Instagram Reels uses machine learning algorithms to analyze and understand the content of the Reels you engage with. The algorithm can recognize patterns in your behavior and adjust your recommendations accordingly.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RnFiF8APkjyJ9qQg" /><figcaption>Photo by <a href="https://unsplash.com/@rswebsols?utm_source=medium&amp;utm_medium=referral">Souvik Banerjee</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Here is more Technology Oriented:</strong></p><p>Instagram Reels uses a combination of machine learning algorithms and data analysis techniques to determine your interests and personalize your Reels recommendations.</p><p>Machine learning algorithms are a type of artificial intelligence that allows computer systems to learn and improve based on data inputs. In the case of Instagram Reels, machine learning algorithms analyze user data, such as the accounts a user follows, their engagement with Reels content, and their profile information, to identify patterns and trends that can be used to predict a user’s interests and preferences.</p><p>Instagram Reels uses a type of machine learning algorithm called a neural network. Neural networks are modeled after the structure and function of the human brain, with layers of interconnected “neurons” that process and analyze data inputs. Neural networks can be trained on large datasets, allowing them to learn and recognize patterns in data, which can then be used to make predictions or classify new data.</p><p>Once Instagram Reels has determined a user’s interests, it uses a recommendation algorithm to show them Reels content that is most likely to engage and interest them. The recommendation algorithm takes into account factors such as the user’s previous engagement with Reels, the popularity of the Reels, and the content of the Reels to determine which Reels to recommend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PoDGwLi5nf7hVNfV" /><figcaption>Photo by <a href="https://unsplash.com/@ilyapavlov?utm_source=medium&amp;utm_medium=referral">Ilya Pavlov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Here are some of the key algorithms that may be used:</strong></p><ol><li>Neural Networks: Instagram Reels uses neural networks to analyze user data and make predictions about what content a user is likely to engage with. Neural networks are a type of artificial intelligence algorithm that can recognize patterns and make predictions based on large datasets.</li><li>Collaborative Filtering: Collaborative filtering is a technique used to make recommendations based on the preferences of similar users. Instagram Reels may use collaborative filtering to recommend Reels content based on the preferences of users with similar interests.</li><li>Natural Language Processing: Natural language processing (NLP) is a branch of artificial intelligence that focuses on analyzing and processing human language. Instagram Reels may use NLP algorithms to analyze the text and captions associated with Reels content to understand the content of the Reel and make recommendations based on user interests.</li><li>Clustering: Clustering is a technique used to group similar items together based on their attributes. Instagram Reels may use clustering algorithms to group Reels content together based on similar attributes such as the content of the video, the hashtags used, or the location where the Reel was created.</li></ol><p>Overall, Instagram Reels likely uses a combination of these algorithms to analyze user data and make personalized recommendations. The specific algorithms used may vary depending on the type of data being analyzed and the goals of the recommendation system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba68884b799" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anomaly Detection using PyOD Library in Python.]]></title>
            <link>https://akshit-s7.medium.com/anomaly-detection-using-pyod-library-in-python-c3ebdf50f3c?source=rss-75dd15b8f0c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3ebdf50f3c</guid>
            <category><![CDATA[knn-algorithm]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[anomaly-detection]]></category>
            <category><![CDATA[pyod]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[AkShit Singh]]></dc:creator>
            <pubDate>Sat, 01 Apr 2023 20:23:43 GMT</pubDate>
            <atom:updated>2023-04-01T20:23:43.692Z</atom:updated>
            <content:encoded><![CDATA[<p>Anomaly detection is a technique used to identify rare or unusual events or patterns in data that deviate significantly from normal behavior. It is commonly used in various domains such as finance, cybersecurity, and industrial quality control. Python is a popular programming language for data science, and there are several libraries available that can be used for anomaly detection. In this answer, we will explore how to perform anomaly detection using the PyOD library in Python.</p><p>The PyOD library is a comprehensive library for detecting outliers and anomalies in data. It provides various algorithms and techniques for identifying anomalous data points. Here is an example of how to use PyOD to perform anomaly detection:</p><pre># Importing required libraries<br>import numpy as np<br>import matplotlib.pyplot as plt<br>from pyod.models.knn import KNN   # Importing KNN algorithm from PyOD<br><br># Creating a dataset with normal and anomalous data<br>X_train = np.array([[0.5, 0.5], [0.2, 0.1], [0.3, 0.2], [0.4, 0.4], [0.8, 0.8], [0.7, 0.9], [0.9, 0.7], [0.6, 0.8]])<br>X_test = np.array([[0.25, 0.25], [0.6, 0.6], [1.0, 1.0]])<br><br># Creating and training a KNN model on the training data<br>clf = KNN(contamination=0.2)   # Setting the percentage of contamination to 20%<br>clf.fit(X_train)<br><br># Predicting the labels for the test data<br>y_pred = clf.predict(X_test)<br><br># Visualizing the data points and their predicted labels<br>plt.scatter(X_train[:, 0], X_train[:, 1], c=&#39;blue&#39;, label=&#39;Normal&#39;)<br>plt.scatter(X_test[:, 0], X_test[:, 1], c=&#39;red&#39;, label=&#39;Anomaly&#39;)<br>plt.legend()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*BaRmMm4bWVIOxuGz2njsxw.png" /><figcaption>Output of the above code</figcaption></figure><p>In this example, we first import the required libraries, including PyOD and NumPy for data manipulation and Matplotlib for data visualization. We then create a dataset with normal and anomalous data points. In this case, we have eight normal data points and three anomalous data points.</p><p>We then create a KNN model using PyOD’s KNN algorithm and set the contamination parameter to 20%, which means that we expect 20% of the data to be anomalous. We fit the model on the training data and predict the labels for the test data using the <strong>‘predict</strong>’ method.</p><p>Finally, we visualize the data points and their predicted labels using Matplotlib. The normal data points are shown in blue, and the anomalous data points are shown in red.</p><p>The output of this code will be a plot that shows the data points and their predicted labels. In this example, the two data points in the lower left and upper right corners are identified as anomalous by the KNN model.</p><p>PyOD provides several other algorithms and techniques for anomaly detection, including isolation forest, local outlier factor, and autoencoder. These algorithms can be used for different types of data and applications.</p><p>In conclusion, PyOD is a comprehensive library for detecting anomalies in data in Python. By using PyOD, we can easily apply various algorithms and techniques for anomaly detection to our data and identify rare or unusual events or patterns that may be indicative of anomalous behavior.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3ebdf50f3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Massive AI Works?]]></title>
            <link>https://akshit-s7.medium.com/how-massive-ai-works-4afadcf44e8a?source=rss-75dd15b8f0c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4afadcf44e8a</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[AkShit Singh]]></dc:creator>
            <pubDate>Sat, 01 Apr 2023 20:12:52 GMT</pubDate>
            <atom:updated>2023-04-01T20:12:52.382Z</atom:updated>
            <content:encoded><![CDATA[<p>Artificial Intelligence (AI) refers to the simulation of human intelligence in machines that are programmed to think and learn like humans. AI systems are becoming increasingly complex, and their size, complexity, and computational requirements are growing rapidly. This has given rise to the term “massive AI,” which refers to AI systems that are exceptionally large and complex, and require significant computational power to function effectively.</p><p>Massive AI systems are typically created using machine learning techniques that involve training an algorithm on vast amounts of data. The algorithm learns from the data and becomes increasingly accurate over time. The more data that is fed into the system, the more accurate it becomes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SPP-Fj50ULT-VPSM" /><figcaption>Photo by <a href="https://unsplash.com/@czapp_arpad?utm_source=medium&amp;utm_medium=referral">Árpád Czapp</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The training process for massive AI systems is highly computationally intensive, and requires large amounts of storage, processing power, and memory. To handle these requirements, massive AI systems are typically run on high-performance computing platforms that can handle the massive data sets and computational requirements.</p><p>One of the most popular approaches to building massive AI systems is through the use of deep learning. Deep learning is a subfield of machine learning that involves the use of artificial neural networks (ANNs) to model complex patterns in data. ANNs are modeled after the structure of the human brain and are composed of layers of interconnected nodes that process information in a hierarchical manner.</p><p>The layers of the ANN are responsible for different types of processing, such as feature extraction, pattern recognition, and classification. The training process for a deep learning model involves adjusting the weights and biases of the nodes in the network to minimize the difference between the predicted output and the actual output.</p><p>Another approach to building massive AI systems is through the use of reinforcement learning. Reinforcement learning is a type of machine learning that involves training an agent to take actions that maximize a reward signal. The agent learns through trial and error, and the goal is to maximize the total reward over time.</p><p>Reinforcement learning is particularly useful for applications such as robotics, where the agent must learn to navigate a complex environment and interact with objects in the environment. In these applications, the massive AI system must be able to process large amounts of sensory input, such as visual data from cameras and touch sensors.</p><p>The development of massive AI systems has been driven by the increasing availability of large data sets, advancements in machine learning algorithms, and the availability of high-performance computing platforms. These systems are being used in a wide range of applications, including image and speech recognition, natural language processing, robotics, and self-driving cars.</p><p>One of the key challenges associated with massive AI systems is their interpretability. As these systems become more complex, it becomes increasingly difficult to understand how they are making decisions. This is particularly problematic in applications such as healthcare and finance, where decisions made by AI systems can have significant consequences.</p><p>To address this challenge, researchers are developing new approaches to making AI systems more transparent and interpretable. One approach is to use explainable AI (XAI) techniques to generate explanations for the decisions made by the system. XAI techniques can help to build trust in AI systems and enable humans to better understand and interact with them.</p><p>In conclusion, massive AI systems are becoming increasingly prevalent in a wide range of applications, and are being driven by advancements in machine learning algorithms and high-performance computing platforms. These systems are highly complex and require significant computational power to function effectively. The development of these systems is being driven by the availability of large data sets, and their use is likely to continue to grow in the future. However, the challenge of interpretability remains a significant hurdle, and new approaches to making AI systems more transparent and interpretable are needed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4afadcf44e8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>