Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신은섭(Shin Eun Seop)
/
Detecting_fraud_clicks
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
2
Merge Requests
0
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
EC2 Default User
2018-06-05 04:53:18 +0000
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
70ed7f2021c578f7d19fe92b0b79faa8f3c1743c
70ed7f20
2 parents
1cadce73
033b9164
Merge branch 'ml' of
https://github.com/Java-Cesco/Detecting_fraud_clicks
into ml
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
README.md
src/main/java/detact/Aggregation.java
src/main/java/detact/Utill.java
README.md
View file @
70ed7f2
...
...
@@ -14,7 +14,6 @@ sudo yum install git -y
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/
\$
releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven java-1.8.0-openjdk-devel.x86_64
sudo yum remove -y java-1.7.0
*
mvn --version
...
...
@@ -26,7 +25,8 @@ cd Detecting_fraud_clicks
mvn package
# run
java -jar target/assembly/Detecting_fraud_clicks-aggregation.jar train_sample.csv agg_data
java -jar target/assembly/Detecting_fraud_clicks-decisionTree.jar agg_data
java
8
-jar target/assembly/Detecting_fraud_clicks-aggregation.jar train_sample.csv agg_data
java
8
-jar target/assembly/Detecting_fraud_clicks-decisionTree.jar agg_data
```
> NOTE. if you face Memory error using `-Xmx2g` option in `java`
\ No newline at end of file
...
...
src/main/java/detact/Aggregation.java
View file @
70ed7f2
...
...
@@ -38,7 +38,7 @@ public class Aggregation {
dataset
=
agg
.
countClickInTenMinutes
(
dataset
);
// test
dataset
.
where
(
"ip == '5348' and app == '19'"
).
show
(
10
);
//
dataset.where("ip == '5348' and app == '19'").show(10);
// Save to scv
Utill
.
saveCSVDataSet
(
dataset
,
result_path
);
...
...
src/main/java/detact/Utill.java
View file @
70ed7f2
...
...
@@ -16,8 +16,7 @@ public class Utill {
public
static
void
saveCSVDataSet
(
Dataset
<
Row
>
dataset
,
String
path
){
// Read SCV to DataSet
dataset
.
repartition
(
1
)
.
write
().
format
(
"com.databricks.spark.csv"
)
dataset
.
write
().
format
(
"com.databricks.spark.csv"
)
.
option
(
"inferSchema"
,
"true"
)
.
option
(
"header"
,
"true"
)
.
save
(
path
);
...
...
Please
register
or
login
to post a comment