Questions tagged [machine-learning]

Machine learning provides computer algorithms that automatically discover patterns in data and make intelligent decisions from them.

Filter by
Sorted by
Tagged with
2
votes
1answer
48 views

Generating a matrix with each row having normalized weights

I just asked this question over Stack Over Flow on how to improve my code and reposting it here as someone on Stack Overflow recommended this platform. I have written two python functions and they are ...
2
votes
0answers
27 views

Unsupervised competitive learning algorithm from scratch in javascript

I'm a mathematician who is new to programming and I'm currently reading the book "Theory of Neural Networks" by Rojas. To become better, I try to program every algorithm that is described in ...
0
votes
0answers
26 views

To scale or not to scale in regression and classification algorithms

I'm a new DS student, and I get the basic concept of Standardisation, whilst I was learning we used StandardScaler in some algorithms, and not in others on the same dataset, and I'm still confused as ...
2
votes
0answers
41 views

xagents - implementations of reinforcement learning algorithms

Description It is valid to say, this work started and evolved from a standalone DQN implementation, which I included in an old question, to a mini-library xagents, housing 7 re-usable tensorflow-based ...
1
vote
0answers
46 views

Logistic Regression for Fashion MNIST T-shirt vs. Shirt

I wrote a Logistic Regression for Fashion MNIST to classify T-shirt vs. Shirt. here is the class ...
0
votes
0answers
35 views

Implement the XOR Gate using a 2-layer neural net with just Python & NumPy

I wrote a 2-layer neural net with just Python & NumPy to implement the XOR Gate, here is the code ...
0
votes
1answer
27 views

Logistic Regression for non linearly separable data

Iris Data Set consists of three classes in which versicolor and virginica are not linearly separable from each other. I constructed a subset for these two classes, here is the code ...
1
vote
0answers
36 views

The best tensorflow neural net I got so far for iris dataset

Compared to my another post Logistic Regression for non linearly separable data which uses one-layer net, i.e. Logistic Regression to classify the iris data set, this post is to discuss the tensorflow ...
0
votes
0answers
57 views

Logistic Regression for MNIST binary classification

I wrote a Logistic Regression model that classifies MNIST digits. I used tensorflow & keras only for import the dataset. ...
0
votes
0answers
5 views

Ratio of intra-class scatter by inter-class scatter is getting minimised by linear discrimination process

This question is complicated (at least for me who is new in machine learning and image processing). I need help in understanding, why my iterative process is minimising the ratio of inter-class ...
2
votes
0answers
19 views

DQN implementation

I just wrote my pong DQN. It seems to work. I'm looking for a performance based review on anything that might slow down the training in complex models. main.py: ...
0
votes
0answers
17 views

Predicting with multiple independent hot-encoded variables

My attempt at multiple linear regression. I am trying to make a qualified guess about a user's rating of a movie, through machine learning. I am new to this, so my judgement isn't the best. And I am ...
2
votes
2answers
69 views

Updated version of my first neural network in c++

I got lot of suggestions for optimizing my neural network last post I made, now I wanted to post updated version of it were I got rid of most of performance eaters, now I would really appriciate ...
8
votes
3answers
688 views

My first functional naive neural network in C++

I just wrote my first standard neural network with SGD gradient descent in c++, I am really interested if I have done anything wrong or inefficient, suggestions would help me a ton (There is lots of ...
0
votes
0answers
20 views

Logistic regression using Sklearn in Python

I'm trying to learn how to use logistic regression with Sklearn. After learning the theory, I tried implementing it using the Heart Attack Analysis datasheet from Kaggle. Here's a snippet of the data: ...
2
votes
1answer
63 views

A simple clusterness measure of data in one dimension using Java - follow-up 2

(See the previous version here.) This time, I have encorporated all the suggestions made by Marc. Also, I changed the type of points from Double to ...
1
vote
1answer
47 views

A simple clusterness measure of data in one dimension using Java - follow-up

(See the previous version here.) (See the next version here.) This time, I have incorporated all the suggestions made by Roman; my new version follows. ...
1
vote
1answer
90 views

A simple clusterness measure of data in one dimension using Java

(See the next follow-up here.) Problem definition Given \$X = (x_1, \dots, x_n)\$ such that \$x_1 \leq x_2 \leq \dots \leq x_n \$. Let \$x_{\min} = \min X = x_1\$, \$x_{\max} = \max X = x_n\$ and \$r =...
7
votes
1answer
63 views

Optimize K-Mean for large number of clusters

I am writing a Python code for KMeans clustering. The aim of this post is to find out how I can make my below mentioned code optimal when the number of clusters is very large. I am dealing with data ...
1
vote
0answers
125 views

Model Pipeline to run multiple Classifiers for ML Classification

As a general rule of thumb, it is required to run baseline models on the dataset. I know H2O- AutoML and other AutoML packages do this. But I want to try using Scikit-learn Pipeline, Here is what I ...
0
votes
0answers
31 views

Keras: Using Autoencoders for prediction

I have a dataset which I divided into two sections horizontally. Column A of first section is the input variable and Column A of second section is the target variable. I am trying to build a Denoising ...
9
votes
4answers
2k views

C++20 : Simple Softmax classifier for MNIST dataset

I wrote a simple softmax classifier to classify MNIST digit handwriting data set. Feel free to comment anything! ...
0
votes
0answers
20 views

Stacking Classifier Implementation

I was going through the book Hands on Machine Learning With Scikit-Learn & Tensorflow. In one of the chapters, the author mentioned ...
3
votes
1answer
94 views

Pandas replace rare values in a pipeline

A common preprocessing in machine learning consists in replacing rare values in the data by a label stating "rare". So that subsequent learning algorithms will not try to generalize a value ...
1
vote
0answers
46 views

validation and test loss for a variety of PyTorch time series forecasting models

Hi everyone I'm trying to reduce the complexity of some of my Python code. The function below aims to compute the validation and test loss for a variety of PyTorch time series forecasting models. I ...
11
votes
1answer
3k views

A CNN in Python WITHOUT frameworks

Here's some code that I've written for implementing a Convolutional Neural Network for recognising handwritten digits from the MNIST dataset over the last two days (after a lot of research into ...
0
votes
2answers
44 views

Machine Learning Program

I've written a program that finds the difference between data and gives output. Here's the code: ...
0
votes
2answers
191 views

Multithreaded implementation of K-means clustering algorithm in Java

Hello I have written a multi-threaded implementation of the K-means clustering algorithm. The main goals are correctness and scalable performance on multi-core CPUs. I expect to code to not have race ...
2
votes
0answers
42 views

Looping over files to create a dataframe

As part of my NLP project at work, I want to loop over all files that are either PDF of docx in the same directory. The end purpose is to create a dataframe with text content of the files in one ...
2
votes
0answers
34 views

Optimize binary classification model

I've created binary classification model from scratch, just to understand intuition behind that. However when I compare my implementation to model from tensorflow/pytorch with the same parameters and ...
1
vote
0answers
21 views

Industrial Practices for Time-Series Forecasting

Hi I have wrote a code here for predicting temperature across months. This is the dataset that I was using: https://www.kaggle.com/sumanthvrao/daily-climate-time-series-data I have used a SARIMA model ...
0
votes
0answers
255 views

Convert JPG to H5 and plot the images

I'm learning ML/DL and found the process of getting the data and labels quite tedious. There is not much details on how to get JPG files into H5, which is (afaik) the only way to work smoothly later ...
2
votes
1answer
84 views

Calculation of the Distance Matrix in the K-Means Algorithm in MATLAB

Purpose of the code : To assign the corresponding label of the centroids to the points which are close to it. Below is a graphical (2D) example. Variable X is a matrix, rows represent the points, ...
3
votes
0answers
22 views

Transfer learning CNNs for image classification in TensorFlow

This code works, and I'm pretty sure it's mathematically/algorithmically correct: ...
2
votes
0answers
17 views

Implementation of Policy Gradient Reward Design paper

I've implemented the first experiment from the Reward Design via Online Gradient Ascent paper. I don't have any specific concerns, but it's my first time using multiprocessing or doing reinforcement ...
3
votes
0answers
309 views

Playing pong (atari game) using a DQN agent

I trained a DQN agent using tensorflow and OpenAI gym Atari environment called PongNoFrameskip-v4, but this code should be compatible with any ...
4
votes
0answers
70 views

Using VAE for reconstructing images

Article: https://arxiv.org/pdf/2009.07047v1.pdf Full Code: https://colab.research.google.com/drive/1KZZuIa7Lk13ImZLJ3b-kxMfcveOPaWvN#scrollTo=XhdMfBFtzaEH Dataset: https://drive.google.com/file/d/...
1
vote
0answers
69 views

Implementing Convolutional Neural Network

Context I was making a Convolutional Neural Network from scratch in Python. I completed making it .... It works fine ... The only thing is that it takes a lot of time as the size of the input grows. ...
4
votes
2answers
178 views

C++ performance: Linear regression in other way

Here is the code that can be used for calculation of mathematical function, like ax^2 + bx + c. It is fast enough if you choose small length, otherwise if ...
1
vote
0answers
50 views

How to handle overfitting in Random Forest

I have a random forest model I built to predict if NFL teams will score more combined points than the line Vegas has set. The features I use are Total - the total ...
2
votes
1answer
102 views

A Tiny Nearest Neighbor Classification Implementation in C#

I am practicing to implement the KNN classification tool in C#. The basic point structure is constructed by the class Point, and there are two members in ...
2
votes
0answers
25 views

Data Visualization (rendering env)

How can I improve this code? It renders a ML env with openAI gym and matplotlib. I am new to coding so not sure if my variables or format or any lines can be improved. ...
10
votes
2answers
278 views

Convert an English sentence to German using Bahdanau Attention

Context I am following this tutorial . My mission is to convert an English sentence to a German sentence using Bahdanau Attention. Summary of the Code I first took the whole English and German ...
1
vote
0answers
53 views

How to speed up this numba based decision tree?

In order to improve the performance of this code fragment, I have speeded up some code fragments by using the numba. However, a frustrating thing is that the performance of this decision tree is bad. ...
10
votes
1answer
298 views

K-means function in Python

I have written a k-means function in Python to understand the methodology. I am trying to use this on a more complex dataset with a larger value for k, but it is running super slow. Does anyone have ...
81
votes
1answer
4k views

Siamese neural network

I have been studying the architecture of the Siamese neural network introduced by Yann LeCun and his colleagues in 1994 for the recognition of signatures ("Signature verification using a Siamese ...
4
votes
0answers
164 views

A Very Simple Support Vector Machine with SMO Algorithm Implementation

Context. I was looking for some simple implementation of SVM with the SMO algorithm that can be used as an in-class problem together with a simple mathematical explanation of how it works. The problem ...
1
vote
0answers
25 views

Machine Learning Implementation when dealing with high variance data

I'm am trying to classify MLB (Baseball) games whose score go over the total based on the total and the number of people who have bet the over. The total is a number set by Vegas and a bettor can ...
6
votes
1answer
776 views

Simple neural network in c++

I have implemented a neural network in C++. But I'm not sure whether my implementation is correct or not. My code of the implementation of neural networks given bellow. As an inexperienced programmer, ...

1
2 3 4 5