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

learn more… | top users | synonyms

3
votes
0answers
79 views

Python Perceptron

This is my finished perceptron written in python. Is there anything that I can improve/suggestions? I'm a beginner with python so anything would be helpful! ...
3
votes
1answer
30 views

Multiword Expression Tagging in Python

I am trying to write a small python code,where I am reading a text file-which contains both Multiwords (MWEs) and singular words (NMWEs). I am trying to tag each one, as follows. I have a ...
3
votes
0answers
101 views

Implementing the stochastic gradient descent algorithm of the softmax regression with only NumPy

I am implementing the stochastic gradient descent algorithm. I think there is plenty of room for improvement. ...
1
vote
0answers
63 views

Implementation of a KNN in OCaml

I wrote the following implementation of the k-nearest neighbor algorithm (for a binary classification task). I am not familiar with OCaml's built in functions, I have the feeling that some of them ...
3
votes
1answer
74 views

Multivariable Gradient Descent in Numpy

Just recently started learning ML, first I've gone through the notes of Ng's Coursera stuff. While I have nothing against Octave, I'm trying to solve exercises in Python. It's my beginning with that ...
0
votes
0answers
34 views

Sentences Clustering - Affinity Propagation & Cosine Similarity - Python & SciKit

I am looking for advices regarding my code. I am interested about the correctness, legibility and minimality of the solution. ...
2
votes
0answers
49 views

Traning and testing of sentiment analysis

Here is my code which takes two files of positive and negative comments and creates a training and testing set for sentiment analysis using nltk, sklearn, Python and statistical algorithms. The ...
1
vote
2answers
144 views

Decision tree node split by Gini coefficient (used in RandomFerns/RandomForest algorithm)

I am implementing the Random Ferns Algorithm for Classification. For simplicity, let's imagine a single decision tree with only a single node. As input we have a feature and the label of each dataset. ...
3
votes
0answers
63 views

Classifying test data into several classes

The following code is to classify the test data into several classes: ...
2
votes
1answer
74 views

Parzen Window Density Estimation in C#

Is my implementation correct (it is matching this result)? How can I improve this code? ...
1
vote
0answers
56 views

Linear SVM(in R) giving suspiciously high CV accuracy

Here is my code that reads a text dataset, featurizes the text column and then does CV using Linear SVM. Could I be leaking labels from somewhere as the accuracy I get is suspiciously high and way ...
15
votes
0answers
299 views

Backpropagation in simple Neural Network

I've been working on a simple neural network implemented in python. Currently, it seems to be learning, but unfortunately it doesn't seem to be learning effectively. The graph below shows the output ...
1
vote
1answer
139 views

Naive Bayes Classifier in C#

The following is my implementation of Naive Bayes Classifier. https://github.com/edurazee/NaiveBayesClassifier I took the source code from here and tried to simplify it. How can I simplify my code ...
3
votes
0answers
68 views

Naive implementation of Naive Bayes in Haskell

A simple implementation of Naive Bayes, as I'm a Haskell beginner I've tried to put an emphasis on clarity and documentation. I've tried to incorporate the feedback from a similar question. This is ...
0
votes
0answers
15 views

Sending the accuracies of 4 cross-validations to a pandas dataframe

I want to improve my code. It performs 4 cross-validations: 10x20, 10x10, 10x5 10x2. Then it stores the values in Pandas where I will get the average of each column and multiply them by 100. You ...
4
votes
0answers
45 views

sk-learn like model

I am trying to make a simple model that returns the conditional expectation of a target with respect to the value observed for another variable. Basically, given a feature \$F\$, a level of this ...
3
votes
1answer
120 views

ROC and AUC calculation

Using Python 2.7 and here is my code to calculate ROC/AUC and I compare my results of tpr/fpr with threshold, it is the same result of whay scikit-learn returns. My questions, (1) any ideas for ...
1
vote
1answer
59 views

Streaming learning OCaml

I wrote a simple online logistic regression, calibrated using gradient descent to compare the speed of an OCaml implementation vs the same Python script, executed with Pypy. It turned out that the ...
3
votes
1answer
66 views

A simple fully connected ANN module

I've written a simple module that creates a fully connected neural network of any size. The arguments of the train function are list of tuples with a training example array first and an array ...
3
votes
1answer
23 views

Efficient implementation of aggregating test/train data

Here is a short python snippet to ingest train data: ...
2
votes
1answer
47 views

Multi or n-armed bandit reinforcement learning in R

I am learning about reinforcement learning and came across the first and simplest form of reinforcement learning system called multi-armed reinforcement learning (also called as n-armed bandit). I ...
1
vote
1answer
299 views

Using pandas and sklearn for forecasting stock market return

I have been using R for stock analysis and machine learning purpose but read somewhere that python is lot faster than R, so I am trying to learn Python for that. I am using Yhat's rodeo IDE (Python ...
3
votes
1answer
191 views

Clustering 16 million records in parallel

I have a dataset with 16 million rows and may increase upwards of 30 million. I am using the parLapply to run across three cores in R. But it's taking two days to ...
5
votes
1answer
450 views

Apriori algorithm in Python 2

This takes in a dataset, the minimum support and the minimum confidence values as its options, and returns the association rules. I'm looking for pointers towards better optimization, documentation ...
6
votes
1answer
159 views

Similarity research : K-Nearest Neighbour(KNN) using a linear regression to determine the weights

I have a set of houses with categorical and numerical data. Later I will have a new house and my goal will be to find the 20 closest houses. The code is working fine, and the result are not so bad but ...
1
vote
1answer
146 views

Entity resolution with NLTK

I am trying to write a script of Python code, for entity extraction and resolution. The excerpts of the algorithm: It is trying to extract the entity as PoS Tag with Hidden Markov Model(HMM). After ...
6
votes
1answer
112 views

Random forest and machine learning

I am quite new to using python for machine learning. I come from a background of programming in Fortran, so as you may imagine, python is quite a leap. I work in chemistry and have become involved in ...
7
votes
1answer
239 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 ...
1
vote
1answer
233 views

Pattern recognition and machine learning - Bernoulli mixture model

I have been reading the book Pattern Recognition and Machine Learning (Bishop) for a while, and recently I came across this figure, which was created using Bernoulli mixture model on the MNIST dataset:...
3
votes
1answer
391 views

Different neural network activation functions and gradient descent

I've implemented a bunch of activation functions for neural networks, and I just want have validation that they work correctly mathematically. I implemented sigmoid, tanh, relu, arctan, step function, ...
1
vote
0answers
50 views

Self organizing maps

I have already asked similar question here, but I figured this place might be better on getting some actual implementation feedback. I tried to implement a simple SOM. You can see the training ...
5
votes
1answer
1k views

k-means clustering algorithm implementation

Here is my personal implementation of the clustering k-means algorithm. ...
5
votes
1answer
101 views

Classification tree in Swift

As an effort to teach myself Swift as well as to get familiar with machine learning algorithms, I've been trying to implement common algorithms, starting with a Random Forest. This is, for the moment ...
11
votes
1answer
300 views

Make a summary from a larger text-file

This code makes summaries from larger texts. I have searched around for an algorithm and found the following: Associate words with their grammatical counterparts. (e.g. "city" and "cities") ...
2
votes
1answer
71 views

Nested loops - Random Forest, multiple parameters

I'm writing a code which task is to grow Random Forest trees based on multiple parameters. In short: Firstly, I declare a data frame in which model parameters and some stats will be saved. Secondly, ...
0
votes
1answer
250 views

csv loader and kNN algorithm in Java

I have applied the KNN algorithm for classifying handwritten digits. the digits are in vector format initially 8*8, and stretched to form a vector 1*64.. As it stands my code applies the kNN ...
1
vote
1answer
64 views

SKlearn automate data pre treatment

I want to make a simple wrapper for sklearn models. The idea is that the wrapper automatically takes care of factors (columns of type "object") replacing them with ...
2
votes
1answer
147 views

ImprSimple chat bot written in python

I'd like to know if I can improve the performance of my recent bot, and maybe some design patterns too. So far, it's warning a user if it's using some bad words (which are parsed from ...
0
votes
0answers
40 views

Naive-Bayes classifier, to be packaged in a function

I need to create a Naive-Bayes classifier. I have eight labels (S) stored in tumors object, and 20531 attributes (A), I have stored the P(S,A) in objects of name <...
4
votes
2answers
287 views

Tic-Tac-Toe machine learning

I recently started getting into machine learning and I wanted to write a "beginner program" which would learn to play Tic Tac Toe. This code was inspired by a different program I saw, meaning some ...
1
vote
0answers
152 views

Increase performance of Spark-job Collaborative Recommendation.

This is my first Spark Application. I am using "ALS.train" for training the model - Model Factorization. The total time that the Application takes is approx 45 mins. Note: I think takeOrdered is the ...
1
vote
0answers
94 views

Predicting a win/loss given prior game stats

The project: create a model that can (somewhat) accurately predict a win/loss given prior game stats. Wanted a review of code in general, in particular my use of the ...
4
votes
0answers
236 views

RandomForest multi-class classification

Below is the code I have for a RandomForest multiclass-classification model. I am reading from a CSV file and doing various transformations as seen in the code. I ...
3
votes
0answers
138 views

Logistic regression with eigen

I am a new to Eigen, and I implemented a logistic regression model with it. It works but I don't know whether it is implemented in an efficient way. ...
2
votes
1answer
465 views

Cross validation of gradient boosting machines

I am fairly new to Python. I implemented a short cross-validation tool for gradient boosting methods. ...
6
votes
1answer
810 views

Calculate conditional probabilities and perform naive Bayes classification on a given data set

I wrote a class that I'm using to calculate conditional probabilities of a given distribution as well as perform naive Bayes classification. I'd like to get a code review done to tell me if there is ...
3
votes
1answer
146 views

File-write operations

Below is the code for user recommendations using mahout. ...
1
vote
1answer
230 views

Latent Dirichlet Allocation in Python

I've recently finished writing a "simple-as-possible" LDA code in Python. The theory from which I've developed my code can be found in the book Computer Vision by Simon Prince, free (courtesy of ...
3
votes
1answer
7k views

ID3 Decision Tree in python

I've been working my way through Pedro Domingos' machine learning course videos (although the course is not currently active). His first homework assignment starts with coding up a decision tree (ID3)....
3
votes
2answers
51 views

Asynchronous model fitting that allows termination in Python

The problem When you work with Python interactively (e.g. in an IPython shell or notebook) and run a computationally intensive operation like fitting a machine-learning model that is implemented in a ...