Questions tagged [machine-learning]
Machine learning provides computer algorithms that automatically discover patterns in data and make intelligent decisions from them.
249
questions
0
votes
0
answers
73
views
Keras Tuner Subclass for Time Series Cross-Validation
Custom Keras Tuner with Time Series Cross-Validation
I have written my own subclass of the default Keras tuner Tune class.
Objective: I needed a way to incorporate ...
1
vote
0
answers
71
views
Convolutional Neural Network (CNN) in Julia
I wrote an n-dimensional convolutional neural network from scratch in Julia (check out the GitLab repo or the GitHub repo). It implements the following layer types:
...
0
votes
0
answers
18
views
Efficiently computing a batch of results given a batch assignment vector and series of corresponding matrices
I have a 1D tensor of tokens that belong to different batches. The batch sizes here are uneven. Each batch needs to be multiplied with a corresponding weight matrix. My current approach is using a ...
0
votes
0
answers
27
views
convolutional neural network in python
I am new to python, so the challenges for me currently are:
Clear, simple code, trying to follow standard practices
Useful comments,
Use types (for better understanding of input/output relationships.)...
-2
votes
1
answer
137
views
Design an algorithm to predict words based on a skeleton from a given dictionary
The model I'm building first selects a secret word at random from a list. The model which uses an API then returns a row of underscores (space separated)—one for each letter in the secret word—and ...
1
vote
0
answers
43
views
Recurrent Neural Network loss is NAN
I am training a neural network to use approximately 600 features (4103rd to last column of a df) to predict approximately 4000 values (7th to 4102nd column of the same df). I have standardized the ...
2
votes
1
answer
96
views
Movie genre classification using machine learning
could you review my below code to train a machine learning model to classify movie genres? I've used the data from Kaggle
...
7
votes
1
answer
659
views
Remove hot-spots from picture without touching edges
In the picture below there are some regions which are very bright (i.e. more white). Some bright regions are wide and some are narrow or thin. The red box covers one such wide bright spot, and blue ...
2
votes
1
answer
126
views
ANN with Backpropagation for MINST data set
I am learning about ANN and tried it for the MINST data sets. Now I am supposted to create a neural network (ANN) with backpropagation.
The structure for the neural network I have is this the input ...
1
vote
0
answers
93
views
Train a Keras model to recognize and predict speech in real-time using microphone as audio source
Please help me optimize this script. I'm running it in Google Colab GPU runtime. I've implemented many optimizations but they worsened it. I need serious help. I have to submit my project in 3 days!. ...
1
vote
1
answer
57
views
Optimize an algorithm for preparing a dataset for machine learning
I'm learning how to use R coming from a python background. I'm following Andrej Karpathy's zero-to-hero course, reimplementing it in R.
We start with a list of 32033 names. These names have to be ...
1
vote
0
answers
560
views
Object detection YOLO v1 loss function implementation with Python 3 and TensorFlow 2.x
About the code
Object detection YOLO v1 loss function implementation with Python + TensorFlow 2.x. It based on the Pytorch implementations below and re-implemented with TensorFlow based on my ...
1
vote
0
answers
49
views
Improving AI model for categorical outcome predictions
I am a novice and would appreciate some guidance. I have been trying to create a machine learning code that will correlatate 10+ binary variable and maybe a couple continuous variables to a binary ( ...
2
votes
0
answers
78
views
neural network that determines the gender of a word
I wrote a neural network in python using pytorch, which determines the gender of a word in Russian. As a training set: a file containing a word and a number from 0 to 2 (0-masculine,1- feminine and 2-...
0
votes
0
answers
88
views
How to efficiently store and compute forecasting curves?
Let PD be a Plane/Date couple. For each PD, I would like to predict the forecasted booking curve, i.e. the cumuled amount of bookings registered each day between X days before departure and departure. ...
1
vote
1
answer
124
views
Plotting correlation matrix with Seaborn and pandas
I try to plot the correlation matrix of a Pandas DataFrame. As the diagonal elements are always ones, and the matrix is symmetrical, so I can get rid of most than a half of the squares without loosing ...
1
vote
0
answers
31
views
Machine learning: user-based collaborative filtering
Task:
What to fix in the class, just as a beginner it's hard for me to understand where I messed up?
Code:
Model:
...
5
votes
1
answer
1k
views
Remove background from a directory of JPEG images
I wrote a code to remove the background of 8000 images but that whole code is taking approximately 8 hours to give the result.
How to improve its time complexity? As I have to work on a larger dataset ...
1
vote
0
answers
42
views
Implementation of K-Neighbor Algorithm in Python
I would like to get some feedback of my K-Neighbors Implementation using Abalone Dataset and cross-fold validation.
How can I make it more efficient? (No sklearn library allowed)
Where do you see any ...
1
vote
1
answer
98
views
Decision Tree for classification tasks in Python
I've decided to implement the ID3 Decision Tree algorithm in Python based on what I've learned from George F. Luger's textbook on AI (and other secondary readings). As far as I know, the code is ...
1
vote
0
answers
28
views
RESNET machine learning code with TensorFlow
I am a PhD student working on a machine learning project with binary classification and RESNET architecture in TensorFlow. I believe I have done everything correctly but I am looking for some ...
2
votes
0
answers
59
views
CodeReview: CycleGAN Implementation Using Keras FunctionalAPI
Okay So I Am Here Implementing the cyclegan architecture with using keras api
from scratch.
For Those who Wanna Know More About Cyclegan seehere
The CycleGan Compose of Two Phase Architecture Like ...
1
vote
0
answers
99
views
Logistic Regression on Titanic Dataset - Sklearn
The goal of my program is to calculate the chances of a person to survive during Titanic accident, after receiving information such as person's age, class, sex, etc. There's a dataset full of ...
1
vote
1
answer
69
views
Linear Regression in Scikit_learn
I have 2 datasets (one for training and the other for testing) containing information about days temperature and humidity; My programm should process the training dataset and find a relation between ...
3
votes
1
answer
180
views
Machine Learning Loss Functions In C++
I was looking for C++ versions of the machine learning metrics implemented in Python's sklearn, but they were surprisingly hard to find. I came across a website that had most of the loss functions ...
1
vote
0
answers
123
views
Binary classification with pytorch
I wrote a simple neural network binary classification algorithm using Pytorch. It uses the dataset from https://www.kaggle.com/pritsheta/heart-attack, which consists of a table with 300 rows and 14 ...
3
votes
1
answer
108
views
libsvm++ : Rewritten libsvm in newer C++
The most famous library for Support Vector Machine (SVM) algorithm is libsvm (https://github.com/cjlin1/libsvm/), but I felt that its code style is too old, I rewrote in newer C++ as a hobby project.
...
4
votes
2
answers
927
views
C++: Linear Regression and Polynomial Regression
I wrote a simple linear/polynomial regressor based on my previous matrix project (https://github.com/frozenca/Ndim-Matrix).
...
2
votes
1
answer
171
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 ...
4
votes
1
answer
76
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 ...
2
votes
0
answers
120
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
...
2
votes
0
answers
65
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
0
answers
42
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
1
answer
93
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
...
2
votes
0
answers
53
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:
...
2
votes
2
answers
81
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
3
answers
733
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
0
answers
32
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
1
answer
114
views
a prototype of finding the (almost) best learning rate and initial weights so that a perceptron converges with the minimal iteration
First of all, I chose the nearest data points/training examples
...
2
votes
1
answer
69
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
1
answer
53
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.
...
7
votes
1
answer
90
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 ...
0
votes
0
answers
63
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
4
answers
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
0
answers
32
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
1
answer
302
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
0
answers
71
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 ...
0
votes
2
answers
56
views
Machine Learning Program
I've written a program that finds the difference between data and gives output.
Here's the code:
...
1
vote
0
answers
947
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
2
answers
373
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 ...