teleren/devto huggingface dataset:
R2
Published: 2024-04-24 14:17:29

R2 skoru, bir regresyon modelinin ne kadar iyi performans gösterdiğini ölçmek için kullanılan bir metriktir. Adı genellikle "R kare" olarak okunur ve "açıklanan varyansın yüzdesi" olarak da bilinir.

R2 skoru, bağımsız değişkenler tarafından bağımlı değişkendeki varyansın ne kadarının açıklanabildiğini ölçer. Yani, modelin verilerin dağılımını ne kadar iyi yakaladığını belirler.

R2 skorunun değeri 0 ile 1 arasında değişir:

R2 skoru 1'e yaklaştıkça, modelin performansı artar. R2 skoru 1 olduğunda, model tüm varyansı mükemmel bir şekilde açıklar. Yani, model verileri mükemmel bir şekilde tahmin eder.
R2 skoru 0'a yaklaştıkça, modelin performansı düşer. R2 skoru 0 olduğunda, model hiçbir varyansı açıklayamaz. Yani, model verileri tahmin etme konusunda çok kötüdür.
Makine öğrenmesinde R2 skoru, bir regresyon modelinin ne kadar iyi performans gösterdiğini değerlendirmek için yaygın olarak kullanılır. Ancak, R2 skorunun her zaman mükemmel bir performans göstergesi olmadığını unutmamak önemlidir. Örneğin, aşırı uyumlu bir modelin R2 skoru çok yüksek olabilir, ancak bu model yeni verilerle iyi performans göstermeyebilir.

Python'da, scikit-learn kütüphanesi r2_score fonksiyonunu sağlar. Bu fonksiyon, gerçek değerler ve modelin tahminleri arasındaki R2 skorunu hesaplar. İşte bir örnek:

```
from sklearn.metrics import r2_score

# Assume y_true are the true values and y_pred are the model's predictions
y_true = [3, -0.5, 2, 7]
y_pred = [2.5, 0.0, 2, 8]

r2 = r2_score(y_true, y_pred)
print(r2)
```
Bu kodun çıktısı R2 skorunu yazar.

Formülü ise şu şekildedir.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbydorei5d8x2e5dug4i.png)



R2 skoru genellikle aşağıdaki formül ile hesaplanır:

R^2 = 1 - (SSres / SStot)

Burada:

SSres, "rezidüel kareler toplamı" anlamına gelir. Bu, modelin tahminlerinin ve gerçek değerlerin farkının karelerinin toplamıdır. Yani, bu, modelin hatalarının karelerinin toplamını ölçer.

SStot, "toplam kareler toplamı" anlamına gelir. Bu, gerçek değerlerin ve gerçek değerlerin ortalamasının farkının karelerinin toplamıdır. Yani, bu, verilerin ne kadar değişken olduğunu ölçer.

Formülde SSres / SStot oranı, modelin hatalarının verilerin toplam değişkenliğine oranını verir. Bu oran, 0'dan büyük veya eşit ve 1'den küçük veya eşit olmalıdır. Eğer model mükemmel bir tahmin yaparsa (yani, tüm tahminler doğruysa), o zaman SSres 0 olur ve bu nedenle R^2 1 olur.

R^2 skorunun 1'den çıkartılması, modelin açıkladığı varyansın yüzdesini verir. Yani, R^2 = 1 - (SSres / SStot) formülü, bağımsız değişken(ler) tarafından bağımlı değişkendeki varyansın ne kadarının açıklanabildiğini ölçer.

Bu nedenle, R^2 skoru genellikle bir regresyon modelinin ne kadar iyi performans gösterdiğini ölçmek için kullanılır. Ancak, R^2 skorunun her zaman mükemmel bir performans göstergesi olmadığını unutmamak önemlidir. Örneğin, aşırı uyumlu bir modelin R^2 skoru çok yüksek olabilir, ancak bu model yeni verilerle iyi performans göstermeyebilir.
Assignment Statements and Assignment Expressions
Tags: java, learning, beginners, programming
Published: 2024-04-24 14:16:38

An assignment statement designates a value for a variable. An assignment statement can be used as an expression in Java. After a variable is declared, you can assign a value to it by using an _assignment statement_. In Java, the equal sign (**=**) is used as the assignment operator. The syntax for assignment statements is as follows:

```
variable = expression;

```
An _expression_ represents a computation involving values, variables, and operators that, taking them together, evaluates to a value. For example, consider the following code:

```
int y = 1; // Assign 1 to variable y
double radius = 1.0; // Assign 1.0 to variable radius
int x = 5 * (3 / 2); // Assign the value of the expression to x
x = y + 1; // Assign the addition of y and 1 to x
double area = radius * radius * 3.14159; // Compute area
```
You can use a variable in an expression. A variable can also be used in both sides of the = operator. For example,

```
x = x + 1;

```
In this assignment statement, the result of **x + 1** is assigned to **x**. If **x** is **1** before the statement is executed, then it becomes **2** after the statement is executed. To assign a value to a variable, you must place the variable name to the left of the assignment operator. Thus, the following statement is wrong:

```
1 = x; // Wrong

```
In mathematics, **x = 2 * x + 1** denotes an equation. However, in Java, **x = 2 * x + 1** is an assignment statement that evaluates the expression **2 * x + 1** and assigns the result to **x**.

In Java, an assignment statement is essentially an expression that evaluates to the value to be assigned to the variable on the left side of the assignment operator. For this reason, an
assignment statement is also known as an _assignment expression_. For example, the following statement is correct:

```
System.out.println(x = 1);

```
which is equivalent to

```
x = 1;
System.out.println(x);
```
If a value is assigned to multiple variables, you can use this syntax:

```
i = j = k = 1;

```
which is equivalent to

```
k = 1;
j = k;
i = j;
```
In an assignment statement, the data type of the variable on the left must be compatible with the data type of the value on the right. For example, **int x = 1.0** would be illegal, because the data type of **x** is **int**. You cannot assign a **double** value (**1.0**) to an **int** variable without using type casting.
Variables
Tags: java, learning, beginners, programming
Published: 2024-04-24 14:02:52

Variables are used to represent values that may be changed in the program. They are called variables because their values can be changed. Variables are for representing data of a certain type. To use a variable, you declare it by telling the compiler its name as well as what type of data it can store. The _variable declaration_ tells the compiler to allocate appropriate memory space for the variable based on its data type. The syntax for declaring a variable is

```
datatype variableName;

```
Here are some examples of variable declarations:

```
int count; // Declare count to be an integer variable
double radius; // Declare radius to be a double variable
double interestRate; // Declare interestRate to be a double variable
```
These examples use the data types **int** and **double**. Later you will be introduced to additional data types, such as **byte**, **short**, **long**, **float**, **char**, and **boolean**.
If variables are of the same type, they can be declared together, as follows:

```
datatype variable1, variable2, ..., variablen;

```
The variables are separated by commas. For example,

```
int i, j, k; // Declare i, j, and k as int variables

```
Variables often have initial values. You can declare a variable and initialize it in one step. Consider, for instance, the following code:

```
int count = 1;

```
This is equivalent to the next two statements:

```
int count;
count = 1;
```
You can also use a shorthand form to declare and initialize variables of the same type together. For example,

```
int i = 1, j = 2;

```
A variable must be declared before it can be assigned a value. A variable declared in a method must be assigned a value before it can be used. Whenever possible, declare a variable and assign its initial value in one step. This will
make the program easy to read and avoid programming errors.
Every variable has a scope. The _scope of a variable_ is the part of the program where the variable can be referenced.
Java Developer Roadmap 2024
Tags: java, javadeveloper, developerroadmap, programming
Published: 2024-04-24 13:56:38

**Essential Skills for Java Developers:**

<u>Version Control:</u> Achieve fluency in Git and GitHub to manage and track code effectively.

<u>Linux Command Line:</u> Essential for server management and script execution.

<u>Data Structures and Algorithms</u>: Core knowledge for crafting efficient code.

<u>HTTP/HTTPS Protocols:</u> Understand server communication for web development.

<u>Design Patterns:</u> Implement sophisticated architectural solutions in software design.

**Key Development Tools:**

<u>IDEs:</u> IntelliJ IDEA or Eclipse for code development.

<u>Build Tools:</u> Maven and Gradle for project management.

<u>Containers:</u> Docker and Kubernetes for application deployment.

<u>CI/CD Tools:</u> Jenkins and TeamCity for continuous integration and delivery.

**Frameworks and Libraries:**

<u>Spring:</u> Comprehensive application development.

<u>Hibernate:</u> Simplify database management with ORM.

<u>Apache Camel:</u> Integration of different systems with ease.

**Focus Areas:**

<u>Web Development:</u> Using Servlets, JSP, and Spring MVC for dynamic web applications.

<u>Desktop Applications:</u> JavaFX for creating cross-platform desktop software.

<u>Android Development:</u> Android Studio for mobile application creation on Android platforms.

**Advanced Practices:**

<u>Unit Testing and TDD:</u> Emphasize reliability with tools like JUnit.

<u>Version Control and Collaboration:</u> Leverage Git and GitHub for efficient team collaboration.

<u>Deployment and Cloud:</u> Utilize Docker for deployment and understand cloud database integration.

This [Java developer roadmap](https://bluebirdinternational.com/java-developer-roadmap/) is your guide to becoming a proficient Java developer by 2024.
Identifiers
Tags: learning, beginners, java, programming
Published: 2024-04-24 13:56:07

Identifiers are the names that identify the elements such as classes, methods, and variables in a program. All identifiers must obey the following rules:

- An identifier is a sequence of characters that consists of letters, digits, underscores
(**_**), and dollar signs (**$**).

- An identifier must start with a letter, an underscore (**_**), or a dollar sign (**$**). It cannot
start with a digit.

- An identifier cannot be a reserved word.

- An identifier cannot be **true**, **false**, or **null**.

- An identifier can be of any length.

The Java compiler detects illegal identifiers and reports syntax errors. Since Java is case sensitive, **area**, **Area**, and **AREA** are all different identifiers. 

Identifiers are for naming variables, methods, classes, and other items in a program. Descriptive identifiers make programs easy to read. Avoid using abbreviations for identifiers. Using complete words is more descriptive. For example, **numberOfStudents** is better than **numStuds**, **numOfStuds**, or **numOfStudents**. We use descriptive names for complete programs in the text. However, we will occasionally use variable names such as **i**, **j**, **k**, **x**, and **y** in the code snippets for brevity. These names also provide a generic tone to the code snippets.
Do not name identifiers with the **$** character. By convention, the **$** character should be used only in mechanically generated source code
Done Glamming my markup!
Tags: devchallenge, frontendchallenge, css, javascript
Published: 2024-04-24 13:54:06

_This is a submission for [Frontend Challenge v24.04.17](https://dev.to/devteam/join-us-for-the-next-frontend-challenge-earth-day-edition-52e4), Glam Up My Markup: Earth Day Celebration Landing Page_

---

## What I Built

a simple landing page for earth day with markup data for challenge

---

## Live Demo

{% embed https://arnavk-09.github.io/earth-day-markup/ %}

---

### Checkout GitHub repo for better info!

[https://github.com/ArnavK-09/earth-day-markup](https://github.com/ArnavK-09/earth-day-markup)

---

{% embed https://github.com/ArnavK-09/earth-day-markup %}
---
I ran in to a problem Solidity I need Some help
Tags: solidity, javascript, solidjs
Published: 2024-04-24 13:53:45

I was Trying it for 3days to fixed it
it's Hashlips contracts/NFT/NFT_FULL.sol
The Problem it was I put in https://remix.ethereum.org He show an erro in (using Strings for uint256;) Strings
and I fixed it (import "@openzeppelin/contracts/utils/Strings.sol":wink: it's become ok but He show onther erro
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);

_exists(tokenId), exists it;s The erro 


Please I need some Help
Reading Input from the Console
Tags: learning, java, programming, beginners
Published: 2024-04-24 13:47:32

Reading input from the console enables the program to accept input from the user. Java uses **System.out** to refer to the standard output device and **System.in** to the standard input device. By default, the output device is the display monitor and the input device is the keyboard. To perform console output, you simply use the **println** method to display a primitive value or a string to the console. Console input is not directly supported in Java, but you can use the **Scanner** class to create an object to read input from **System.in**, as follows:

```
Scanner input = new Scanner(System.in);

```
The syntax **new Scanner(System.in)** creates an object of the **Scanner** type. The syntax **Scanner input** declares that **input** is a variable whose type is **Scanner**. The whole line **Scanner input = new Scanner(System.in)** creates a **Scanner** object and assigns its reference to the variable **input**. An object may invoke its methods. To invoke a method on an object is to ask the object to perform a task. You can invoke the **nextDouble()** method to read a **double** value as follows:

```
double radius = input.nextDouble();
```
This statement reads a number from the keyboard and assigns the number to radius

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3czug43lfgwerhdyqj47.png)

After the user enters a number and presses the _Enter_ key, the program reads the number and assigns it to **radius**.

The **Scanner** class is in the **java.util** package. It is imported in line 1. There are two types of **import** statements: _specific import_ and _wildcard import_. The _specific import_ specifies a single class in the import statement. For example, the following statement imports **Scanner** from the package **java.util**.

```
import java.util.Scanner;

```
The _wildcard import_ imports all the classes in a package by using the asterisk as the wildcard. For example, the following statement imports all the classes from the package
**java.util**.

```
import java.uitl.*;

```
The information for the classes in an imported package is not read in at compile time or runtime unless the class is used in the program. The import statement simply tells the compiler where to locate the classes. There is no performance difference between a specific import and a wildcard import declaration.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x59xn849w092m9e9tmfx.png)

You may enter three numbers separated by spaces, then press the _Enter_ key, or enter each number followed by a press of the _Enter_ key, as shown in the sample runs of this program. If you entered an input other than a numeric value, a runtime error would occur.
From Zero to Hero: Learning Java Through Coding Challenges
Tags: java, programming
Published: 2024-04-24 13:43:11

##Why Coding Challenges?
Coding challenges serve as the crucible where raw knowledge meets practical application. They provide a structured environment for beginners to grapple with real-world problems, honing their problem-solving skills and deepening their understanding of Java's core concepts. Moreover, they offer a safe space to experiment, make mistakes, and learn from them—an essential aspect of any learning journey.

##The Power of Practice
As the saying goes, practice makes perfect. By consistently engaging with coding challenges, beginners gradually internalize Java's syntax, semantics, and best practices. Each challenge presents a unique puzzle to solve, requiring participants to apply their knowledge creatively. This iterative process not only reinforces what they've learned but also exposes them to new concepts and techniques.

##Building Confidence
One of the most significant hurdles for beginners is the lack of confidence in their coding abilities. However, as they conquer one challenge after another, their confidence soars. With each successfully solved problem, they gain a sense of achievement and validation, spurring them on to tackle even more complex tasks. This newfound confidence becomes the catalyst for their continued growth and development as Java programmers.

##Fostering Community and Collaboration
Learning Java through coding challenges is not a solitary endeavor. Many online platforms host vibrant communities of learners and experienced programmers who come together to share knowledge, offer support, and celebrate successes. Engaging with such communities fosters a spirit of collaboration and camaraderie, enriching the learning experience and providing invaluable networking opportunities.

##Getting Started
So, how can you embark on this exhilarating journey from zero to Java hero? Here are some steps to guide you:

1. **Choose Your Platform:** Explore online coding challenge platforms such as LeetCode, HackerRank, or CodeSignal.
2. **Start Small:** Begin with beginner-friendly challenges to familiarize yourself with the platform and basic Java concepts.
3. **Stay Consistent:** Dedicate regular time to tackle coding challenges, gradually increasing the difficulty as you progress.
4. **Learn from Others:** Don't hesitate to seek help from online forums, tutorials, or fellow learners whenever you encounter difficulties.
5. **Track Your Progress:** Keep a record of the challenges you've completed and the concepts you've mastered to monitor your growth.

##Conclusion
Learning Java through coding challenges is a thrilling and effective way for beginners to sharpen their skills and become proficient programmers. By embracing challenges, practicing consistently, building confidence, and engaging with communities, you can embark on a transformative journey from zero to hero in the world of Java programming. So, what are you waiting for? Let the coding adventures begin!
They successfully helped me in getting 90% of what I lost
Tags: webdev, recovery, btc, money
Published: 2024-04-24 13:35:37

Your choice of word ‘urgently’ sounds a little bit scary cause if you rush to recover your money you might possibly end up losing your money again. There are a lot of scam recovery agents that have zero expertise in tracking or getting money back from scammers. Exercising patience is key when trying to apprehend a thief, even police departments takes as much as two years in unravelling some cases. When you get scammed endeavor to document every detail you have of the scammer. Seek help with your local law enforcement before resulting to find help elsewhere.

Funds recovering experts will attend to you with some regard of urgency when compared to your local law enforcement, but still don’t expect it to be very swift to avoid getting scammed again. Recovery takes a process and won’t take as soon as you might want it. A company CNC Intelligence (Cnc_intelligence@cyber-wizard.com) Helped me in recovering my money and the expertise they exhibited in recovering my money is recommendable, I visited their office and met with their officials before trusting them with my case. They successfully helped me in getting 90% of what I lost.
Transducers and Eduction in Clojure simply explained
Tags: clojure, dataflow, streaming
Published: 2024-04-24 13:35:36

_With help from our coming AI overlords:_

Transducers and eduction in Clojure are ways to efficiently process and transform data, especially when working with large datasets.

Here's a simple explanation:

### Transducers:
- Transducers are functions that can be composed together to create a sequence of transformations.
- They allow you to define a series of operations (like mapping, filtering, etc.) that can be applied to any collection of data, without having to worry about the specific data structure.
- Transducers are "context-independent" - they don't care about the input or output data structures, they just focus on the transformations.
- This makes transducers very flexible and reusable. You can combine them in different ways to create complex data pipelines.

### Eduction:

- Eduction is a way to apply a transducer to a collection of data without creating intermediate data structures.
- Normally, when you apply a series of transformations to a collection (e.g. map, filter, etc.), you end up creating a new collection at each step.
- With eduction, the transformations are applied "on the fly" as the data is consumed, without creating those intermediate collections.
- This can be much more efficient, especially when working with large datasets, because you don't have to allocate memory for all the intermediate results.
- `eduction` is a Clojure core function that takes transducers as arguments, and captures the transduction process into a function. It applies the transducers to the input collection, but the result is a reducible/iterable, not a concrete data structure. You need to use functions like `iterator-seq` to get a sequence from the reducible result.

In summary, **transducers** allow you to **_define_ reusable data transformations**, and **eduction** allows you to **_apply_ those transformations efficiently without creating unnecessary data structures**. Together, they provide a powerful way to build composable, high-performance data processing pipelines in Clojure.

Eduction is best used when the result will be completely consumed in a reducible context. But transducers can be used with other functions as well, depending on the specific use case.
Constructors and Generators in Python
Tags: webdev, python, programming, datascience
Published: 2024-04-24 13:28:47

Constructors in [Python](https://www.almabetter.com/bytes/tutorials/python/constructors-and-generators-in-python) are special methods used to initialize objects of a class. They are defined using the `__init__()` method and are automatically invoked when an object is created. Constructors can initialize instance variables and perform any necessary setup tasks.

Generators in Python are functions that produce a sequence of values lazily, allowing for memory-efficient iteration over large datasets. They are defined using the `yield` keyword instead of `return`. Generators pause and resume execution, producing values on-the-fly, which is useful for tasks like processing large files or generating infinite sequences.
My go-to Python snippets
Published: 2024-04-24 13:19:49

This is a blog post just for me, but it's all of the Python snippets I repeatedly look up or reference from other parts of my codebase.

## Snippets List
- Read File into Words
- Read JSON File into Dict

## Read File Into Words
```py
def read_file_into_words(filename: str) -> list[list[str]]:
    """Parse a text file into a 2D list of words, i.e.
        "This is an example file with
        multiple lines of text" becomes
        [["This", "is", "an", "example", "file", "with"],
        "multiple", "lines", "of", "text"].

    Args:
        filename (str): Path to text file.

    Returns:
        list[list[str]]: 2D list of string words.
    """
    with open(filename) as input_file:
        content = input_file.readlines()
    content = [word.strip() for word in content]
    return content
```

## Read JSON File into Dict
```py
import json

def read_json_file_into_dict(filename: str) -> dict:
    """Parse a JSON file into a dictionary.

    Args:
        filename (str): Path to JSON file.

    Returns:
        dict: Dictionary representation of JSON file contents.
    """
    with open(filename, "r", encoding="utf-8") as json_file:
        content = json.load(json_file)
    return content
```