Skip to content

Instantly share code, notes, and snippets.

View tabuna's full-sized avatar

Alexandr Chernyaev tabuna

View GitHub Profile
@tabuna
tabuna / NaiveBayes.md
Created November 29, 2017 07:31
Machine Learning: Naive Bayes

Machine learning is becoming more and more ubiquitous in our daily lives. From thermostats which know when you will be home, to smarter cars and the phone we have in our pocket. It seems like it is everywhere and that makes it an interesting field to explore! But what is machine learning? In general terms, it is a way for a system to learn and make predictions. This can be as simple as predicting relevant shopping items to as complex as a digital assistant.

With this blog post I will try to give an introduction into classification using the Naive Bayes classifier algorithm. It is an easy algorithm to implement while giving decent results. But it will need some statistic knowledge to understand, so bear with me. By the end of it you might see some applications and even try to implement it yourself!

S

@tabuna
tabuna / Demo.php
Created October 31, 2017 21:19
Screen Draft
<?php
namespace App\Core\Screens;
use App\Core\Layout\TestColums;
use Illuminate\Http\Request;
use Orchid\Platform\Screen\Screen;
class Demo extends Screen
{
@tabuna
tabuna / index.php
Last active June 13, 2018 10:26
Lumen & React PHP
<?php
//"react/event-loop": "^0.4.3",
//"react/http": "^0.7.2",
//"symfony/psr-http-message-bridge": "^1.0"
/*
|--------------------------------------------------------------------------
| Create The Application
@tabuna
tabuna / DemoPost.php
Created July 23, 2017 09:04
Behaviors
<?php
namespace App\Core\Behaviors\Many;
use Orchid\Behaviors\Many;
use Orchid\Http\Forms\Posts\BasePostForm;
use Orchid\Http\Forms\Posts\UploadPostForm;
class DemoPost extends Many
{
@tabuna
tabuna / parse.php
Created July 20, 2017 13:43
Top 1M
<?php
require 'vendor/autoload.php';
$top = fopen('./top-1m.csv','r');
$client = new GuzzleHttp\Client();
while ( ($data = fgetcsv($top) ) !== FALSE ) {
$sitename = $data[1]; // google.com
@tabuna
tabuna / main.blade.php
Created June 3, 2017 20:41
main.blade.php
@extends('layouts.app')
@section('content')
<!-- Page Header -->
<!-- Set your background image for this header on the line below. -->
<header class="intro-header" style="background-image: url('img/home-bg.jpg')">
<div class="container">
<div class="row">
@tabuna
tabuna / post.blade.php
Last active June 3, 2017 20:40
post.blade.php
@extends('layouts.app')
@section('title',$post->getContent('title'))
@section('keywords',$post->getContent('keywords'))
@section('description',$post->getContent('description'))
@section('content')
@tabuna
tabuna / BlogController.php
Created June 3, 2017 20:33
BlogController.php
<?php
namespace App\Http\Controllers;
use Orchid\Core\Models\Post;
class BlogController extends Controller
{
/**
@tabuna
tabuna / Blog.php
Created June 3, 2017 20:22
Blog.php
<?php
namespace App\Core\Behaviors\Many;
use Orchid\Behaviors\Many;
use Orchid\Http\Forms\Posts\BasePostForm;
use Orchid\Http\Forms\Posts\UploadPostForm;
class Blog extends Many
{
@tabuna
tabuna / menu.blade.php
Created June 3, 2017 20:07
menu.blade.php
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
@foreach($menu as $item)
<li>
<a href="{{$item->slug}}"
title="{{$item->title}}"
target="{{$item->target}}"
rel="{{$item->robot}}"