Skip to content

Instantly share code, notes, and snippets.

View Aphellirus's full-sized avatar
👽
May the forks be with you

Matheus Moreira Aphellirus

👽
May the forks be with you
View GitHub Profile
#Convolutional neural network to process images of dogs and cats
from keras.models import Sequential
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
from keras.preprocessing.image import ImageDataGenerator
classifier = Sequential()
@Aphellirus
Aphellirus / artificial_neural_network.py
Created March 15, 2021 19:25
Artificial neural network that will predict based on a structured data
import pandas as pd
dataset = pd.read_csv("Churn_Modelling.csv")
X = dataset.iloc[:, 3:13].values
y = dataset.iloc[:, 13].values
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.compose import make_column_transformer
LabelEncoder_X_1 = LabelEncoder()
@Aphellirus
Aphellirus / google_stock_data_prediction.py
Last active March 29, 2021 23:12
Recurrent neural network to predict stock exchange data
# recurrent neural network to predict stock exchange data
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset_train = pd.read_csv('Download/Google_Stock_Price_Train.csv')
dataset_test = pd.read_csv('Download/Google_Stock_Price_Test.csv')
training_set = dataset_train.iloc[:,1:2].values
@Aphellirus
Aphellirus / self_organizing_maps.py
Last active July 19, 2021 22:50
Self Organizing Maps to detect frauds in credit card applications
#Self Organizing Maps to detect frauds in credit card applications
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv('Credit_Card_Applications.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:,-1].values
@Aphellirus
Aphellirus / handling_csv.r
Created July 19, 2021 22:49
Handling CSV with R
# Write csv in R
df <- data.frame(name = c("Jon", "Winston", "Suzy"),
age = c(23, 41, 32))
write.csv(df,"C:\\Users\\Matheus\\Desktop\\MyData.csv", row.names = FALSE)
# Read csv with R
data <- read.csv("input.csv")
print(data)
@Aphellirus
Aphellirus / object-transform.cs
Created July 27, 2021 07:21
Every object in a Scene has a Transform. We can use it to store and manipulate the position, rotation and scale of the object.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectTransform : MonoBehaviour
{
// Start is called before the first frame update
private Vector3 startPosition;
public bool changePosition, moveInCircles;
@Aphellirus
Aphellirus / object-control.cs
Created July 27, 2021 07:24
Controling an Object's movement through Keyboard input
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class objectControl : MonoBehaviour
{
public float speed = 3.0f;
void Update()
{
@Aphellirus
Aphellirus / build.md
Last active July 29, 2021 08:10
Docker Cheat sheet
Command Description
docker build -t myimage:1.0 Build an image from the Dockerfile in the current directory and tag the image
docker image ls List all images that are locally stored with the Docker Engine
docker image rm alpine:3.4 Delete an image from the local image store
@Aphellirus
Aphellirus / ruby_bundler_inline.rb
Created August 25, 2021 07:12
bundler/inline for automation in Ruby
=begin
With bundler/inline there is no need to use external gems
it lets you download/install/activate gems directly in the script
skipping the need to handle bundle install or call it through bundle exec
=end
require 'bundler/inline'
@Aphellirus
Aphellirus / google_drive_file_downloader.py
Created August 30, 2021 19:26
Helps to download google drive files with ease 🎉
# Installing the Package:
pip install googleDriveFileDownloader
# Sample code:
from googleDriveFileDownloader import googleDriveFileDownloader
gdownloader = googleDriveFileDownloader()
gdownloader.downloadFile("https://drive.google.com/uc?id=1O4x8rwGJAh8gRo8sjm0kuKFf6vCEm93G&export=download")