This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package controller; | |
import dao.PersonDAO; | |
import java.io.IOException; | |
import java.io.PrintWriter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dao; | |
import java.sql.Connection; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.util.ArrayList; | |
import model.Person; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dao; | |
import java.sql.Statement; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
public class ConnectionClass { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package model; | |
public class Person { | |
public Person() { | |
} | |
public String name; | |
public String phone; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Programa desenvolvido por Rodrigo Araujo. | |
Materia: Compiladores | |
Orientador: jose couto | |
programa: reconhecedor de estrutura de repeticao FOR do java | |
""" | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
from sklearn.cross_validation import cross_val_score | |
from sklearn.linear_model import LogisticRegression | |
""" | |
Here we solve the problem of predicting if a wine is white or red | |
""" | |
reds = pd.read_csv('winequality-red.csv', sep=';') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.JFrame; | |
import org.math.plot.*; | |
public class TestGradDescent { | |
public static void main(String[] args ){ | |
InitialData id = new InitialData(); | |
id.plotData(); | |
GradientDescent gd = new GradientDescent(id); | |
gd.execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void printConvergence(){ | |
double[] theta0plot2 = new double[iters]; | |
double[] theta1plot2 = new double[iters]; | |
double[] tplot2 = new double[iters]; | |
System.arraycopy(theta0plot, 0, theta0plot2, 0, iters); | |
System.arraycopy(theta1plot, 0, theta1plot2, 0, iters); | |
System.arraycopy(tplot, 0, tplot2, 0, iters); | |
// Plot the convergence of data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void addTrendLine(Plot2DPanel plot, boolean removePrev){ | |
if (removePrev){ | |
plot.removePlot(trendline); | |
} | |
double[] yEnd = new double[initial_data.x.length]; | |
for (int i=0; i<initial_data.x.length; i++) | |
yEnd[i] = hypothesisFunction(initial_data.x[i]); | |
trendline = plot.addLinePlot("final", initial_data.x, yEnd); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void execute(){ | |
do { | |
this.theta1 -= alpha * deriveTheta1(); | |
this.theta0 -= alpha * deriveTheta0(); | |
//used for plotting | |
tplot[iters] = iters; | |
theta0plot[iters] = theta0; | |
theta1plot[iters] = theta1; |